Towhidul commited on
Commit
364e025
·
verified ·
1 Parent(s): 734dff9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -9
app.py CHANGED
@@ -300,17 +300,31 @@ for sentence in highlighted_sentence_list:
300
 
301
 
302
 
303
- highlighted_main_sentence = main_sentence
304
 
305
- # Iterate through each paraphrase and apply different colors to combined words
306
- for i, combined_words in enumerate(combined_words_list):
307
- color = colors[i % len(colors)] # Get color for this paraphrase
308
- # Highlight combined words from this paraphrase with the corresponding color
309
- for substring in combined_words:
310
- highlighted_main_sentence = highlighted_main_sentence.replace(substring, f'<span style="background-color: {color}; color: white;">{substring}</span>')
311
 
312
- st.markdown("\nHighlighted Main Sentence with LCS from All Paraphrases:")
313
- st.write(highlighted_main_sentence, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
 
315
 
316
 
 
300
 
301
 
302
 
303
+ # highlighted_main_sentence = main_sentence
304
 
305
+ # # Iterate through each paraphrase and apply different colors to combined words
306
+ # for i, combined_words in enumerate(combined_words_list):
307
+ # color = colors[i % len(colors)] # Get color for this paraphrase
308
+ # # Highlight combined words from this paraphrase with the corresponding color
309
+ # for substring in combined_words:
310
+ # highlighted_main_sentence = highlighted_main_sentence.replace(substring, f'<span style="background-color: {color}; color: white;">{substring}</span>')
311
 
312
+ # st.markdown("\nHighlighted Main Sentence with LCS from All Paraphrases:")
313
+ # st.write(highlighted_main_sentence, unsafe_allow_html=True)
314
+
315
+
316
+ # colors = ['blue', 'green', 'orange', 'purple', 'red']
317
+ # highlighted_main_sentence = main_sentence
318
+
319
+ # # Iterate through each paraphrase and apply different colors to combined words
320
+ # for i, combined_words in enumerate(combined_words_list):
321
+ # color = colors[i % len(colors)] # Get color for this paraphrase
322
+ # # Highlight combined words from this paraphrase with the corresponding color
323
+ # for substring in combined_words:
324
+ # highlighted_main_sentence = highlighted_main_sentence.replace(substring, f'<span style="background-color: {color}; color: white;">{substring}</span>', 1) # Add a limit of 1 to only replace the first occurrence
325
+
326
+ # st.markdown("\nHighlighted Main Sentence with LCS from All Paraphrases:")
327
+ # st.write(highlighted_main_sentence, unsafe_allow_html=True)
328
 
329
 
330