Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -120,7 +120,7 @@ st.subheader("")
|
|
120 |
|
121 |
|
122 |
#caching the models in the dictionary
|
123 |
-
@st.cache(allow_output_mutation=True)
|
124 |
def load_sparknlp_models():
|
125 |
ner_models_list= ["nerdl_fewnerd_100d", "ner_conll_elmo", "ner_mit_movie_complex_distilbert_base_cased", "ner_conll_albert_large_uncased", "onto_100"]
|
126 |
embeddings_list= ["glove_100d", "elmo", "distilbert_base_cased", "albert_large_uncased", "glove_100d_for_onto"]
|
@@ -192,10 +192,10 @@ def load_sparknlp_models():
|
|
192 |
|
193 |
|
194 |
|
195 |
-
|
196 |
-
|
197 |
nlp_dict= load_sparknlp_models()
|
198 |
-
|
199 |
|
200 |
|
201 |
|
@@ -306,7 +306,7 @@ show_html2(text, df, labels, "Text annotated with identified Named Entities")
|
|
306 |
|
307 |
try_link="""<a href="https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Public/3.SparkNLP_Pretrained_Models.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" style="zoom: 1.3" alt="Open In Colab"/></a>"""
|
308 |
st.sidebar.title('')
|
309 |
-
st.sidebar.markdown('Try it yourself:
|
310 |
st.sidebar.markdown(try_link, unsafe_allow_html=True)
|
311 |
|
312 |
|
|
|
120 |
|
121 |
|
122 |
#caching the models in the dictionary
|
123 |
+
@st.cache(allow_output_mutation=True, show_spinner=False)
|
124 |
def load_sparknlp_models():
|
125 |
ner_models_list= ["nerdl_fewnerd_100d", "ner_conll_elmo", "ner_mit_movie_complex_distilbert_base_cased", "ner_conll_albert_large_uncased", "onto_100"]
|
126 |
embeddings_list= ["glove_100d", "elmo", "distilbert_base_cased", "albert_large_uncased", "glove_100d_for_onto"]
|
|
|
192 |
|
193 |
|
194 |
|
195 |
+
placeholder_= st.empty()
|
196 |
+
placeholder_.info("If you are launching the app for the first time, it may take some time (approximately 1 minute) for SparkNLP models to load...")
|
197 |
nlp_dict= load_sparknlp_models()
|
198 |
+
placeholder_.empty()
|
199 |
|
200 |
|
201 |
|
|
|
306 |
|
307 |
try_link="""<a href="https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/Certification_Trainings/Public/3.SparkNLP_Pretrained_Models.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" style="zoom: 1.3" alt="Open In Colab"/></a>"""
|
308 |
st.sidebar.title('')
|
309 |
+
st.sidebar.markdown('Try it yourself:')
|
310 |
st.sidebar.markdown(try_link, unsafe_allow_html=True)
|
311 |
|
312 |
|