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 zero-shot classification demo #519

Merged
merged 2 commits into from
Jan 29, 2024
Merged

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented Jan 12, 2024

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@sroussey
Copy link

How can you get the model to give you the categories to begin with?

@xenova
Copy link
Collaborator Author

xenova commented Jan 29, 2024

How can you get the model to give you the categories to begin with?

I'd recommend using sentence-transformers for this. There are some tutorials online (like this one), which can also be useful here. Although, if you're interested in running with transformers.js, you should be able to reimplement some of the helper functions in JS, perhaps those needed as preprocessing or postprocessing steps on top of the model itself (which you can run with transformers.js).

Nowadays, you'd probably be able to do this with more powerful and up-to-date LLMs... but I've had success with the above-mentioned approach in the past.

@xenova xenova merged commit 1edf683 into main Jan 29, 2024
4 checks passed
@xenova xenova deleted the add-zero-shot-classification-demo branch January 29, 2024 10:29
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.

3 participants