Skip to content
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

Merged
merged 24 commits into from
Jul 31, 2023

Conversation

bnewm0609
Copy link
Contributor

@bnewm0609 bnewm0609 commented Jul 21, 2023

What is needed for this PR:

  • Inference code & tests
  • Training code & tests

self,
document: Document,
context_name: str
) -> List[EntityClassificationBatch]:
Copy link
Contributor Author

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)
Copy link
Contributor Author

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 Entitys?

@property
def fields(self) -> List[str]:
return list(self.__entity_span_indexers.keys())

Copy link
Contributor Author

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?

@bnewm0609 bnewm0609 requested a review from kyleclo July 26, 2023 00:01
@kyleclo kyleclo merged commit 3b088c5 into main Jul 31, 2023
3 checks passed
@kyleclo kyleclo deleted the benjaminn/add-trainer branch July 31, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants