Update sentiment.py
Browse files- sentiment.py +2 -2
sentiment.py
CHANGED
@@ -51,7 +51,7 @@ model.classifier = torch.nn.Linear(768, 2)
|
|
51 |
|
52 |
def get_sentiment(query):
|
53 |
print(query)
|
54 |
-
filename = f"
|
55 |
saved_data = load_data(filename)
|
56 |
|
57 |
if saved_data:
|
@@ -147,7 +147,7 @@ def analyze_comments(results, query):
|
|
147 |
min_font_size=10).generate(all_comments_string)
|
148 |
# Save the WordCloud image as a static file
|
149 |
wordcloud.to_file(
|
150 |
-
f'
|
151 |
else:
|
152 |
wordcloud = None
|
153 |
print(f'positive:{avg_positive}')
|
|
|
51 |
|
52 |
def get_sentiment(query):
|
53 |
print(query)
|
54 |
+
filename = f"data/sentiment_analysis/{query}_results.pkl"
|
55 |
saved_data = load_data(filename)
|
56 |
|
57 |
if saved_data:
|
|
|
147 |
min_font_size=10).generate(all_comments_string)
|
148 |
# Save the WordCloud image as a static file
|
149 |
wordcloud.to_file(
|
150 |
+
f'static/images/wordcloud/{query}_cloud.png')
|
151 |
else:
|
152 |
wordcloud = None
|
153 |
print(f'positive:{avg_positive}')
|