xclasscode commited on
Commit
c19a330
·
1 Parent(s): 9690ed8

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -28,8 +28,8 @@ def create_sentiment_result(sentiment_result: schemas.SentimentResultCreate, tex
28
 
29
  # Create a new SentimentResult instance
30
  new_sentiment_result = models.SentimentResult(
31
- positive_score=sentiment_analysis_result["score"] if sentiment_analysis_result["label"] == "POSITIVE" else 0.0,
32
- negative_score=sentiment_analysis_result["score"] if sentiment_analysis_result["label"] == "NEGATIVE" else 0.0,
33
  text_input=text_content
34
  )
35
 
 
28
 
29
  # Create a new SentimentResult instance
30
  new_sentiment_result = models.SentimentResult(
31
+ score=sentiment_analysis_result[0]['score'],
32
+ label = sentiment_analysis_result[0]['label'],
33
  text_input=text_content
34
  )
35