Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ import requests
|
|
11 |
|
12 |
def mark_tokens_bold(string, tokens):
|
13 |
for token in tokens:
|
14 |
-
pattern = r"\b" + re.escape(token) + r"\b"
|
15 |
string = re.sub(pattern, "<span style='color: red;'><b>" + token + "</b></span>", string)
|
16 |
return string
|
17 |
|
@@ -36,8 +36,8 @@ def process_results(results, highlight_terms):
|
|
36 |
)
|
37 |
docid_html = str(result["docid"])
|
38 |
results_html += """{}
|
39 |
-
<p style='font-size:
|
40 |
-
<pre style='height:
|
41 |
<br>
|
42 |
""".format(
|
43 |
meta_html, docid_html, text_html
|
|
|
11 |
|
12 |
def mark_tokens_bold(string, tokens):
|
13 |
for token in tokens:
|
14 |
+
pattern = re.escape(token) #r"\b" + re.escape(token) + r"\b"
|
15 |
string = re.sub(pattern, "<span style='color: red;'><b>" + token + "</b></span>", string)
|
16 |
return string
|
17 |
|
|
|
36 |
)
|
37 |
docid_html = str(result["docid"])
|
38 |
results_html += """{}
|
39 |
+
<p style='font-size:16px; font-family: Arial; color:#7978FF; text-align: left;'>Document ID: {}</p>
|
40 |
+
<pre style='height: 400px; overflow: scroll;'><code>{}</code></pre>
|
41 |
<br>
|
42 |
""".format(
|
43 |
meta_html, docid_html, text_html
|