Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -41,6 +41,7 @@ def text_api(text:str):
|
|
41 |
|
42 |
|
43 |
def get_text_score(text):
|
|
|
44 |
part1 = str.partition(string, r"text")
|
45 |
want1 = part1[2]
|
46 |
label = want1[4:6]
|
@@ -118,7 +119,7 @@ def speech_score(audio):
|
|
118 |
score2=10*prob[0]-10*prob[1]
|
119 |
print("score2",score2)
|
120 |
print(text_lab[-1])
|
121 |
-
text_emo=str(get_text_score(
|
122 |
print(text_emo)
|
123 |
|
124 |
return score2,text_emo
|
@@ -291,8 +292,8 @@ with gr.Blocks() as speech_all:
|
|
291 |
|
292 |
def clear_3():
|
293 |
return gr.Textbox(""),gr.Textbox("")
|
294 |
-
def text_score(text):
|
295 |
-
result=
|
296 |
return result
|
297 |
|
298 |
with gr.Blocks() as text_all:
|
|
|
41 |
|
42 |
|
43 |
def get_text_score(text):
|
44 |
+
string=text_api(text)
|
45 |
part1 = str.partition(string, r"text")
|
46 |
want1 = part1[2]
|
47 |
label = want1[4:6]
|
|
|
119 |
score2=10*prob[0]-10*prob[1]
|
120 |
print("score2",score2)
|
121 |
print(text_lab[-1])
|
122 |
+
text_emo=str(get_text_score(text_results))
|
123 |
print(text_emo)
|
124 |
|
125 |
return score2,text_emo
|
|
|
292 |
|
293 |
def clear_3():
|
294 |
return gr.Textbox(""),gr.Textbox("")
|
295 |
+
def text_score(text):
|
296 |
+
result=str(get_text_score(text))
|
297 |
return result
|
298 |
|
299 |
with gr.Blocks() as text_all:
|