Spaces:
Runtime error
Runtime error
Commit
·
6c868e7
1
Parent(s):
37d477c
Update main.py
Browse files
main.py
CHANGED
@@ -27,9 +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 |
-
text_id=sentiment_result.text_id
|
33 |
)
|
34 |
# Add the new SentimentResult to the database
|
35 |
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
|
31 |
+
text_content=sentiment_result.text
|
|
|
32 |
)
|
33 |
# Add the new SentimentResult to the database
|
34 |
db.add(new_sentiment_result)
|