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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -10,8 +10,15 @@ def predict(text):
10
 
11
  greeting_feedback = ""
12
 
13
- # Adding the input text at the beginning of the response, followed by a new line
14
- response = f"Input: {text}\n\n" # Added this line to include the input in the response
 
 
 
 
 
 
 
15
 
16
  results = text_pipe(text)
17
  all_scores = results[0]
 
10
 
11
  greeting_feedback = ""
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]