stanfordnlp/imdb
Viewer • Updated • 100k • 189k • 370
How to use Minaaaa/t5_small_imdb with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="Minaaaa/t5_small_imdb") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Minaaaa/t5_small_imdb")
model = AutoModelForSequenceClassification.from_pretrained("Minaaaa/t5_small_imdb")# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("Minaaaa/t5_small_imdb")
model = AutoModelForSequenceClassification.from_pretrained("Minaaaa/t5_small_imdb")T5-small is a fine-tuned version of T5-small model. The dataset used for fine tuning is the IMDB dataset from Hugging Face. The number of instances used for training is 12 500, and 2 500 for testing. Metrics used for evaluation are classification oriented, because the model is used for sentiment analysis. The number of epochs used for training is 5, and the learning rate was set to lr = 5e-5. The results obtained are: Accuracy: 0.9204 Precision: 0.9158 Recall: 0.9268 F1-score: 0.9213
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Minaaaa/t5_small_imdb")