Cryptic2-0 commited on
Commit
57458df
·
verified ·
1 Parent(s): 1b54dc6

gold_v3: int8 ONNX + tokenizer + config + card

Browse files
README.md ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ language:
4
+ - hi
5
+ - en
6
+ tags:
7
+ - text-classification
8
+ - sentiment-analysis
9
+ - onnx
10
+ - code-mixed
11
+ - hinglish
12
+ - esports
13
+ - youtube-live-chat
14
+ pipeline_tag: text-classification
15
+ ---
16
+
17
+ # BGMISentiment — gold_v3 (ONNX)
18
+
19
+ 3-class sentiment for **BGMI / Indian-esports YouTube live chat** — fast, code-mixed
20
+ (Hindi + English + **Hinglish**) gaming chat. Fine-tuned from
21
+ `distilbert-base-multilingual-cased`, exported to **ONNX** (fp32 + INT8) for cheap CPU
22
+ serving.
23
+
24
+ - **Classes:** `0 negative · 1 neutral · 2 positive`. `signed = P(pos) − P(neg)`.
25
+ - **Trained on:** ~208k silver rows (random 500/video × 416 streams + slang/emoji prior),
26
+ combined with a human-reviewed gold set, 70/15/15 split, with gold-distribution class
27
+ weights `[neg 1.2, neu 1.5, pos 0.5]`.
28
+ - **Gold eval (n=666), calibrated (NEU_GATE=0.55):** accuracy **0.84**, macro-F1 **0.75**,
29
+ neutral recall 0.71, positive recall 0.96.
30
+
31
+ ## Files
32
+ | Path | Size | Use |
33
+ |---|---|---|
34
+ | `model.onnx` | 541 MB | fp32 ONNX (self-contained) |
35
+ | `onnx_int8/model_quantized.onnx` | 136 MB | INT8 — the deployed artifact (p50 ~7 ms CPU) |
36
+ | `tokenizer.json`, `vocab.txt`, `*config*.json` | — | WordPiece tokenizer + config |
37
+
38
+ ## Usage (ONNX Runtime)
39
+ ```python
40
+ import onnxruntime as ort, numpy as np
41
+ from transformers import AutoTokenizer
42
+
43
+ tok = AutoTokenizer.from_pretrained("<this-repo>")
44
+ sess = ort.InferenceSession("onnx_int8/model_quantized.onnx", providers=["CPUExecutionProvider"])
45
+ enc = tok(["soul clutch insane", "godlike choked again"], padding=True, truncation=True,
46
+ max_length=64, return_tensors="np")
47
+ logits = sess.run(None, {k: v for k, v in enc.items() if k in {i.name for i in sess.get_inputs()}})[0]
48
+ p = np.exp(logits) / np.exp(logits).sum(-1, keepdims=True)
49
+ print(p.argmax(-1)) # 0 neg / 1 neu / 2 pos
50
+ ```
51
+
52
+ ## Notes & limitations
53
+ - Tuned for **short, slangy, romanized-Hindi** esports chat; not a general sentiment model.
54
+ - Domain slang is blended at inference (e.g. "demon"/"goat" = praise). Serving applies a
55
+ calibrated neutral gate; raw argmax over-predicts neutral.
56
+ - Dataset: companion **BGMI Live-Chat Sentiment** dataset on Kaggle.
57
+ - Source data = public YouTube live chat; non-commercial / research use.
config.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "models/bgmi_gold_v2",
3
+ "activation": "gelu",
4
+ "architectures": [
5
+ "DistilBertForSequenceClassification"
6
+ ],
7
+ "attention_dropout": 0.1,
8
+ "dim": 768,
9
+ "dropout": 0.1,
10
+ "dtype": "float32",
11
+ "hidden_dim": 3072,
12
+ "id2label": {
13
+ "0": "negative",
14
+ "1": "neutral",
15
+ "2": "positive"
16
+ },
17
+ "initializer_range": 0.02,
18
+ "label2id": {
19
+ "negative": 0,
20
+ "neutral": 1,
21
+ "positive": 2
22
+ },
23
+ "max_position_embeddings": 512,
24
+ "model_type": "distilbert",
25
+ "n_heads": 12,
26
+ "n_layers": 6,
27
+ "output_past": true,
28
+ "pad_token_id": 0,
29
+ "problem_type": "single_label_classification",
30
+ "qa_dropout": 0.1,
31
+ "seq_classif_dropout": 0.2,
32
+ "sinusoidal_pos_embds": false,
33
+ "tie_weights_": true,
34
+ "torch_dtype": "float32",
35
+ "transformers_version": "4.40.2",
36
+ "vocab_size": 119547
37
+ }
onnx_int8/model_quantized.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97ac6d6ed830a8210336eea658e8e0e5853a09794c138f4fe2a14e5271b1cf43
3
+ size 135756890
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": false,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "max_length": 128,
50
+ "model_max_length": 512,
51
+ "pad_token": "[PAD]",
52
+ "sep_token": "[SEP]",
53
+ "stride": 0,
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "DistilBertTokenizer",
57
+ "truncation_side": "right",
58
+ "truncation_strategy": "longest_first",
59
+ "unk_token": "[UNK]"
60
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff