This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trainData.write.json("src/main/resources/_processed/JSON/data") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import re | |
| stopwords = ["a","i", "me", "my", "myself", "we", "our", "ours", "ourselves", "you", "your", "yours", | |
| "yourself", "yourselves", "he", "him", "his", "himself", "she", "her", "hers", "herself", | |
| "it", "its", "itself", "they", "them", "their", "theirs", "themselves", "what", "which", | |
| "who", "whom", "this", "that", "these", "those", "am", "is", "are", "was", "were", "be", | |
| "been", "being", "have", "has", "had", "having", "do", "does", "did", "doing", "a", "an", | |
| "the", "and", "but", "if", "or", "because", "as", "until", "while", "of", "at", "by", "for", | |
| "with", "about", "against", "between", "into", "through", "during", "before", "after", "above", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val data = spark | |
| .read | |
| .option("inferSchema", "true") | |
| .option("header", "true") | |
| .csv(args.head) | |
| val stopwords = List("i", "me", "my", "myself", "we", "our", "ours", "ourselves", "you", "your", "yours", "yourself", | |
| "yourselves", "he", "him", "his", "himself", "she", "her", "hers", "herself", "it", "its", "itself", "they", "them", | |
| "their", "theirs", "themselves", "what", "which", "who", "whom", "this", "that", "these", "those", "am", "is", | |
| "are", "was", "were", "be", "been", "being", "have", "has", "had", "having", "do", "does", "did", "doing", "a", | |
| "an", "the", "and", "but", "if", "or", "because", "as", "until", "while", "of", "at", "by", "for", "with", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val data = spark | |
| .read | |
| .option("inferSchema", "true") | |
| .option("header", "true") | |
| .csv(args.head) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val conf = new SparkConf() | |
| .setAppName("BGReview ETL") | |
| .setMaster("local[8]") | |
| val sc = new SparkContext(conf) | |
| val spark = SparkSession | |
| .builder() | |
| .appName("BGReview ETL") | |
| .getOrCreate() |