Downloads · 30 days
28
3% of all-time downloads
lamdx4/phobert-vi-moderation
phobert-vi-moderation is a text classification model from lamdx4. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as agpl-3.0.
from transformers import AutoTokenizer, AutoModelForSequenceClassification repo = "lamdx4/phobert-vi-moderation" tok = AutoTokenizer.frompretrained(repo, usefast=False) mdl = AutoModelForSequenceClassification.frompre…
Downloads · 30 days
28
3% of all-time downloads
All-time downloads
848
Public
Parameters
135M
540 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors540 MB · 100%
From the Hugging Face model README
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])})