Lucaterre / spacyfishing

A spaCy wrapper of Entity-Fishing (component) for named entity disambiguation and linking on Wikidata
MIT License
152 stars 6 forks source link

Using Example text all out put except NER is Null? #20

Open Djmcflush opened 1 year ago

Djmcflush commented 1 year ago
import spacy
text_en = "Victor Hugo and Honoré de Balzac are French writers who lived in Paris."
nlp_model_en = spacy.load("en_core_web_sm")
# specify configuration:
nlp_model_en.add_pipe("entityfishing", config={"extra_info": True})
doc_en = nlp_model_en(text_en)
# Access to description with ent._.description:
for ent in doc_en.ents:
        print((ent.text, ent.label_, ent._.kb_qid, ent._.normal_term, ent._.description, ent._.src_description, ent._.other_ids))
Djmcflush commented 1 year ago

Example Output: ('Victor Hugo', 'EVENT', None, None, None, None, None) ('Honoré de Balzac', 'PERSON', None, None, None, None, None) ('French', 'NORP', None, None, None, None, None) ('Paris', 'GPE', None, None, None, None, None)

Kaelorn commented 1 year ago

I have the same problem here, tested on python 3.8 and python 3.10

Kaelorn commented 1 year ago

I just checked the closed issues and this is related to https://github.com/Lucaterre/spacyfishing/issues/12 The solution worked for me