Skip to content
Snippets Groups Projects
Commit 8c6b51cd authored by evana's avatar evana
Browse files

Update process.py

parent 16344ac7
Branches
No related tags found
1 merge request!10Patch 2
...@@ -27,7 +27,7 @@ with io.open(file1,'r',encoding="utf-8") as f: ...@@ -27,7 +27,7 @@ with io.open(file1,'r',encoding="utf-8") as f:
tweet = json.loads(line)['text'] tweet = json.loads(line)['text']
my_dict['polarity']=TextBlob(tweet).sentiment.polarity my_dict['polarity']=TextBlob(tweet).sentiment.polarity
my_dict['lang'] = json.loads(line)['lang'] my_dict['lang'] = json.loads(line)['lang']
json.dump(my_dict,output_file,indent=4) output_file.write(json.dumps(my_dict)+',\n')
except: except:
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment