kinensake commited on
Commit
d57f0a6
1 Parent(s): ed9f4ed

Add: print all results

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -140,17 +140,19 @@ class GramformerDemo:
140
 
141
  if input_text.strip():
142
  results = gf.correct(input_text, max_candidates=max_candidates)
143
- corrected_sentence, score = results[0]
144
- print(results)
145
- st.markdown(f'#### Output:')
146
- st.write('')
147
- st.success(corrected_sentence)
148
- exp1 = st.expander(label='Show highlights', expanded=True)
149
- with exp1:
150
- self.show_highlights(gf, input_text, corrected_sentence)
151
- exp2 = st.expander(label='Show edits')
152
- with exp2:
153
- self.show_edits(gf, input_text, corrected_sentence)
 
 
154
 
155
  else:
156
  st.warning("Please select/enter text to proceed")
 
140
 
141
  if input_text.strip():
142
  results = gf.correct(input_text, max_candidates=max_candidates)
143
+
144
+ for result in results:
145
+ corrected_sentence, score = result
146
+
147
+ st.markdown(f'#### Output:')
148
+ st.write('')
149
+ st.success(corrected_sentence)
150
+ exp1 = st.expander(label='Show highlights', expanded=True)
151
+ with exp1:
152
+ self.show_highlights(gf, input_text, corrected_sentence)
153
+ exp2 = st.expander(label='Show edits')
154
+ with exp2:
155
+ self.show_edits(gf, input_text, corrected_sentence)
156
 
157
  else:
158
  st.warning("Please select/enter text to proceed")