Downloads · 30 days
420
1% of all-time downloads
dhpollack/distilbert-dummy-sentiment
distilbert-dummy-sentiment is a text classification model from dhpollack. Use it when you need a label for a piece of text. It is set up for transformers.
This is a dummy model that can be used for testing the transformers pipeline with the task sentiment-analysis. It should always give random results (i.e. {"label": "negative", "score": 0.5}).
Downloads · 30 days
420
1% of all-time downloads
All-time downloads
62.6K
Public
Repo size
—
Likes
0
Public
Click a slice to open those files.
.bin11.3 KB · 80%
From the Hugging Face model README
This is a dummy model that can be used for testing the transformers pipeline with the task sentiment-analysis. It should always give random results (i.e. {"label": "negative", "score": 0.5}).
classifier = pipeline("sentiment-analysis", "dhpollack/distilbert-dummy-sentiment")
results = classifier(["this is a test", "another test"])
This was created as follows:
[UNK]
[SEP]
[PAD]
[CLS]
[MASK]
import transformers
config = transformers.DistilBertConfig(vocab_size=5, n_layers=1, n_heads=1, dim=1, hidden_dim=4 * 1, num_labels=2, id2label={0: "negative", 1: "positive"}, label2id={"negative": 0, "positive": 1})
model = transformers.DistilBertForSequenceClassification(config)
tokenizer = transformers.DistilBertTokenizer("/tmp/vocab.txt", model_max_length=512)
config.save_pretrained(".")
model.save_pretrained(".")
tokenizer.save_pretrained(".")