Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,15 @@ def predict(text):
|
|
| 10 |
|
| 11 |
greeting_feedback = ""
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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]
|