Spaces:
Runtime error
Runtime error
updated
#1
by
alvi123
- opened
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 '
|
| 17 |
elif rf_prediction == 'neutral':
|
| 18 |
-
return '
|
| 19 |
elif rf_prediction == 'sad':
|
| 20 |
-
return '
|
| 21 |
else:
|
| 22 |
-
return '
|
| 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 |
-
|
| 55 |
-
This application classifies inputted audio π according to the
|
| 56 |
-
1.
|
| 57 |
-
2.
|
| 58 |
-
3.
|
| 59 |
-
4.
|
| 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"):
|