Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -94,11 +94,16 @@ if text_input:
|
|
94 |
entities = [(ent.text, ent.label_, ent._.kb_qid, ent._.url_wikidata) for ent in doc_de.ents]
|
95 |
for entity in entities:
|
96 |
entity_string, entity_type, wikidata_id, wikidata_url = entity
|
|
|
|
|
97 |
if wikidata_url:
|
98 |
# Ensure correct format for the German model
|
99 |
formatted_wikidata_url = wikidata_url.replace("https://", "http://")
|
100 |
entities_map[entity_string] = {"id": wikidata_id, "link": formatted_wikidata_url}
|
101 |
entity_data = get_entity_data(formatted_wikidata_url)
|
|
|
|
|
|
|
102 |
if entity_data is not None:
|
103 |
entities_data[entity_string] = entity_data
|
104 |
|
|
|
94 |
entities = [(ent.text, ent.label_, ent._.kb_qid, ent._.url_wikidata) for ent in doc_de.ents]
|
95 |
for entity in entities:
|
96 |
entity_string, entity_type, wikidata_id, wikidata_url = entity
|
97 |
+
# Debug
|
98 |
+
st.write(entity_string, wikidata_id, wikidata_url)
|
99 |
if wikidata_url:
|
100 |
# Ensure correct format for the German model
|
101 |
formatted_wikidata_url = wikidata_url.replace("https://", "http://")
|
102 |
entities_map[entity_string] = {"id": wikidata_id, "link": formatted_wikidata_url}
|
103 |
entity_data = get_entity_data(formatted_wikidata_url)
|
104 |
+
|
105 |
+
st.write("formatted_wikidata_url:", formatted_wikidata_url)
|
106 |
+
|
107 |
if entity_data is not None:
|
108 |
entities_data[entity_string] = entity_data
|
109 |
|