forked from IllinoisSocialMediaMacroscope/smm-analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from ncsa/release/beta
Release/beta
- Loading branch information
Showing
51 changed files
with
1,445 additions
and
1,870 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM ubuntu:20.04 | ||
|
||
# git clone autophrase algorithm | ||
RUN apt-get update \ | ||
&& apt-get -y install git && apt-get -y install cron \ | ||
&& cd / && git clone https://github.com/IllinoisSocialMediaMacroscope/SMILE-AutoPhrase.git AutoPhrase | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import argparse | ||
import csv | ||
|
||
import pandas as pd | ||
|
||
from writeToS3 import WriteToS3 | ||
|
||
|
||
def main(s3, remoteReadPath, column): | ||
filename = remoteReadPath.split('/')[-2] + '.csv' | ||
s3.downloadToDisk(filename=filename, localpath='data/', remotepath=remoteReadPath) | ||
|
||
Array = [] | ||
try: | ||
with open('data/' + filename,'r',encoding="utf-8", errors="ignore") as f: | ||
reader = csv.reader(f) | ||
try: | ||
for row in reader: | ||
Array.append(row) | ||
except Exception as e: | ||
pass | ||
except: | ||
with open('data/' + filename,'r',encoding="ISO-8859-1", errors="ignore") as f: | ||
reader = csv.reader(f) | ||
try: | ||
for row in reader: | ||
Array.append(row) | ||
except Exception as e: | ||
pass | ||
|
||
df = pd.DataFrame(Array[1:],columns=Array[0]) | ||
df[df[column]!=''][column].dropna().astype('str').to_csv('data/raw_train.txt', index=False) | ||
|
||
return None | ||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--remoteReadPath', required=True) | ||
parser.add_argument('--column', required=True) | ||
|
||
# user specified parameters | ||
parsed, unknown = parser.parse_known_args() | ||
for arg in unknown: | ||
if arg.startswith("--"): | ||
parser.add_argument(arg, required=False) | ||
|
||
params = vars(parser.parse_args()) | ||
|
||
s3 = WriteToS3() | ||
main(s3, params['remoteReadPath'], params['column']) |
Oops, something went wrong.