How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("token-classification", model="slopdam/chatter-tagger")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification

tokenizer = AutoTokenizer.from_pretrained("slopdam/chatter-tagger")
model = AutoModelForTokenClassification.from_pretrained("slopdam/chatter-tagger", device_map="auto")
Quick Links

slopdam chatter tagger

Removes the chatty openers AI assistants put at the start of log and console messages, in English, Korean, Japanese and Chinese, after slopdam's rules have done the rest.

input  : โœ… Great news! **Deployed** api โ€” 3 pods ๐ŸŽ‰
slopdam: Great news! Deployed api: 3 pods
tagger : Deployed api: 3 pods

input  : ์ข‹์€ ์†Œ์‹์ž…๋‹ˆ๋‹ค! ๋ฐฐํฌ ์™„๋ฃŒ
slopdam: ์ข‹์€ ์†Œ์‹์ž…๋‹ˆ๋‹ค. ๋ฐฐํฌ ์™„๋ฃŒ
tagger : ๋ฐฐํฌ ์™„๋ฃŒ

input  : ๐Ÿš€ ใ•ใฆใ€ใƒใƒƒใ‚ฏใ‚ขใƒƒใƒ—ใŒๅฎŒไบ†ใ—ใพใ—ใŸ
slopdam: ใ•ใฆใ€ใƒใƒƒใ‚ฏใ‚ขใƒƒใƒ—ใŒๅฎŒไบ†ใ—ใพใ—ใŸ
tagger : ใƒใƒƒใ‚ฏใ‚ขใƒƒใƒ—ใŒๅฎŒไบ†ใ—ใพใ—ใŸ

input  : ๅฅฝ็š„๏ผŒๅทฒๅฐ†42ๆก่ฎฐๅฝ•ไฟๅญ˜ๅˆฐorders
tagger : ๅทฒๅฐ†42ๆก่ฎฐๅฝ•ไฟๅญ˜ๅˆฐorders

slopdam's rules are deterministic and fix dashes, emoji, markdown and the like. Openers are different: there are too many ways to say "Great news!" or "์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค." for a word list, and slopdam's tone.chatty rule only reports the few it knows. This model handles that one job.

How it works

  • It never writes text. It tags each word piece KEEP, DELETE or UPPER (keep it with a capital letter), so it can delete words and capitalize the next one, nothing else. Numbers, IDs, URLs and paths cannot be changed, only kept or deleted.
  • Every deletion then has to pass a fixed guard (chatter.py), or the line is left exactly as it was. A deletion is applied only if it is one run of whole words at the start of a line (after a list or heading marker), ends in punctuation or a Korean connective ending (-๋ฉด, -๋กœ, -ํžˆ, ...), leaves something behind, and contains no digits, paths, file names, key=value, a mix of Latin with Hangul, kana or CJK ideographs, or a log level or label at its start (panic:, ERROR:, Caused by:, ValueError:, ๊ฒฝ๊ณ :, ใ‚จใƒฉใƒผ๏ผš, ้”™่ฏฏ๏ผš).
  • Japanese and Chinese have no spaces between words, so full-width punctuation (ใ€๏ผŒ๏ผ๏ผŸใ€‚) also ends a word there. A Japanese or Chinese span ending in a full-width colon is never deleted: there ็Šถๆ…‹๏ผš or ๆฅๆบ๏ผš is a label far more often than ใŠ็Ÿฅใ‚‰ใ›ใงใ™๏ผš is an opener, and the model cannot tell unseen ones apart.
  • Filler adverbs (Successfully, ์„ฑ๊ณต์ ์œผ๋กœ) are out of scope. An unseen one cannot be told from content (Java's finally block), so slopdam handles them with a word list.

Use

pip install "slopdam[chatter]"
tail -f app.log | slopdam clean --chatter
from slopdam.chatter import strip

strip(["Heads up: cache warmed for orders", "Finally block ran in auth", "๐Ÿš€ ใ•ใฆใ€ใƒใƒƒใ‚ฏใ‚ขใƒƒใƒ—ใŒๅฎŒไบ†ใ—ใพใ—ใŸ"])
# ['Cache warmed for orders', 'Finally block ran in auth', 'ใƒใƒƒใ‚ฏใ‚ขใƒƒใƒ—ใŒๅฎŒไบ†ใ—ใพใ—ใŸ']

strip and --chatter run slopdam's rules (reader profile) first, since the model was trained on their output, then the model with its guard. They load this repository at a pinned revision. Calling the model without the guard is not supported. chatter.py here is the same module as slopdam.chatter, for use without installing slopdam: ChatterTagger()(lines) runs the model and guard on lines you have already cleaned.

In the browser

onnx/model_int8.onnx (129 MB) is an int8 export for onnxruntime-web. The slopdam Space runs it in the page, with chatter.js there as the tokenizer, guard and rebuild; nothing is sent to a server. On log-slop test it gives the same output as the PyTorch model on 4,551 of 4,552 lines and the same handwritten-set scores; see the table below. hf/model/export_onnx.py makes it, and hf/model/js_parity.py checks that chatter.js turns the same labels into the same text as chatter.py (5,337 lines, all equal).

Evaluation

Scored on log-slop v6, which adds Japanese and Chinese (20% of rows each) to v5. v6 is generated from slopdam's main branch, which keeps full-width punctuation on Chinese and Japanese lines; it goes on the Hub with the next slopdam release. The test split uses message templates, openers, labels, look-alike lines and log shapes that never appear in training. Rows with filler adverbs are excluded, since fillers are not this model's job. The handwritten sets are 44 lines each, written by hand with words that are in none of the generator's lists; sets 3 and 4 are English and Korean, sets 5 to 7 Japanese and Chinese. Set 7 is the gate for this release.

Result Release bar
test: unseen openers removed (exact match), openers ending in ๏ผš left out 90.7% (343 of 378) 90%
test: same, English / Korean / Japanese / Chinese 99.3% / 87.8% / 77.3% / 91.7%
test: unseen openers removed, all 84.3% (343 of 407)
test: other rows left unchanged 100% (4,145) 99.5%
test: hard negatives left unchanged 100% (1,130) 100%
Handwritten set 7 (ja, zh): content lines left unchanged 20 of 20 20 of 20
Handwritten set 7 (ja, zh): openers removed 21 of 24 18 of 24
Handwritten set 6 (ja, zh): content / openers 20 of 20 / 22 of 24
Handwritten set 5 (ja, zh): content / openers 20 of 20 / 18 of 24
Handwritten set 4 (en, ko): content / openers 20 of 20 / 21 of 24
Handwritten set 3 (en, ko): content / openers 20 of 20 / 23 of 24
int8 ONNX: test unseen openers, ๏ผš left out / all 90.5% (342 of 378) / 84.0% 90%
int8 ONNX: other rows / hard negatives / set 7 100% / 100% / 20 of 20, 21 of 24
int8 ONNX: per line on CPU (onnxruntime), median / p99 2.5 ms / 7.3 ms

The three openers set 7 misses all end in ๏ผš (ๅ ฑๅ‘Šใ„ใŸใ—ใพใ™๏ผš, ้ƒ‘้‡้€š็Ÿฅ๏ผš, ๅˆ’้‡็‚น๏ผš), which the guard keeps by design.

How the bar was met, in full. This is the second training round on v6. The first release (trained on v4), scored on set 5 as a baseline, removed 21 of 24 Japanese and Chinese openers but deleted 4 content labels (็ตๆžœ๏ผš, ๆ€ป่ฎก๏ผš, ่ฆ็ขบ่ช๏ผš). Round 1 on v6 still deleted them, so the generator gained Japanese and Chinese label lines (็Šถๆ…‹๏ผšOK) and set 6 was written as the next gate. Round 2 then deleted unseen labels (ๆฅๆบ๏ผš, ไผ˜ๅ…ˆ็บง๏ผš, ๅฎ›ๅ…ˆ๏ผš) on the test split and 2 of 20 content lines in set 6, so the full-width colon rule was added to the guard and set 7 was written before any candidate was scored on it. Between the two rounds' models, round 2 was picked on the test split and sets 3 to 6 (English 99.3% against 89.1%); set 7 was used once, on that model. The bar of 90% is met only with openers ending in ๏ผš left out of the count, the same way fillers are; counting them, 84.3% of unseen openers are removed. Earlier: the first release was the fourth round on v4, gated by set 3, with guard rules for -์„œ endings, mixed Latin and Hangul and log levels added after seeing test failures; a model retrained on v5 scored lower and was not released; a character model trained from scratch removed 55% of the rewrites and changed 4% of the lines it should have left alone, and was not released either.

Limits

  • Trained only on synthetic log messages from log-slop. Long prose, chat transcripts and languages other than English, Korean, Japanese and Chinese are out of scope.
  • It misses openers that look like content or have no punctuation (Plot twist: was kept, Right, so ... was kept). When unsure it keeps the line, by design.
  • Japanese and Chinese openers that end in ๏ผš are never removed. Japanese is the weakest language (77.3% of unseen openers), then Korean (87.8%).
  • It is not an AI-text detector and says nothing about who wrote a line.

Training

  • Base: distilbert-base-multilingual-cased (Apache-2.0, pretrained on Wikipedia in 104 languages).
  • Data: 90,268 rows of log-slop v6 train without filler rows, labels derived from reader and target; 3 epochs, AdamW, learning rate 5e-5 with a one-cycle schedule, batch 32, on an Apple M-series GPU (61 minutes).
  • Code: hf/model/finetune.py and hf/model/chatter.py in the slopdam repository.
  • int8 ONNX: dynamic quantization with one scale per output channel. One scale per tensor was tried first and scored 89.9% of unseen openers on test, under the bar; per channel was picked after seeing that.

License

Apache-2.0, the license of the base model. The training data and the slopdam code are MIT.

ํ•œ๊ตญ์–ด ์š”์•ฝ

AI ๋„๊ตฌ๊ฐ€ ๋กœ๊ทธ ๋งจ ์•ž์— ๋ถ™์ด๋Š” ์ธ์‚ฌ๋ง(์ข‹์€ ์†Œ์‹์ž…๋‹ˆ๋‹ค!, Heads up:, ใ•ใฆใ€, ๅฅฝ็š„๏ผŒ)์„ ์˜์–ด, ํ•œ๊ตญ์–ด, ์ผ๋ณธ์–ด, ์ค‘๊ตญ์–ด์—์„œ ์ง€์šฐ๋Š” ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. slopdam ๊ทœ์น™์œผ๋กœ ๋จผ์ € ์ •๋ฆฌํ•œ ํ…์ŠคํŠธ์— ์”๋‹ˆ๋‹ค. ๊ธ€์ž๋ฅผ ์ƒˆ๋กœ ์“ฐ์ง€ ์•Š๊ณ  ๋‹จ์–ด๋ฅผ ์ง€์šฐ๊ฑฐ๋‚˜ ์ฒซ ๊ธ€์ž๋ฅผ ๋Œ€๋ฌธ์ž๋กœ ๋ฐ”๊พธ๊ธฐ๋งŒ ํ•˜๋ฉฐ, ์ค„ ๋งจ ์•ž์˜ ํ•œ ๋ฉ์–ด๋ฆฌ์ด๊ณ  ๋ฌธ์žฅ ๋ถ€ํ˜ธ๋‚˜ ์—ฐ๊ฒฐ ์–ด๋ฏธ๋กœ ๋๋‚˜๊ณ  ์ˆซ์ž, ๊ฒฝ๋กœ, ํŒŒ์ผ ์ด๋ฆ„์ด ์—†์„ ๋•Œ๋งŒ ์ง€์›๋‹ˆ๋‹ค. ์กฐ๊ฑด์ด ๋งž์ง€ ์•Š์œผ๋ฉด ๊ทธ ์ค„์€ ์›๋ฌธ ๊ทธ๋Œ€๋กœ ๋‘ก๋‹ˆ๋‹ค. panic:, ๊ฒฝ๊ณ :, ใ‚จใƒฉใƒผ๏ผš ๊ฐ™์€ ๋กœ๊ทธ ๋ ˆ๋ฒจ๊ณผ ๋ผ๋ฒจ์€ ์ง€์šฐ์ง€ ์•Š๊ณ , ์ผ๋ณธ์–ด์™€ ์ค‘๊ตญ์–ด์—์„œ ๏ผš๋กœ ๋๋‚˜๋Š” ๊ตฌ๊ฐ„์€ ๋ผ๋ฒจ์ผ ๋•Œ๊ฐ€ ๋งŽ์•„ ์ง€์šฐ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. log-slop v6 test์—์„œ ํ•™์Šต์— ์—†๋˜ ์ธ์‚ฌ๋ง์˜ 90.7%๋ฅผ ์ง€์› ๊ณ (๏ผš๋กœ ๋๋‚˜๋Š” ์ธ์‚ฌ๋ง ์ œ์™ธ, ์ „๋ถ€ ์„ธ๋ฉด 84.3%), ๊ทธ๋Œ€๋กœ ๋‘ฌ์•ผ ํ•  ์ค„์€ ํ•˜๋‚˜๋„ ๋ฐ”๊พธ์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ์ผ๋ณธ์–ด๊ฐ€ ๊ฐ€์žฅ ์•ฝํ•ฉ๋‹ˆ๋‹ค(77.3%). ๋ธŒ๋ผ์šฐ์ €์šฉ int8 ONNX(onnx/model_int8.onnx, 129 MB)๋„ ์žˆ์œผ๋ฉฐ, test 4,552์ค„ ์ค‘ 4,551์ค„์—์„œ PyTorch ๋ชจ๋ธ๊ณผ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฅผ ๋ƒ…๋‹ˆ๋‹ค. ๋ฐ๋ชจ์—์„œ ์จ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ธฐ์ค€์„ ๋งž์ถ”๊ธฐ๊นŒ์ง€์˜ ๊ณผ์ •(ํ‰๊ฐ€ ์„ธํŠธ๋ฅผ ์ƒˆ๋กœ ์“ด ์ด์œ , ๊ฐ€๋“œ ๊ทœ์น™์„ ๋”ํ•œ ์‹œ์ )์€ ์œ„ Evaluation์— ๋ชจ๋‘ ์ ์—ˆ์Šต๋‹ˆ๋‹ค.

Downloads last month
27
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for slopdam/chatter-tagger

Quantized
(40)
this model

Dataset used to train slopdam/chatter-tagger

Space using slopdam/chatter-tagger 1