-
Notifications
You must be signed in to change notification settings - Fork 61
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 code for training and running inference with huggingface predictors #6
Conversation
self, | ||
document: Document, | ||
context_name: str | ||
) -> List[EntityClassificationBatch]: |
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.
Just want to note that preprocess
and postprocess
don't pass type checking because their signatures are different from the superclass.
raise ValueError("This annotation is not attached to a document") | ||
|
||
if field in self.doc.fields: | ||
return self.doc.find_span_overlap_entities(self, field) |
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'm not sure why this line type-checks. self
is an Annotation
, but the first argument of self.doc.find_span_overlap_entities
should be an Entity
. Do we want to be able to intersect overlapping Annotation
or just overlapping Entity
s?
@property | ||
def fields(self) -> List[str]: | ||
return list(self.__entity_span_indexers.keys()) | ||
|
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.
mmda uses a separate list of fields, but is there any reason we can just use the indexer keys for simplicity?
What is needed for this PR: