Token Classification
Transformers
ONNX
Safetensors
distilbert
logging
text-cleaning
korean
japanese
chinese
slopdam
Instructions to use slopdam/chatter-tagger with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use slopdam/chatter-tagger with Transformers:
# 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") - Notebooks
- Google Colab
- Kaggle
Guard: never delete a log level, label or exception name (panic:, Warning:, ValueError:)
Browse files23 unmodified lines24252627282929 unmodified lines5960616263646517 unmodified lines83848586878823 unmodified linesUNSAFE = re.compile(r"[0-9/\\_=@]|\.\w|\w\.\w")# An opener ends in punctuation, or (Korean only) in a connective ending such as -면, -로, -히.OPENER_END = re.compile(r"(?:[,:!?.…]|[가-힣]*[면로히도피대럼과만데])$")MIXED = re.compile(r"[A-Za-z].*[가-힣]|[가-힣].*[A-Za-z]", re.S) # "orders에서" is content29 unmodified lines"""The safety envelope around the model. Per line, deletions are kept only if they form onerun of whole pieces starting where the line's text starts (after a list or heading marker),leave something behind, end in punctuation or a Korean connective ending, and contain nodigits, paths, file names, key=value or a mix of Latin and Hangul. Upper-casingis kept only on the first piece after that run. Any other line is left exactly as it was."""out = list(labels)line_start = 017 unmodified linesand not UNSAFE.search(span)and OPENER_END.search(span)and not MIXED.search(span))uppers = [i for i in idx if labels[i] == UPPER]ok = ok and all(i == first_kept and run for i in uppers)23 unmodified lines242526272829303132333429 unmodified lines646566676869707117 unmodified lines8990919293949523 unmodified linesUNSAFE = re.compile(r"[0-9/\\_=@]|\.\w|\w\.\w")# An opener ends in punctuation, or (Korean only) in a connective ending such as -면, -로, -히.OPENER_END = re.compile(r"(?:[,:!?.…]|[가-힣]*[면로히도피대럼과만데])$")# A log level, a diagnostic label or an exception name says what the line is: never an opener.LOG_LABEL = re.compile(r"(?i:panic|fatal|error|err|warn|warning|info|debug|trace|note|hint|caution|caused by|exception|traceback"r"|경고|오류|에러|참고|주의|치명적 오류|알림)(?![\w-])|\w*(?:Error|Exception|Warning)(?![\w-])")MIXED = re.compile(r"[A-Za-z].*[가-힣]|[가-힣].*[A-Za-z]", re.S) # "orders에서" is content29 unmodified lines"""The safety envelope around the model. Per line, deletions are kept only if they form onerun of whole pieces starting where the line's text starts (after a list or heading marker),leave something behind, end in punctuation or a Korean connective ending, and contain nodigits, paths, file names, key=value or a mix of Latin and Hangul, and do not start with a loglevel, a diagnostic label or an exception name ("panic:", "Warning:", "경고:", "ValueError:"). Upper-casingis kept only on the first piece after that run. Any other line is left exactly as it was."""out = list(labels)line_start = 017 unmodified linesand not UNSAFE.search(span)and OPENER_END.search(span)and not MIXED.search(span)and not LOG_LABEL.match(span))uppers = [i for i in idx if labels[i] == UPPER]ok = ok and all(i == first_kept and run for i in uppers)
chatter.py+8-1