Emma0123 commited on
Commit
891058f
1 Parent(s): 68d0718

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -14,7 +14,7 @@ result1 = pipe1(input_text)
14
  # 判断第一个模型的输出结果
15
  if result1[0]['label'] == 'environmental': # 根据您的模型实际返回的标签进行修改
16
  result2 = pipe2(input_text)
17
- st.write(result2)
18
  else:
19
  # 如果输出结果为0(或者对应的标签),打印提示信息
20
  st.write("This content is unrelated to Environment.")
 
14
  # 判断第一个模型的输出结果
15
  if result1[0]['label'] == 'environmental': # 根据您的模型实际返回的标签进行修改
16
  result2 = pipe2(input_text)
17
+ st.write(f"The model predicts this text to be related to category '{result2['label']}' with a confidence score of {result2['score']:.2%}.")
18
  else:
19
  # 如果输出结果为0(或者对应的标签),打印提示信息
20
  st.write("This content is unrelated to Environment.")