drug-detection-xlm-roberta
Fine-tuned xlm-roberta-base sequence classifier for detecting drug-related slang / content in web text (Chinese and English). Binary classification: LABEL_0 = safe, LABEL_1 = drug-related.
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("matt0513/drug-detection-xlm-roberta")
model = AutoModelForSequenceClassification.from_pretrained("matt0513/drug-detection-xlm-roberta")
inputs = tokenizer("some text", return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=-1)
Part of the 114TKU_project_Drug-detection multimodal drug-content detection system's NLP module.
- Downloads last month
- -
Model tree for matt0513/drug-detection-xlm-roberta
Base model
FacebookAI/xlm-roberta-base