Downloads · 30 days
7
17% of all-time downloads
ozoora/kzlbert-3poi
kzlbert-3poi is a text classification model from ozoora. Use it when you need a label for a piece of text. It is set up for transformers.
Downloads · 30 days
7
17% of all-time downloads
All-time downloads
42
Public
Repo size
1.4 GB
Likes
0
Public
Click a slice to open those files.
.bin711 MB · 100%
From the Hugging Face model README
Use:
tokenizer = BertTokenizerFast.from_pretrained('ozooora/kzlbert-3poi') model = AutoModelForSequenceClassification.from_pretrained('ozooora/kzlbert-3poi', return_dict=True)
@torch.no_grad() def predict(text): inputs = tokenizer(text, max_length=419, padding=True, truncation=True, return_tensors='pt') outputs = model(**inputs) predicted_probs = torch.nn.functional.softmax(outputs.logits, dim=1) predicted = torch.argmax(predicted_probs, dim=1).item() return predicted, predicted_probs[0].tolist()