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
-
Safetensors
Model size
0.3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for matt0513/drug-detection-xlm-roberta

Finetuned
(4177)
this model