Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,9 +44,10 @@ def sentiment_analysis(text):
|
|
44 |
X_input_ids, X_attention_mask = preprocess_input_data(text, arabert_tokenizer)
|
45 |
predictions = model(X_input_ids)
|
46 |
a=predictions.numpy()
|
47 |
-
|
|
|
48 |
|
49 |
-
|
50 |
|
51 |
|
52 |
iface = gr.Interface(fn=sentiment_analysis, inputs="text", outputs="text")
|
|
|
44 |
X_input_ids, X_attention_mask = preprocess_input_data(text, arabert_tokenizer)
|
45 |
predictions = model(X_input_ids)
|
46 |
a=predictions.numpy()
|
47 |
+
import numpy as np
|
48 |
+
predicted_class=list(np.where(preds <0.5,0,1).reshape(len(preds),1))
|
49 |
|
50 |
+
return predicted_class
|
51 |
|
52 |
|
53 |
iface = gr.Interface(fn=sentiment_analysis, inputs="text", outputs="text")
|