FremyCompany
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
st.set_page_config(layout="wide")
|
3 |
|
4 |
-
DEBUG =
|
5 |
if DEBUG:
|
6 |
# Use some dummy data
|
7 |
tokens = [
|
@@ -70,21 +70,26 @@ else:
|
|
70 |
# Simplify the tokens for display
|
71 |
tokens = [[token[3:].replace("\u2581", " ") for token in sentence] for sentence in tokens]
|
72 |
|
73 |
-
|
74 |
-
|
75 |
<article>
|
76 |
-
<div>
|
|
|
|
|
77 |
</div>
|
78 |
-
<p id="sent0">
|
79 |
-
|
|
|
|
|
80 |
</p>
|
81 |
-
<p id="sent1">
|
82 |
-
|
|
|
|
|
83 |
</p>
|
84 |
-
</article>
|
85 |
-
f""")
|
86 |
|
87 |
-
html
|
88 |
<style>
|
89 |
article {
|
90 |
font-family: sans-serif;
|
|
|
1 |
import streamlit as st
|
2 |
st.set_page_config(layout="wide")
|
3 |
|
4 |
+
DEBUG = True
|
5 |
if DEBUG:
|
6 |
# Use some dummy data
|
7 |
tokens = [
|
|
|
70 |
# Simplify the tokens for display
|
71 |
tokens = [[token[3:].replace("\u2581", " ") for token in sentence] for sentence in tokens]
|
72 |
|
73 |
+
html = ''
|
74 |
+
html += """
|
75 |
<article>
|
76 |
+
<div>"""
|
77 |
+
html += f"""{("β
Congrats!" if sentence_similarity >= 0.65 else "β Sorry!")} These sentences have {100*sentence_similarity}% similarity."""
|
78 |
+
html += """
|
79 |
</div>
|
80 |
+
<p id="sent0">"""
|
81 |
+
for token in tokens[0]:
|
82 |
+
html += f"""{' ' if token[0] == ' ' else ''}<span>{token[1:] if token[0] == ' ' else token}</span>"""
|
83 |
+
html += """</div>
|
84 |
</p>
|
85 |
+
<p id="sent1">"""
|
86 |
+
for token in tokens[1]:
|
87 |
+
html += f"""{' ' if token[0] == ' ' else ''}<span>{token[1:] if token[0] == ' ' else token}</span>"""
|
88 |
+
html += """</div>
|
89 |
</p>
|
90 |
+
</article>"""
|
|
|
91 |
|
92 |
+
html += """
|
93 |
<style>
|
94 |
article {
|
95 |
font-family: sans-serif;
|