Downloads · 30 days
12
1% of all-time downloads
Sreevishnu/funnel-transformer-small-imdb
funnel-transformer-small-imdb is a text classification model from Sreevishnu. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
These are the model weights for the Funnel Transformer small model fine-tuned on the IMDB dataset for performing Sentiment Analysis with maxpositionembeddings=1024.
Downloads · 30 days
12
1% of all-time downloads
All-time downloads
1.4K
Public
Repo size
930 MB
Likes
1
Public
Click a slice to open those files.
.bin465 MB · 100%
From the Hugging Face model README
These are the model weights for the Funnel Transformer small model fine-tuned on the IMDB dataset for performing Sentiment Analysis with max_position_embeddings=1024.
The original model weights for English language are from funnel-transformer/small and it uses a similar objective objective as ELECTRA. It was introduced in this paper and first released in this repository. This model is uncased: it does not make a difference between english and English.
| Accuracy | Precision | Recall | F1 | |
|---|---|---|---|---|
| funnel-transformer-small-imdb | 0.956530 | 0.952286 | 0.961075 | 0.956661 |
Funnel Transformer is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.
More precisely, a small language model corrupts the input texts and serves as a generator of inputs for this model, and the pretraining objective is to predict which token is an original and which one has been replaced, a bit like a GAN training.
This way, the model learns an inner representation of the English language that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the BERT model as inputs.
Here is how to use this model to get the features of a given text in PyTorch:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained(
"Sreevishnu/funnel-transformer-small-imdb",
use_fast=True)
model = AutoModelForSequenceClassification.from_pretrained(
"Sreevishnu/funnel-transformer-small-imdb",
num_labels=2,
max_position_embeddings=1024)
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
output = model(**encoded_input)
https://lazy-film-reviews-7gif2bz4sa-ew.a.run.app/
Project repo: https://github.com/akshaydevml/lazy-film-reviews