Spaces:
Runtime error
Runtime error
Poe Dator
commited on
Commit
·
77d4fc8
1
Parent(s):
c6fe4eb
Update app.py
Browse files
app.py
CHANGED
|
@@ -62,7 +62,7 @@ def infer_and_display_result(txt):
|
|
| 62 |
res = inference(txt)
|
| 63 |
res.sort(key = lambda x : - x[1])
|
| 64 |
|
| 65 |
-
st.
|
| 66 |
for lbl, score in res:
|
| 67 |
if score >=1:
|
| 68 |
st.write(f"[ {lbl:<7}] {labels_decoder[lbl]:<35} {score:.1f}%")
|
|
@@ -81,19 +81,18 @@ def infer_and_display_result(txt):
|
|
| 81 |
for r in res_plot :
|
| 82 |
ax.barh(r[0], r[1])
|
| 83 |
st.pyplot(fig)
|
| 84 |
-
st.
|
| 85 |
|
| 86 |
# ======================================
|
| 87 |
|
| 88 |
|
| 89 |
st.title('Big-data cloud application for actionable scientific article topic analytics using in-memory computing and stuff.')
|
| 90 |
-
st.
|
| 91 |
image = Image.open('dilbert_big_data.jpg')
|
| 92 |
st.image(image)
|
| 93 |
st.write('test application for ML-2 class, YSDA-2022' )
|
| 94 |
|
| 95 |
-
comment = """
|
| 96 |
-
this application estimates probability that certain article belongs to one of the following classes based on Arxiv Category Taxonomy:
|
| 97 |
- 'cs.NE': 'Neural and Evolutionary Computing',
|
| 98 |
- 'cs.CL': 'Computation and Language',
|
| 99 |
- 'cs.AI': 'Artificial Intelligence',
|
|
@@ -111,7 +110,7 @@ model = build_model()
|
|
| 111 |
action = st.button('click here to infer topic')
|
| 112 |
if action:
|
| 113 |
if len(text) < 3:
|
| 114 |
-
st.
|
| 115 |
else:
|
| 116 |
infer_and_display_result(text)
|
| 117 |
|
|
@@ -122,4 +121,3 @@ if action2:
|
|
| 122 |
action3 = st.button('to lowercase')
|
| 123 |
if action3:
|
| 124 |
st.write(text.lower())
|
| 125 |
-
|
|
|
|
| 62 |
res = inference(txt)
|
| 63 |
res.sort(key = lambda x : - x[1])
|
| 64 |
|
| 65 |
+
st.subheader("Inference results:")
|
| 66 |
for lbl, score in res:
|
| 67 |
if score >=1:
|
| 68 |
st.write(f"[ {lbl:<7}] {labels_decoder[lbl]:<35} {score:.1f}%")
|
|
|
|
| 81 |
for r in res_plot :
|
| 82 |
ax.barh(r[0], r[1])
|
| 83 |
st.pyplot(fig)
|
| 84 |
+
st.code(f"cycle time = {time() - start_time:.2f} s.")
|
| 85 |
|
| 86 |
# ======================================
|
| 87 |
|
| 88 |
|
| 89 |
st.title('Big-data cloud application for actionable scientific article topic analytics using in-memory computing and stuff.')
|
| 90 |
+
st.subheader('test application for ML-2 class, YSDA-2022' )
|
| 91 |
image = Image.open('dilbert_big_data.jpg')
|
| 92 |
st.image(image)
|
| 93 |
st.write('test application for ML-2 class, YSDA-2022' )
|
| 94 |
|
| 95 |
+
comment = """This application estimates probability that certain article belongs to one of the following classes based on Arxiv Category Taxonomy:
|
|
|
|
| 96 |
- 'cs.NE': 'Neural and Evolutionary Computing',
|
| 97 |
- 'cs.CL': 'Computation and Language',
|
| 98 |
- 'cs.AI': 'Artificial Intelligence',
|
|
|
|
| 110 |
action = st.button('click here to infer topic')
|
| 111 |
if action:
|
| 112 |
if len(text) < 3:
|
| 113 |
+
st.subheader("this text is too short or empty. try again")
|
| 114 |
else:
|
| 115 |
infer_and_display_result(text)
|
| 116 |
|
|
|
|
| 121 |
action3 = st.button('to lowercase')
|
| 122 |
if action3:
|
| 123 |
st.write(text.lower())
|
|
|