Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,8 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
28 |
from colorama import Fore, Style
|
29 |
# import openai
|
30 |
import re
|
31 |
-
from termcolor import colored
|
|
|
32 |
|
33 |
|
34 |
para_tokenizer = AutoTokenizer.from_pretrained("humarin/chatgpt_paraphraser_on_T5_base")
|
@@ -222,18 +223,19 @@ for i in combined_words_list[0]:
|
|
222 |
|
223 |
|
224 |
highlighted_sentence = main_sentence
|
|
|
225 |
|
226 |
for substring in remove_overlapping(common_substrings):
|
227 |
highlighted_sentence = highlighted_sentence.replace(substring, colored(substring, 'white', 'on_blue'))
|
228 |
-
highlighted_text.append(substring)
|
229 |
|
230 |
st.markdown("Common substrings that occur in all five lists:")
|
231 |
|
232 |
for substring in highlighted_text:
|
233 |
-
st.write(substring)
|
234 |
|
235 |
st.markdown("\nHighlighted Main Sentence:")
|
236 |
-
st.write(highlighted_sentence)
|
237 |
|
238 |
|
239 |
|
|
|
28 |
from colorama import Fore, Style
|
29 |
# import openai
|
30 |
import re
|
31 |
+
# from termcolor import colored
|
32 |
+
from colorama import colored
|
33 |
|
34 |
|
35 |
para_tokenizer = AutoTokenizer.from_pretrained("humarin/chatgpt_paraphraser_on_T5_base")
|
|
|
223 |
|
224 |
|
225 |
highlighted_sentence = main_sentence
|
226 |
+
highlighted_text = []
|
227 |
|
228 |
for substring in remove_overlapping(common_substrings):
|
229 |
highlighted_sentence = highlighted_sentence.replace(substring, colored(substring, 'white', 'on_blue'))
|
230 |
+
highlighted_text.append(colored(substring, 'white', 'on_blue'))
|
231 |
|
232 |
st.markdown("Common substrings that occur in all five lists:")
|
233 |
|
234 |
for substring in highlighted_text:
|
235 |
+
st.write(substring, unsafe_allow_html=True)
|
236 |
|
237 |
st.markdown("\nHighlighted Main Sentence:")
|
238 |
+
st.write(highlighted_sentence, unsafe_allow_html=True)
|
239 |
|
240 |
|
241 |
|