rexarski commited on
Commit
5d10b71
1 Parent(s): d9ad0d8

[ADD] add user inputs

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -133,7 +133,7 @@ df1 = pd.DataFrame(data1)
133
  df2 = pd.DataFrame(data2)
134
 
135
  st.markdown(
136
- '''
137
  # climate-plus demo
138
  This is a minimal example of two models we trained for `climate-plus` project:
139
 
@@ -141,7 +141,7 @@ This is a minimal example of two models we trained for `climate-plus` project:
141
  - [distilroberta-tcfd-disclosure](https://huggingface.co/rexarski/distilroberta-tcfd-disclosure)
142
 
143
  See the [GitHub repo](https://github.com/rexarski/climate-plus) for more details."
144
- '''
145
  )
146
 
147
  st.markdown("## Factchecking")
@@ -164,6 +164,10 @@ st.markdown(
164
  f'**Prediction**: {ex_pred} {get_pred_emoji(ex_label, ex_pred, mode="factcheck")}'
165
  )
166
 
 
 
 
 
167
  st.markdown("---")
168
 
169
  st.markdown("## TCFD disclosure classification")
@@ -180,3 +184,9 @@ st.markdown(f"**Label**: {ex_label2}")
180
  st.markdown(
181
  f'**Prediction**: {ex_pred2} {get_pred_emoji(ex_label2, ex_pred2, mode="tcfd")}'
182
  )
 
 
 
 
 
 
 
133
  df2 = pd.DataFrame(data2)
134
 
135
  st.markdown(
136
+ """
137
  # climate-plus demo
138
  This is a minimal example of two models we trained for `climate-plus` project:
139
 
 
141
  - [distilroberta-tcfd-disclosure](https://huggingface.co/rexarski/distilroberta-tcfd-disclosure)
142
 
143
  See the [GitHub repo](https://github.com/rexarski/climate-plus) for more details."
144
+ """
145
  )
146
 
147
  st.markdown("## Factchecking")
 
164
  f'**Prediction**: {ex_pred} {get_pred_emoji(ex_label, ex_pred, mode="factcheck")}'
165
  )
166
 
167
+ custom_claim = st.text_input(label="Or enter your own claim below:")
168
+ custom_evidence = st.text_input(label="And the evidence:")
169
+ st.markdown(f"**Prediction**: {factcheck(custom_claim, custom_evidence)}")
170
+
171
  st.markdown("---")
172
 
173
  st.markdown("## TCFD disclosure classification")
 
184
  st.markdown(
185
  f'**Prediction**: {ex_pred2} {get_pred_emoji(ex_label2, ex_pred2, mode="tcfd")}'
186
  )
187
+
188
+ custom_text = st.text_input(
189
+ label="Or enter your own sentence to see if it belongs to any specific TCFD disclosure category:"
190
+ )
191
+ st.markdown(f"**Prediction**: {tcfd_classify(custom_text)}")
192
+