Spaces:
Runtime error
Runtime error
MahmoudNasser
commited on
Commit
•
7d7fd9c
1
Parent(s):
69fdfff
Update main.py
Browse files
main.py
CHANGED
@@ -177,8 +177,9 @@ def modelsummary(data):
|
|
177 |
def modelpredict(data):
|
178 |
data = txt_preprocess(data)
|
179 |
pred = model.predict(pd.Series([data]))
|
180 |
-
|
181 |
-
|
|
|
182 |
# return {"anger": .90, "happy": .02, "emotionlabel": "anger"}
|
183 |
|
184 |
#OTP code
|
|
|
177 |
def modelpredict(data):
|
178 |
data = txt_preprocess(data)
|
179 |
pred = model.predict(pd.Series([data]))
|
180 |
+
labelpred = np.argmax(pred,axis=0)
|
181 |
+
dict_labels={"label":original_values(labelpred)}
|
182 |
+
return dict_labels
|
183 |
# return {"anger": .90, "happy": .02, "emotionlabel": "anger"}
|
184 |
|
185 |
#OTP code
|