Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -283,7 +283,7 @@ def process_input(text):
|
|
283 |
|
284 |
rf_prediction = rf_model.predict(encoded_text)[0]
|
285 |
isolation_score = isolation_forest.decision_function(encoded_text)[0]
|
286 |
-
nn_prediction = model(torch.LongTensor(encoded_text.
|
287 |
|
288 |
predicted_emotion = emotion_classes[rf_prediction]
|
289 |
sentiment_score = isolation_score
|
@@ -317,6 +317,4 @@ iface = gr.Interface(
|
|
317 |
gr.Textbox(label="GPT Generated Text")
|
318 |
],
|
319 |
live=True
|
320 |
-
)
|
321 |
-
|
322 |
-
iface.launch(share=True)
|
|
|
283 |
|
284 |
rf_prediction = rf_model.predict(encoded_text)[0]
|
285 |
isolation_score = isolation_forest.decision_function(encoded_text)[0]
|
286 |
+
nn_prediction = model(torch.LongTensor(encoded_text.toarray()).to(device)).argmax(dim=1).item()
|
287 |
|
288 |
predicted_emotion = emotion_classes[rf_prediction]
|
289 |
sentiment_score = isolation_score
|
|
|
317 |
gr.Textbox(label="GPT Generated Text")
|
318 |
],
|
319 |
live=True
|
320 |
+
)
|
|
|
|