Spaces:
Runtime error
Runtime error
Update consult.py
Browse files- consult.py +14 -1
consult.py
CHANGED
@@ -30,6 +30,7 @@ from consult_func import (
|
|
30 |
visibility_choice3,
|
31 |
visibility_choice4,
|
32 |
visibility_choice5,
|
|
|
33 |
)
|
34 |
|
35 |
os.environ["no_proxy"] = "localhost,127.0.0.1,::1"
|
@@ -61,7 +62,19 @@ def speech_score4(audio):
|
|
61 |
def video_score4(video):
|
62 |
text,score=video_score(video)
|
63 |
return text,score,gr.Column(visible=True),score
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
|
66 |
# constants
|
67 |
schema = "情感倾向[正向,负向]" # Define the schema for sentence-level sentiment classification
|
|
|
30 |
visibility_choice3,
|
31 |
visibility_choice4,
|
32 |
visibility_choice5,
|
33 |
+
keyword,
|
34 |
)
|
35 |
|
36 |
os.environ["no_proxy"] = "localhost,127.0.0.1,::1"
|
|
|
62 |
def video_score4(video):
|
63 |
text,score=video_score(video)
|
64 |
return text,score,gr.Column(visible=True),score
|
65 |
+
#########################################################################################
|
66 |
+
#第三题专用函数:(融入keyword识别)
|
67 |
+
def text_score3(text):
|
68 |
+
text,score=text_score(text)
|
69 |
+
if keyword(text):
|
70 |
+
return text,score,gr.Radio(visible=True), gr.Column(visible=False)
|
71 |
+
else:
|
72 |
+
return text,score,gr.Radio(visible=False), gr.Column(visible=True)
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
|
77 |
+
#########################################################################################
|
78 |
|
79 |
# constants
|
80 |
schema = "情感倾向[正向,负向]" # Define the schema for sentence-level sentiment classification
|