Spaces:
Runtime error
Runtime error
Commit
·
e8e558d
1
Parent(s):
bf223e4
Update main.py
Browse files
main.py
CHANGED
@@ -27,8 +27,8 @@ def create_sentiment_result(sentiment_result: schemas.SentimentResultCreate,text
|
|
27 |
# Create a new SentimentResult instance
|
28 |
new_sentiment_result = models.SentimentResult(
|
29 |
positive_score=sentiment_analysis_result["score"] if sentiment_analysis_result["label"] == "POSITIVE" else 0.0,
|
30 |
-
negative_score=sentiment_analysis_result["score"] if sentiment_analysis_result["label"] == "NEGATIVE" else 0
|
31 |
-
|
32 |
)
|
33 |
# Add the new SentimentResult to the database
|
34 |
db.add(new_sentiment_result)
|
|
|
27 |
# Create a new SentimentResult instance
|
28 |
new_sentiment_result = models.SentimentResult(
|
29 |
positive_score=sentiment_analysis_result["score"] if sentiment_analysis_result["label"] == "POSITIVE" else 0.0,
|
30 |
+
negative_score=sentiment_analysis_result["score"] if sentiment_analysis_result["label"] == "NEGATIVE" else 0.0,
|
31 |
+
text_input=text_content
|
32 |
)
|
33 |
# Add the new SentimentResult to the database
|
34 |
db.add(new_sentiment_result)
|