Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -13,13 +13,13 @@ def emotion_predict(input):
13
  input_features = extract_feature(input, mfcc=True, chroma=True, mel=True, contrast=True, tonnetz=True)
14
  rf_prediction = classifier.predict(input_features.reshape(1,-1))
15
  if rf_prediction == 'happy':
16
- return 'Happy 😎'
17
  elif rf_prediction == 'neutral':
18
- return 'Neutral 😐'
19
  elif rf_prediction == 'sad':
20
- return 'Sad 😒'
21
  else:
22
- return 'Angry 😀'
23
 
24
 
25
  def plot_fig(input):
@@ -51,12 +51,12 @@ def plot_fig(input):
51
  with gr.Blocks() as app:
52
  gr.Markdown(
53
  """
54
- # Speech Emotion Detector 🎡😍
55
- This application classifies inputted audio πŸ”Š according to the verbal emotion into four categories:
56
- 1. Happy 😎
57
- 2. Neutral 😐
58
- 3. Sad 😒
59
- 4. Angry 😀
60
  """
61
  )
62
  with gr.Tab("Record Audio"):
 
13
  input_features = extract_feature(input, mfcc=True, chroma=True, mel=True, contrast=True, tonnetz=True)
14
  rf_prediction = classifier.predict(input_features.reshape(1,-1))
15
  if rf_prediction == 'happy':
16
+ return 'kata-benda 😎'
17
  elif rf_prediction == 'neutral':
18
+ return 'kata-kerja 😐'
19
  elif rf_prediction == 'sad':
20
+ return 'kata-sifat 😒'
21
  else:
22
+ return 'kata-keterangan 😀'
23
 
24
 
25
  def plot_fig(input):
 
51
  with gr.Blocks() as app:
52
  gr.Markdown(
53
  """
54
+ Speech Predict Detector 🎡😍
55
+ This application classifies inputted audio πŸ”Š according to the prediction into four categories:
56
+ 1. kata-benda 😎
57
+ 2. kata-kerja 😐
58
+ 3. kata-sifat 😒
59
+ 4. kata-keterangan 😀
60
  """
61
  )
62
  with gr.Tab("Record Audio"):