Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -44,8 +44,8 @@ def sentiment_analysis(text):
|
|
44 |
X_input_ids, X_attention_mask = preprocess_input_data(text, arabert_tokenizer)
|
45 |
preds = model(X_input_ids)
|
46 |
import numpy as np
|
47 |
-
|
48 |
-
|
49 |
return predicted_class
|
50 |
|
51 |
|
|
|
44 |
X_input_ids, X_attention_mask = preprocess_input_data(text, arabert_tokenizer)
|
45 |
preds = model(X_input_ids)
|
46 |
import numpy as np
|
47 |
+
predicted_classe=list(np.where(preds <0.5,0,1).reshape(len(preds),1))
|
48 |
+
predicted_class = ''.join(str(x) for x in np.where(preds < 0.5, 0, 1).flatten())
|
49 |
return predicted_class
|
50 |
|
51 |
|