Skip to content

Spacy Interface with ace #127

@ysfarag1

Description

@ysfarag1

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 sent_ev 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 sent_rel in doc._.rels:
for rel in sent_rel:
print(rel)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions