Commit
·
5408f33
1
Parent(s):
3b3fa96
Update app.py
Browse files
app.py
CHANGED
@@ -54,25 +54,22 @@ def get_bert_prediction(input_text,top_k):
|
|
54 |
except Exception as error:
|
55 |
pass
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
st.title("Qualitative evaluation of Pretrained BERT models")
|
60 |
-
st.markdown("""
|
61 |
<a href="https://ajitrajasekharan.github.io/2021/01/02/my-first-post.html"><small style="font-size:18px; color: #8f8f8f">This app is used to qualitatively examine the performance of pretrained models to do NER , <b>with no fine tuning</b></small></a>
|
62 |
""", unsafe_allow_html=True)
|
63 |
-
|
64 |
#st.write("https://ajitrajasekharan.github.io/2021/01/02/my-first-post.html")
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
print(top_k)
|
69 |
|
70 |
|
71 |
-
|
72 |
#if st.button("Submit"):
|
73 |
|
74 |
# with st.spinner("Computing"):
|
75 |
-
|
76 |
|
77 |
model_name = st.sidebar.selectbox(label='Select Model to Apply', options=['ajitrajasekharan/biomedical', 'BERT'], index=0, key = "model_name")
|
78 |
bert_tokenizer, bert_model = load_bert_model(model_name)
|
@@ -89,18 +86,16 @@ try:
|
|
89 |
|
90 |
st.json(res)
|
91 |
|
92 |
-
except Exception as e:
|
93 |
-
st.error("Some error occured!" + str(e))
|
94 |
-
st.stop()
|
95 |
|
96 |
-
|
97 |
-
|
98 |
|
99 |
|
100 |
-
|
101 |
-
|
102 |
|
103 |
except Exception as e:
|
104 |
-
|
|
|
105 |
|
|
|
106 |
|
|
|
54 |
except Exception as error:
|
55 |
pass
|
56 |
|
57 |
+
st.title("Qualitative evaluation of Pretrained BERT models")
|
58 |
+
st.markdown("""
|
|
|
|
|
59 |
<a href="https://ajitrajasekharan.github.io/2021/01/02/my-first-post.html"><small style="font-size:18px; color: #8f8f8f">This app is used to qualitatively examine the performance of pretrained models to do NER , <b>with no fine tuning</b></small></a>
|
60 |
""", unsafe_allow_html=True)
|
61 |
+
st.write("Incomplete. Work in progress...")
|
62 |
#st.write("https://ajitrajasekharan.github.io/2021/01/02/my-first-post.html")
|
63 |
+
st.write("CLS vectors as well as the model prediction for a blank position are examined")
|
64 |
+
top_k = 10
|
65 |
+
print(top_k)
|
|
|
66 |
|
67 |
|
68 |
+
start = None
|
69 |
#if st.button("Submit"):
|
70 |
|
71 |
# with st.spinner("Computing"):
|
72 |
+
try:
|
73 |
|
74 |
model_name = st.sidebar.selectbox(label='Select Model to Apply', options=['ajitrajasekharan/biomedical', 'BERT'], index=0, key = "model_name")
|
75 |
bert_tokenizer, bert_model = load_bert_model(model_name)
|
|
|
86 |
|
87 |
st.json(res)
|
88 |
|
|
|
|
|
|
|
89 |
|
90 |
+
|
|
|
91 |
|
92 |
|
93 |
+
if start is not None:
|
94 |
+
st.text(f"prediction took {time.time() - start:.2f}s")
|
95 |
|
96 |
except Exception as e:
|
97 |
+
st.error("Some error occured!" + str(e))
|
98 |
+
st.stop()
|
99 |
|
100 |
+
st.write("---")
|
101 |
|