Skip to content

Instantly share code, notes, and snippets.

View Vishnunkumar's full-sized avatar
😉
Exploring Dev

Vishnu Nandakumar Vishnunkumar

😉
Exploring Dev
View GitHub Profile
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification
import tensorflow as tf
model_name = 'bert-base-cased'
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = TFAutoModelForSequenceClassification.from_pretrained(model_name, num_labels=2)
texts = ["I'm a positive example!", "I'm a negative example!"]
labels = [1, 0]