Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,6 +43,8 @@ def load_model(selected_language, model_name=None, entity_set=None):
|
|
| 43 |
if selected_language == "German":
|
| 44 |
# Load the German-specific model
|
| 45 |
nlp_model_de = spacy.load("de_core_news_sm")
|
|
|
|
|
|
|
| 46 |
return nlp_model_de
|
| 47 |
else:
|
| 48 |
# Load the pretrained model for other languages
|
|
@@ -91,7 +93,7 @@ if text_input:
|
|
| 91 |
# Map entities to a format similar to English output
|
| 92 |
entities = [(ent.text, ent.label_, ent._.kb_qid, ent._.url_wikidata) for ent in doc_de.ents]
|
| 93 |
else:
|
| 94 |
-
entities =
|
| 95 |
|
| 96 |
# Logic for English language processing
|
| 97 |
entities_map = {}
|
|
|
|
| 43 |
if selected_language == "German":
|
| 44 |
# Load the German-specific model
|
| 45 |
nlp_model_de = spacy.load("de_core_news_sm")
|
| 46 |
+
nlp_model_de.add_pipe("entityfishing", config={"language": "de"})
|
| 47 |
+
|
| 48 |
return nlp_model_de
|
| 49 |
else:
|
| 50 |
# Load the pretrained model for other languages
|
|
|
|
| 93 |
# Map entities to a format similar to English output
|
| 94 |
entities = [(ent.text, ent.label_, ent._.kb_qid, ent._.url_wikidata) for ent in doc_de.ents]
|
| 95 |
else:
|
| 96 |
+
entities = model.process_text(text_input)
|
| 97 |
|
| 98 |
# Logic for English language processing
|
| 99 |
entities_map = {}
|