karalif commited on
Commit
b6d6d9c
·
verified ·
1 Parent(s): bfeee59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -12,13 +12,13 @@ def predict(text):
12
 
13
  # Splitting the input text into words
14
  words = text.split()
15
- # Highlighting the third word if it exists
16
  if len(words) >= 3:
17
- words[2] = f"<strong>{words[2]}</strong>"
18
  highlighted_text = " ".join(words)
19
 
20
  # Adding the highlighted input text at the beginning of the response, followed by a new line
21
- response = f"Input: {highlighted_text}\n\n" # Modified to include highlighted third word
22
 
23
  results = text_pipe(text)
24
  all_scores = results[0]
 
12
 
13
  # Splitting the input text into words
14
  words = text.split()
15
+ # Highlighting the third word if it exists with a background color
16
  if len(words) >= 3:
17
+ words[2] = f"<span style='background-color: yellow;'>{words[2]}</span>"
18
  highlighted_text = " ".join(words)
19
 
20
  # Adding the highlighted input text at the beginning of the response, followed by a new line
21
+ response = f"Input: {highlighted_text}\n\n"
22
 
23
  results = text_pipe(text)
24
  all_scores = results[0]