Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -42,8 +42,7 @@ def preprocess_input_data(texts, tokenizer, max_len=120):
|
|
| 42 |
return input_ids, attention_mask
|
| 43 |
def sentiment_analysis(text):
|
| 44 |
X_input_ids, X_attention_mask = preprocess_input_data(text, arabert_tokenizer)
|
| 45 |
-
|
| 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 |
|
|
|
|
| 42 |
return input_ids, attention_mask
|
| 43 |
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 |
predicted_class=list(np.where(preds <0.5,0,1).reshape(len(preds),1))
|
| 48 |
|