fancyzhx/ag_news
Viewer • Updated • 128k • 121k • 189
How to use wesleyacheng/news-topic-classification-with-bert with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="wesleyacheng/news-topic-classification-with-bert") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("wesleyacheng/news-topic-classification-with-bert")
model = AutoModelForSequenceClassification.from_pretrained("wesleyacheng/news-topic-classification-with-bert")BREAKING NEWS: We are making a news topic classifier!
First posted on my Kaggle.
Here I did transfer learning on BERT with the AG News Dataset to create a multi-class news topic classifier to classify news as either Business, Sports, Sci/Tech, or World.