-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add record checking for allennlp and spacy #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why there is no expected_types_and_attributes
function for spacy and no record
for allenlp?
the pipeline. | ||
""" | ||
expectation_dict: Dict[str, Set[str]] = dict() | ||
expectation_dict["ft.onto.base_ontology.Sentence"] = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a demonstration, probably we can make this function simpler by using the literal implementation:
expectation_dict["ft.onto.base_ontology.Sentence"] = set() | |
expectation_dict: Dict[str, Set[str]] = { | |
"ft.onto.base_ontology.Sentence": set() | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few comments
if "pos" in self.configs.processors: | ||
record_meta["ft.onto.base_ontology.Token"].add("pos") | ||
if "depparse" in self.configs.processors: | ||
record_meta["ft.onto.base_ontology.Dependency"] = set() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think SRL is missing?
This PR fixes #6.
Description of changes
Added record writing for
SpaCy
processor to note the output contains theSentence
type which is required by other processors for exampleAllenNlp
processor. Added record checking forAllenNlp
processor which means it requiresSentence
type in the input datapack. The record checking could be enabled withpipeline.enforce_consistency(enforce=True)
.Possible influences of this PR.
None
Test Conducted
Not yet.