pandayhim's picture
Upload 6 files
dbd8a1d verified
|
Raw History Blame Contribute Delete
1.01 kB
---
language:
- en
license: apache-2.0
library_name: transformers
---
# English Text Classifier
This repository contains a runnable sequence-classification model for English text.
## Files Needed for Inference
- `config.json`
- `model.safetensors`
- `tokenizer.json`
- `tokenizer_config.json`
- `special_tokens_map.json`
## Minimal Usage
```python
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_path = "."
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path)
model.eval()
texts = [
"I disagree with this argument, but the evidence is interesting.",
"You are awful and should leave.",
]
inputs = tokenizer(
texts,
padding=True,
truncation=True,
return_tensors="pt",
)
with torch.no_grad():
logits = model(**inputs).logits
scores = torch.sigmoid(logits)
print(scores.tolist())
```
The model returns a 14-dimensional score vector for each input text.