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

fix: Document Classifiers - fix error messages #8765

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def run(self, documents: List[Document]):
if not isinstance(documents, list) or documents and not isinstance(documents[0], Document):
raise TypeError(
"DocumentLanguageClassifier expects a list of Document as input. "
"In case you want to classify a text, please use the TextLanguageClassifier."
"In case you want to classify and route a text, please use the TextLanguageRouter."
)

output: Dict[str, List[Document]] = {language: [] for language in self.languages}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def run(self, documents: List[Document], batch_size: int = 1):

if not isinstance(documents, list) or documents and not isinstance(documents[0], Document):
raise TypeError(
"DocumentLanguageClassifier expects a list of documents as input. "
"In case you want to classify a text, please use the TextLanguageClassifier."
"TransformerZeroShotDocumentClassifier expects a list of documents as input. "
"In case you want to classify and route a text, please use the TransformersZeroShotTextRouter."
)

invalid_doc_ids = []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fix error messages for Document Classifier components, that suggested using nonexistent components for text
classification.
Loading