Add: print all results
Browse files
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 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
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")
|