Skip to content

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
Contributor

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
@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.

4 participants