Spaces:
Running
Running
Update StockSentimentNews.py
Browse files- StockSentimentNews.py +4 -0
StockSentimentNews.py
CHANGED
@@ -134,10 +134,14 @@ def sentiment_analysis(querystring, headers):
|
|
134 |
print(f"Positive/Negative Ratio: {output['sentiment_metrics']['sentiment_ratio']:.2f}")
|
135 |
print(f"Average Confidence: {output['sentiment_metrics']['average_confidence']:.1f}%")
|
136 |
|
|
|
|
|
137 |
import json
|
138 |
with open("sentiment_results.json", "w") as f:
|
139 |
json.dump(output, f, indent=2)
|
140 |
print("Results saved to sentiment_results.json")
|
|
|
|
|
141 |
return output
|
142 |
|
143 |
def mainOne(querystring):
|
|
|
134 |
print(f"Positive/Negative Ratio: {output['sentiment_metrics']['sentiment_ratio']:.2f}")
|
135 |
print(f"Average Confidence: {output['sentiment_metrics']['average_confidence']:.1f}%")
|
136 |
|
137 |
+
|
138 |
+
"""
|
139 |
import json
|
140 |
with open("sentiment_results.json", "w") as f:
|
141 |
json.dump(output, f, indent=2)
|
142 |
print("Results saved to sentiment_results.json")
|
143 |
+
"""
|
144 |
+
|
145 |
return output
|
146 |
|
147 |
def mainOne(querystring):
|