stanfordnlp/imdb
Viewer • Updated • 100k • 177k • 370
How to use Gaurav2k/IMDB_Recommender with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Gaurav2k/IMDB_Recommender") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Gaurav2k/IMDB_Recommender")
model = AutoModelForSequenceClassification.from_pretrained("Gaurav2k/IMDB_Recommender")This model is a movie recommender system trained on IMDB movie data. It provides movie recommendations based on cosine similarity of text features extracted from movie titles and other attributes.
To get recommendations, you can use the following code snippet:
import requests
model_name = 'Gaurav2k/IMDB_Recommender'
api_url = f'https://api-inference.huggingface.co/models/{model_name}'
headers = {
'Authorization': f'Bearer your_token'
}
data = {
'inputs': 'The Godfather'
}
response = requests.post(api_url, headers=headers, json=data)
print(response.json())