Downloads · 30 days
0
kokuren/jp-sns-jev7-estimator
jp-sns-jev7-estimator is a text classification model from kokuren. Use it when you need a label for a piece of text. It is set up for onnxruntime. The card lists the license as apache-2.0.
Japanese SNS multi-axis scoring model that estimates seven continuous dimensions from text.
Downloads · 30 days
0
Access
Public
Updated Sep 18, 2026
Repo size
69.5 MB
Likes
1
Public
Click a slice to open those files.
.onnx69.1 MB · 99%
From the Hugging Face model README
Japanese SNS multi-axis scoring model that estimates seven continuous dimensions from text.
This repository contains an INT8 ONNX student model based on
line-corporation/line-distilbert-base-japanese.
The model returns seven sigmoid scores in [0, 1], in this order:
insultthreatobsceneidentity_attacksexual_explicittargetednessindirect_hostilityThese values are continuous distilled teacher scores, not calibrated probabilities. They should not automatically be interpreted as binary toxic / non-toxic labels.
Important semantic notes:
targetedness measures how clearly a specific target is addressed; it is not itself toxicity.obscene and sexual_explicit describe content characteristics and are not necessarily hostility.line-corporation/line-distilbert-base-japaneseBCEWithLogitsLoss with continuous soft targetsThe following metrics are from the bundled held-out test evaluation.
| Axis | MAE | RMSE | Pearson | Spearman | [email protected] |
|---|---|---|---|---|---|
insult | 0.0480 | 0.0907 | 0.7894 | 0.7971 | 0.5818 |
threat | 0.0063 | 0.0219 | 0.5298 | 0.5217 | 0.0000 |
obscene | 0.0274 | 0.0551 | 0.7886 | 0.7845 | 0.4658 |
identity_attack | 0.0094 | 0.0374 | 0.7148 | 0.6098 | 0.5000 |
sexual_explicit | 0.0358 | 0.0727 | 0.7306 | 0.6982 | 0.5323 |
targetedness | 0.1045 | 0.1566 | 0.8941 | 0.9040 | 0.8372 |
indirect_hostility | 0.0421 | 0.0805 | 0.8117 | 0.7941 | 0.5606 |
Macro metrics:
0.0390710.0735690.7512870.7299150.4967960.972623[email protected] and accuracy are auxiliary metrics only. Rare axes such as threat can be highly imbalanced, so thresholded classification metrics may be misleading.
Validation subset size: 1000 / 5980 test samples.
Drift versus the PyTorch model:
0.000036980.000762780.006549900.12767627Bundled local benchmark:
321531.7220.89 texts/secActual speed depends on CPU, ONNX Runtime version, thread settings, sequence length, and batch size.
Install dependencies:
pip install numpy onnxruntime transformers fugashi unidic-lite ipadic
Example:
from pathlib import Path
import json
import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer
ROOT = Path(".")
meta = json.loads(
(ROOT / "model_meta.json").read_text(encoding="utf-8")
)
axes = meta["axes"]
tokenizer = AutoTokenizer.from_pretrained(
ROOT / "tokenizer",
local_files_only=True,
trust_remote_code=True,
)
session = ort.InferenceSession(
str(ROOT / "model_int8.onnx"),
providers=["CPUExecutionProvider"],
)
text = "入力する日本語テキスト"
encoded = tokenizer(
[text],
return_tensors="np",
padding=True,
truncation=True,
max_length=meta["max_length"],
)
scores = session.run(
["scores"],
{
"input_ids": encoded["input_ids"].astype(np.int64),
"attention_mask": encoded["attention_mask"].astype(np.int64),
},
)[0][0]
print(dict(zip(axes, map(float, scores))))
A standalone example is also included as inference_example.py.
For exploratory hostility scoring, a simple baseline is to treat these four axes as the core hostile-language dimensions:
insult
threat
identity_attack
indirect_hostility
For example, an exploratory composite can be defined as the maximum of those four values. This is not a calibrated toxicity probability and should not be presented as a validated binary classifier without a separately labeled validation set.
Possible uses include:
model_int8.onnx — quantized ONNX modelmodel_meta.json — axis order and model metadatatokenizer/ — tokenizer filesinference_example.py — standalone CPU inference exampletest_metrics.json — test-set metricsonnx_validation.json — ONNX / quantization validationbenchmark_cpu.json — CPU benchmarkApache License 2.0.