Update app.py
Browse files
app.py
CHANGED
@@ -27,9 +27,9 @@ ENTITY_COLORS = {
|
|
27 |
|
28 |
MAP_MODELS = {
|
29 |
"":"",
|
30 |
-
"fr_ner4archives_V3_camembert_base": "https://huggingface.co/ner4archives/fr_ner4archives_V3_camembert_base/resolve/main/fr_ner4archives_V3_camembert_base-any-py3-none-any.whl
|
31 |
-
"fr_ner4archives_v3_default": "https://huggingface.co/ner4archives/fr_ner4archives_v3_default/resolve/main/fr_ner4archives_v3_default-any-py3-none-any.whl
|
32 |
-
"fr_ner4archives_v3_with_vectors":"https://huggingface.co/ner4archives/fr_ner4archives_v3_with_vectors/resolve/main/fr_ner4archives_v3_with_vectors-any-py3-none-any.whl
|
33 |
}
|
34 |
|
35 |
|
@@ -147,7 +147,7 @@ def main():
|
|
147 |
model_loaded = None
|
148 |
if model != "":
|
149 |
try:
|
150 |
-
|
151 |
flag_model = True
|
152 |
streamlit.write(f"{model} is available locally.")
|
153 |
except:
|
@@ -160,7 +160,6 @@ def main():
|
|
160 |
o = p1.wait()
|
161 |
if o == 0:
|
162 |
streamlit.write(f"Download model: {model} done.")
|
163 |
-
model_loaded = spacy.load(model)
|
164 |
flag_model = True
|
165 |
streamlit.write(f"{model} is available locally.")
|
166 |
placeholder.empty()
|
@@ -193,7 +192,7 @@ def main():
|
|
193 |
if streamlit.button('Launch'):
|
194 |
plain = "\n".join(sentences)
|
195 |
with streamlit.spinner('Initialize NER...'):
|
196 |
-
nlp =
|
197 |
nlp.max_length = 5000000
|
198 |
if linking:
|
199 |
nlp.add_pipe('entityfishing',
|
|
|
27 |
|
28 |
MAP_MODELS = {
|
29 |
"":"",
|
30 |
+
"fr_ner4archives_V3_camembert_base": "https://huggingface.co/ner4archives/fr_ner4archives_V3_camembert_base/resolve/main/fr_ner4archives_V3_camembert_base-any-py3-none-any.whl",
|
31 |
+
"fr_ner4archives_v3_default": "https://huggingface.co/ner4archives/fr_ner4archives_v3_default/resolve/main/fr_ner4archives_v3_default-any-py3-none-any.whl",
|
32 |
+
"fr_ner4archives_v3_with_vectors":"https://huggingface.co/ner4archives/fr_ner4archives_v3_with_vectors/resolve/main/fr_ner4archives_v3_with_vectors-any-py3-none-any.whl"
|
33 |
}
|
34 |
|
35 |
|
|
|
147 |
model_loaded = None
|
148 |
if model != "":
|
149 |
try:
|
150 |
+
spacy.load(model)
|
151 |
flag_model = True
|
152 |
streamlit.write(f"{model} is available locally.")
|
153 |
except:
|
|
|
160 |
o = p1.wait()
|
161 |
if o == 0:
|
162 |
streamlit.write(f"Download model: {model} done.")
|
|
|
163 |
flag_model = True
|
164 |
streamlit.write(f"{model} is available locally.")
|
165 |
placeholder.empty()
|
|
|
192 |
if streamlit.button('Launch'):
|
193 |
plain = "\n".join(sentences)
|
194 |
with streamlit.spinner('Initialize NER...'):
|
195 |
+
nlp = spacy.load(model)
|
196 |
nlp.max_length = 5000000
|
197 |
if linking:
|
198 |
nlp.add_pipe('entityfishing',
|