Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ col1, col2 = st.columns(2)
|
|
23 |
|
24 |
with col1:
|
25 |
with st.container(border=True):
|
26 |
-
sample_sentence = "Vhana vhane vha kha ḓi bva u bebwa vha kha khombo ya u <mask> nga Listeriosis"
|
27 |
|
28 |
if "text_input" not in st.session_state:
|
29 |
st.session_state.text_area = ""
|
@@ -38,26 +38,28 @@ with col1:
|
|
38 |
if st.button("Submit"):
|
39 |
result = fill_mask(input_sentences)
|
40 |
|
41 |
-
st.
|
42 |
st.code(sample_sentence, wrap_lines=True)
|
43 |
|
44 |
with col2:
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
<div
|
59 |
-
|
60 |
-
|
|
|
|
|
61 |
|
62 |
if 'result' in locals():
|
63 |
if result:
|
|
|
23 |
|
24 |
with col1:
|
25 |
with st.container(border=True):
|
26 |
+
sample_sentence = "Vhana vhane vha kha ḓi bva u bebwa vha kha khombo ya u <mask> nga Listeriosis."
|
27 |
|
28 |
if "text_input" not in st.session_state:
|
29 |
st.session_state.text_area = ""
|
|
|
38 |
if st.button("Submit"):
|
39 |
result = fill_mask(input_sentences)
|
40 |
|
41 |
+
st.markdown("Examples")
|
42 |
st.code(sample_sentence, wrap_lines=True)
|
43 |
|
44 |
with col2:
|
45 |
+
with st.container(border=True):
|
46 |
+
st.markdown("Output")
|
47 |
+
if 'result' in locals():
|
48 |
+
if result:
|
49 |
+
for sentence, predictions in result.items():
|
50 |
+
for prediction in predictions:
|
51 |
+
predicted_word = prediction['token_str']
|
52 |
+
score = prediction['score'] * 100
|
53 |
+
|
54 |
+
st.markdown(f"""
|
55 |
+
<div class="bar">
|
56 |
+
<div class="bar-fill" style="width: {score}%;"></div>
|
57 |
+
</div>
|
58 |
+
<div class="container">
|
59 |
+
<div style="align-items: left;">{predicted_word}</div>
|
60 |
+
<div style="align-items: right;">{score:.2f}%</div>
|
61 |
+
</div>
|
62 |
+
""", unsafe_allow_html=True)
|
63 |
|
64 |
if 'result' in locals():
|
65 |
if result:
|