AbdoIR commited on
Commit
a516d6e
·
verified ·
1 Parent(s): df5115f

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +2 -0
api.py CHANGED
@@ -67,7 +67,9 @@ def predict():
67
  return jsonify({'error': 'No "content", "tweet", or "text" column found'}), 400
68
 
69
  texts = df[text_col].astype(str).tolist()
 
70
  df['sentiment'] = predict_sentiment(texts)
 
71
 
72
  top_words_df = get_top_words(texts)
73
 
 
67
  return jsonify({'error': 'No "content", "tweet", or "text" column found'}), 400
68
 
69
  texts = df[text_col].astype(str).tolist()
70
+
71
  df['sentiment'] = predict_sentiment(texts)
72
+ df['content_length'] = df[text_col].astype(str).apply(len)
73
 
74
  top_words_df = get_top_words(texts)
75