dwadden / dygiepp

Span-based system for named entity, relation, and event extraction.
MIT License
576 stars 120 forks source link

Spacy Interface with ace #127

Open ysfarag1 opened 4 months ago

ysfarag1 commented 4 months ago

I have been following on the steps of the mechanic spacy interface notebook and wanted to replicate the same for ace event and relations. I followed the same steps as for the coarse and granular, but there seems to be something off with it as I am not getting any output for the same examples that the coarse and granular models generate results for . Any help is appreciated

nlp_ace_event = spacy.load('en_core_web_sm') nlp_ace_rel = spacy.load('en_core_web_sm')

component_ace_event = DygieppPipe(nlp_ace_event,pretrained_filepath="./pretrained/ace05-event.tar.gz", dataset_name="ace-event") component_ace_rel = DygieppPipe(nlp_ace_rel,pretrained_filepath="./pretrained/ace05-relation.tar.gz", dataset_name="ace05")

nlp_ace_event.add_pipe(component_ace_event) nlp_ace_rel.add_pipe(component_ace_rel)

print("----------------------------ace event----------------------------")

for doc in nlp_ace_event.pipe(examples): print(doc) print("--------") print("Relations:") for sentev in doc..events: for ev in sent_ev: print(ev)

print("----------------------------ace rel----------------------------")

for doc in nlp_ace_rel.pipe(examples): print(doc) print("--------") print("Relations:") for sentrel in doc..rels: for rel in sent_rel: print(rel)

dwadden commented 3 months ago

Thanks for your interest! I'm sorry to say I can't offer support for spacy bindings; this was contributed by @e3oroush a few years ago now. Maybe he can help?

e3oroush commented 3 months ago

I'm sorry, I'm not available at the moment, but will try to take a look at it next week.

e3oroush commented 3 months ago

@ysfarag1 Thank you for your question. Is it possible to write all the steps you've made to reproduce the issue? As I can't reproduce it. Can you confirm that the problem is only existing when you use spacy interface?