achmaddhani commited on
Commit
41b4734
·
1 Parent(s): 0d88129

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +7 -4
functions.py CHANGED
@@ -40,10 +40,13 @@ def prediction(X):
40
  model = load_model('best_model.keras')
41
  y_pred = model.predict(X)
42
  predictions = np.argmax(y_pred, axis=1)
43
- for index, val in enumerate(predictions):
44
  if val == 0:
45
- return f"Text {index} indicates the person is feeling FEAR"
 
46
  elif val == 1:
47
- return f"Text {index} indicates the person is feeling ANGER"
 
48
  else:
49
- return f"Text {index} indicates the person is feeling JOY"
 
 
40
  model = load_model('best_model.keras')
41
  y_pred = model.predict(X)
42
  predictions = np.argmax(y_pred, axis=1)
43
+ for val in predictions:
44
  if val == 0:
45
+ emo=0
46
+ return f"You are feeling Fear"
47
  elif val == 1:
48
+ emo=1
49
+ return f"You are feeling Anger"
50
  else:
51
+ emo=2
52
+ return f"You are feeling Joy"