Spaces:
Runtime error
Runtime error
Update app.py
Browse files10 unmodified lines1112131415161718 unmodified lines363738394041424310 unmodified linesdef mark_tokens_bold(string, tokens):for token in tokens:pattern = r"\b" + re.escape(token) + r"\b"string = re.sub(pattern, "<span style='color: red;'><b>" + token + "</b></span>", string)return string18 unmodified lines)docid_html = str(result["docid"])results_html += """{}<p style='font-size:14px; font-family: Arial; color:#7978FF; text-align: left;'>Document ID: {}</p><pre style='height: 200px; overflow: scroll;'><code>{}</code></pre><br>""".format(meta_html, docid_html, text_html10 unmodified lines1112131415161718 unmodified lines363738394041424310 unmodified linesdef mark_tokens_bold(string, tokens):for token in tokens:pattern = re.escape(token) #r"\b" + re.escape(token) + r"\b"string = re.sub(pattern, "<span style='color: red;'><b>" + token + "</b></span>", string)return string18 unmodified lines)docid_html = str(result["docid"])results_html += """{}<p style='font-size:16px; font-family: Arial; color:#7978FF; text-align: left;'>Document ID: {}</p><pre style='height: 400px; overflow: scroll;'><code>{}</code></pre><br>""".format(meta_html, docid_html, text_html
app.py+3-3