Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import re
|
2 |
import json
|
|
|
3 |
|
4 |
import requests
|
5 |
|
@@ -134,6 +135,15 @@ def main():
|
|
134 |
'Choose a NER model you want to apply in the list: ',
|
135 |
models)
|
136 |
model = option
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
if model != "":
|
138 |
flag_model = True
|
139 |
|
|
|
1 |
import re
|
2 |
import json
|
3 |
+
import subprocess
|
4 |
|
5 |
import requests
|
6 |
|
|
|
135 |
'Choose a NER model you want to apply in the list: ',
|
136 |
models)
|
137 |
model = option
|
138 |
+
map_model = {
|
139 |
+
"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#sha256=919aca257e4b2342a3773e7dcc3442b30f2ac50c4a3466d5ecda5e0e337ea396"
|
140 |
+
"fr_ner4archives_v3": "https://huggingface.co/ner4archives/fr_ner4archives_v3_default/resolve/main/fr_ner4archives_v3_default-any-py3-none-any.whl#sha256=040a5c67a7e5a14e0125b2600e6aff1323f8ba9d800d5ab49446faeaf2dad6e6"
|
141 |
+
"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#sha256=4c938618ce84a919008d17822980cfd914f9ad8f73231a64cd1ffcaa80ab09f2"
|
142 |
+
}
|
143 |
+
try:
|
144 |
+
spacy.load(model)
|
145 |
+
except:
|
146 |
+
subprocess.run(["pip", "install", map_model[model]])
|
147 |
if model != "":
|
148 |
flag_model = True
|
149 |
|