Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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"<
|
| 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]
|
|
|
|
| 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]
|