daspartho/subreddit-posts
Viewer • Updated • 244k • 84 • 2
How to use daspartho/subreddit-predictor with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="daspartho/subreddit-predictor") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("daspartho/subreddit-predictor")
model = AutoModelForSequenceClassification.from_pretrained("daspartho/subreddit-predictor")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("daspartho/subreddit-predictor")
model = AutoModelForSequenceClassification.from_pretrained("daspartho/subreddit-predictor")An NLP model that predicts subreddit based on the title of a post.
DistilBERT is fine-tuned on subreddit-posts, a dataset of titles of the top 1000 posts from the top 250 subreddits.
For steps to make the model check out the model notebook in the github repo or open in Colab.
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="daspartho/subreddit-predictor")