Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,6 +60,33 @@ def getUniform(text):
|
|
| 60 |
|
| 61 |
return res
|
| 62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
def greet(name):
|
| 64 |
return "Hello " + name + "!!"
|
| 65 |
|
|
|
|
| 60 |
|
| 61 |
return res
|
| 62 |
|
| 63 |
+
|
| 64 |
+
def process(path):
|
| 65 |
+
|
| 66 |
+
text = transcribe(path)
|
| 67 |
+
|
| 68 |
+
intent_class = classifier_intent(text)[0]["label"]
|
| 69 |
+
language_class = classifier_language(text)[0]["label"]
|
| 70 |
+
named_entities = getUniform(predict_ner(text))
|
| 71 |
+
|
| 72 |
+
return {
|
| 73 |
+
"text": text,
|
| 74 |
+
"language": language_class,
|
| 75 |
+
"intent_class": intent_class,
|
| 76 |
+
"named_entities": named_entities,
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
audio_paths = [
|
| 80 |
+
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/set-the-volume-to-low.wav",
|
| 81 |
+
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/tell-me-a-joke.wav",
|
| 82 |
+
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/tell me the artist of this song.wav",
|
| 83 |
+
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/order-a-pizza.wav",
|
| 84 |
+
|
| 85 |
+
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/TTS_1/tell-me-a-good-joke.wav",
|
| 86 |
+
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/TTS_1/order me a pizza.wav",
|
| 87 |
+
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/TTS_1/tell-me-the-artist-of-this-song.wav",
|
| 88 |
+
]
|
| 89 |
+
|
| 90 |
def greet(name):
|
| 91 |
return "Hello " + name + "!!"
|
| 92 |
|