ksvmuralidhar commited on
Commit
bf8ef43
·
verified ·
1 Parent(s): d77fedc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -105,8 +105,8 @@ def main():
105
  try:
106
  st.info("Rewriting the text. This takes time.", icon="ℹ️")
107
  input_txt, paraphrased_txt = inference_long_text(input_txt, n_sents)
108
- input_txt = "<br><br>".join(input_txt)
109
- paraphrased_txt = "<br><br>".join(paraphrased_txt)
110
  except Exception as e:
111
  paraphrased_txt = None
112
  paraphrase_error = str(e)
@@ -131,7 +131,9 @@ def main():
131
  if paraphrase_error is not None:
132
  st.error(f"Paraphrasing Error: \n{paraphrase_error}", icon="🚨")
133
  else:
134
- st.markdown(f"<h3>Scraped Text ({n_sents} sentences)</h3><p>{input_txt}</p><br><h3>Rewritten Text ({n_sents} sentences)</h3><p>{paraphrased_txt}</p>", unsafe_allow_html=True)
 
 
135
 
136
  else:
137
  input_txt = st.text_area("Enter the text. (Ensure the text is grammatically correct and has punctuations at the right places):", "", height=150)
@@ -165,7 +167,9 @@ def main():
165
  if paraphrase_error is not None:
166
  st.error(f"Paraphrasing Error: \n{paraphrase_error}", icon="🚨")
167
  else:
168
- st.markdown(f"<h3>Scraped Text ({n_sents} sentences)</h3><p>{input_txt}</p><br><h3>Rewritten Text ({n_sents} sentences)</h3><p>{paraphrased_txt}</p>", unsafe_allow_html=True)
 
 
169
 
170
 
171
 
 
105
  try:
106
  st.info("Rewriting the text. This takes time.", icon="ℹ️")
107
  input_txt, paraphrased_txt = inference_long_text(input_txt, n_sents)
108
+ # input_txt = "<br><br>".join(input_txt)
109
+ # paraphrased_txt = "<br><br>".join(paraphrased_txt)
110
  except Exception as e:
111
  paraphrased_txt = None
112
  paraphrase_error = str(e)
 
131
  if paraphrase_error is not None:
132
  st.error(f"Paraphrasing Error: \n{paraphrase_error}", icon="🚨")
133
  else:
134
+ result = [f"<b>Scraped Sentence:</b> {scraped}<br><b>Rewritten Sentence:</b> {paraphrased}" for scraped, paraphrased in zip(input_txt, paraphrased_txt)]
135
+ result = "<br><br>".join(result)
136
+ st.markdown(f"{result}", unsafe_allow_html=True)
137
 
138
  else:
139
  input_txt = st.text_area("Enter the text. (Ensure the text is grammatically correct and has punctuations at the right places):", "", height=150)
 
167
  if paraphrase_error is not None:
168
  st.error(f"Paraphrasing Error: \n{paraphrase_error}", icon="🚨")
169
  else:
170
+ result = [f"<b>Scraped Sentence:</b> {scraped}<br><b>Rewritten Sentence:</b> {paraphrased}" for scraped, paraphrased in zip(input_txt, paraphrased_txt)]
171
+ result = "<br><br>".join(result)
172
+ st.markdown(f"{result}", unsafe_allow_html=True)
173
 
174
 
175