xclasscode commited on
Commit
6c868e7
·
1 Parent(s): 37d477c

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -3
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.0,
31
- user_id=sentiment_result.user_id,
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)