Spaces:
Running
Running
Update api.py
Browse files
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 |
|