Text Classification
Transformers
Safetensors
Vietnamese
roberta
vietnamese
moderation
phobert
finetune
Instructions to use lamdx4/phobert-vi-moderation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lamdx4/phobert-vi-moderation with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="lamdx4/phobert-vi-moderation")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("lamdx4/phobert-vi-moderation") model = AutoModelForSequenceClassification.from_pretrained("lamdx4/phobert-vi-moderation") - Notebooks
- Google Colab
- Kaggle
phoBERT Vietnamese Moderation (binary)
How to use
from transformers import AutoTokenizer, AutoModelForSequenceClassification
repo = "lamdx4/phobert-vi-moderation"
tok = AutoTokenizer.from_pretrained(repo, use_fast=False)
mdl = AutoModelForSequenceClassification.from_pretrained(repo)
probs = mdl(**tok("bình luận ...", return_tensors="pt", truncation=True, max_length=192)).logits.softmax(-1)
print({"valid": float(probs[0,0]), "invalid": float(probs[0,1])})
- Downloads last month
- 77
Model tree for lamdx4/phobert-vi-moderation
Base model
vinai/phobert-base-v2