Shredder commited on
Commit
e2f1c79
1 Parent(s): 89f4cfa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -17
app.py CHANGED
@@ -145,24 +145,26 @@ if st.button('Analyze'):
145
  answer += f"Answer {i+1}: {data['0'][i]['text']} -- \n"
146
  answer += f"Probability: {round(data['0'][i]['probability']*100,1)}%\n\n"
147
  st.success(answer)
148
-
 
 
149
  else:
150
  st.write("Unable to call model, please select question and contract")
151
 
152
- if st.button('Check Sustainability'):
153
- if(raw_answer==""):
154
- st.write("Unable to call model, please select question and contract")
155
- else:
156
- st.write(get_sustainability(raw_answer))
157
- if st.button('Summarize'):
158
- if(raw_answer==""):
159
- st.write("Unable to call model, please select question and contract")
160
- else:
161
- st.write(summarize_text(raw_answer))
162
 
163
- if st.button('NER'):
164
- if(raw_answer==""):
165
- st.write("Unable to call model, please select question and contract")
166
- else:
167
- doc = nlp(raw_answer)
168
- st.write(displacy.render(doc, style="ent"))
 
145
  answer += f"Answer {i+1}: {data['0'][i]['text']} -- \n"
146
  answer += f"Probability: {round(data['0'][i]['probability']*100,1)}%\n\n"
147
  st.success(answer)
148
+ st.write(get_sustainability(raw_answer))
149
+ st.write(summarize_text(raw_answer))
150
+ st.write(displacy.render(doc, style="ent"))
151
  else:
152
  st.write("Unable to call model, please select question and contract")
153
 
154
+ #if st.button('Check Sustainability'):
155
+ # if(raw_answer==""):
156
+ # st.write("Unable to call model, please select question and contract")
157
+ # else:
158
+ # st.write(get_sustainability(raw_answer))
159
+ #if st.button('Summarize'):
160
+ # if(raw_answer==""):
161
+ # st.write("Unable to call model, please select question and contract")
162
+ # else:
163
+ # st.write(summarize_text(raw_answer))
164
 
165
+ #if st.button('NER'):
166
+ # if(raw_answer==""):
167
+ # st.write("Unable to call model, please select question and contract")
168
+ # else:
169
+ # doc = nlp(raw_answer)
170
+ # st.write(displacy.render(doc, style="ent"))