duanju-llm
text violation detector for short-form videos
2 min read
This token-classification model analyzes distribution copy for short-form series (titles, descriptions, cover text, and tags) to flag six violation categories down to exact character offsets (spans). Built on the Microsoft Multilingual-MiniLM-L12 architecture with a vocabulary pruned to 20k tokens, it weighs in at just 29.3M parameters. Instead of a generic pass/fail verdict, it pinpoints the exact text spans that need a moderator's attention or rewording. Exported to ONNX with dynamic int8 quantization, it runs entirely on CPU with minimal resource overhead.
Key features
- Six categories: detects extreme claims, exaggerations, payment prompts, name impersonation, vulgarity, and superstition.
- Lightweight ONNX: at roughly 29.5 MB, the model runs without heavy frameworks like PyTorch.
- High speed: delivers low CPU latency (around 6 milliseconds per inference) and high throughput.
- Assisting tool: tuned for high recall to act as a helpful assistant rather than a strict hard-blocker.
What you can do
- Moderation pipelines: plug it into review workflows for short-form video descriptions or ad copy to quickly highlight risky segments.
- Real-time editor hints: flag questionable words and phrases for creators as they type inside a web UI or bot.
- Content audits: batch-scan text databases to uncover potential triggers and banned phrasing.
Example
import json, numpy as np, onnxruntime as ort
from tokenizers import Tokenizer
MODEL_DIR = "fexeak/duanju-llm"
LABELS = ["induce_payment", "piggyback", "superstition_threat",
"vulgar_suggestive", "exaggeration_promise", "extreme_wording"]
tok = Tokenizer.from_file(f"{MODEL_DIR}/tokenizer.json")
sess = ort.InferenceSession(f"{MODEL_DIR}/model_int8.onnx", providers=["CPUExecutionProvider"])
# Пример базовой инициализации и инференса для поиска нарушений
print("Модель успешно загружена и готова к детекции")
Read more
DetailsMetrics (F1): ONNX int8 scores 74.53 (outperforming the original fp32 model thanks to fine-tuning and quantization).
Hardware: pure CPU, using roughly 650 MB of RSS memory.
Limitations: experimental release trained on synthetic data; complex human-written phrasing may cause false negatives in the exaggeration category.










Comments