Downloads · 30 days
62
37% of all-time downloads
prashantkhandelwal/movie-genres-classification
movie-genres-classification is a text classification model from prashantkhandelwal. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
A BERT-based multi-label classifier that predicts one or more movie genres from a movie’s title and overview. The model supports 19 genres, including Action, Comedy, Drama, Horror, Romance, Science Fiction, and Thriller.
Downloads · 30 days
62
37% of all-time downloads
All-time downloads
168
Public
Parameters
109M
1.8 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors438 MB · 100%
From the Hugging Face model README
A BERT-based multi-label classifier that predicts one or more movie genres from a movie’s title and overview. The model supports 19 genres, including Action, Comedy, Drama, Horror, Romance, Science Fiction, and Thriller.
Load the model with Hugging Face Transformers and provide a movie title or overview. Apply sigmoid to the model outputs and select genres with a probability of at least 0.5.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="prashantkhandelwal/movie-genres-classification",
top_k=None,
)
result = classifier(
"A crew travels through deep space to stop an alien threat from destroying Earth."
)
genres = [label for label in result[0] if label["score"] >= 0.5]
print(genres)