Spaces:
Runtime error
Runtime error
Update consult_func.py
Browse files- consult_func.py +4 -3
consult_func.py
CHANGED
@@ -174,11 +174,12 @@ def advice(
|
|
174 |
# symptoms = "存在" + advice1(radio1, radio2, radio3) + "问题,不存在饮食问题且"
|
175 |
# if advice1(radio1, radio2, radio3) == "不存在" and advice2(radio4) != "不存在":
|
176 |
# symptoms = "不存在睡眠问题,存在" + advice2(radio4) + "问题且"
|
|
|
177 |
if result1==0:
|
178 |
final_score=(((-1+result2+result3)/3)+1)*50
|
179 |
else:
|
180 |
final_score=(((0.5+result1+result2+result3)/3)+1)*50
|
181 |
-
|
182 |
|
183 |
SCORE_ANALYSIS=score_analysis(final_score)
|
184 |
SLEEP = advice1(radio1, radio2, radio3)
|
@@ -195,7 +196,7 @@ def advice(
|
|
195 |
FINAL_ADVICE = """
|
196 |
<h1 style='text-align:center;'>检测报告</h1>
|
197 |
<h3 style='text-align:center;'>得分分析</h3>
|
198 |
-
  {}\n
|
199 |
<h3 style='text-align:center;'>睡眠状况</h3>
|
200 |
  {1}\n
|
201 |
<h3 style='text-align:center;'>饮食状况</h3>
|
@@ -209,7 +210,7 @@ def advice(
|
|
209 |
  {6}\n
|
210 |
<h3 style='text-align:center;'>结语</h3>
|
211 |
  {7}\n
|
212 |
-
""".format(SCORE_ANALYSIS,SLEEP, EAT, MOOD, SUICIDE, INTEREST, RECENT, SUMMARY)
|
213 |
|
214 |
return (
|
215 |
gr.Column(visible=True),
|
|
|
174 |
# symptoms = "存在" + advice1(radio1, radio2, radio3) + "问题,不存在饮食问题且"
|
175 |
# if advice1(radio1, radio2, radio3) == "不存在" and advice2(radio4) != "不存在":
|
176 |
# symptoms = "不存在睡眠问题,存在" + advice2(radio4) + "问题且"
|
177 |
+
print(result1,result2,result3)
|
178 |
if result1==0:
|
179 |
final_score=(((-1+result2+result3)/3)+1)*50
|
180 |
else:
|
181 |
final_score=(((0.5+result1+result2+result3)/3)+1)*50
|
182 |
+
print(final_score)
|
183 |
|
184 |
SCORE_ANALYSIS=score_analysis(final_score)
|
185 |
SLEEP = advice1(radio1, radio2, radio3)
|
|
|
196 |
FINAL_ADVICE = """
|
197 |
<h1 style='text-align:center;'>检测报告</h1>
|
198 |
<h3 style='text-align:center;'>得分分析</h3>
|
199 |
+
  {0}\n
|
200 |
<h3 style='text-align:center;'>睡眠状况</h3>
|
201 |
  {1}\n
|
202 |
<h3 style='text-align:center;'>饮食状况</h3>
|
|
|
210 |
  {6}\n
|
211 |
<h3 style='text-align:center;'>结语</h3>
|
212 |
  {7}\n
|
213 |
+
""".format(SCORE_ANALYSIS, SLEEP, EAT, MOOD, SUICIDE, INTEREST, RECENT, SUMMARY)
|
214 |
|
215 |
return (
|
216 |
gr.Column(visible=True),
|