Problem
Most text-preprocessing libraries assume English morphology and clean prose. Indonesian social text breaks those assumptions: slang and shorthand dominate feeds, stretched vowels encode emphasis, and affixation requires dedicated Indonesian stemming so roots are not stripped blindly. Every Indonesian NLP project ends up re-implementing the same brittle regex and slang dictionaries by hand.
0x1NLP (0x1-nlp v1.7.1 on PyPI) packages that preprocessing layer with lazy-loaded dictionaries and deterministic presets.
What it does
One line of Indonesian social text before and after social cleaning and normalisation:
in Gw udh cobain bgttt, mantull parah!!! cek dong https://s.id/abc @raihan0x1 #NLP
out gue sudah coba banget, mantul parah!! cek dong
Shorthand (Gw, udh) is expanded, elongated characters (bgttt, mantull) collapse cleanly, and URLs, mentions, and hashtags are stripped before downstream classification or NER inference.
Approach & Architecture
- Configurable pipeline and task presets. Callers pass a config dictionary to
Pipeline(config)or start fromPipeline.social(),Pipeline.formal(), orPipeline.anonymize()(swapping emails, links, and mentions for structured tokens). - Lazy dataset loading. Indonesian stopwords, slang lexicons, and emoji maps load only for enabled steps so lightweight cleaning stays fast.
from ox1nlp.preprocessing import Pipeline
Pipeline.social().process("Gw udh cobain bgttt, mantull parah!!! cek dong https://s.id/abc @raihan0x1 #NLP")
Pipeline.formal().process("Saya sedang belajar pemrograman")
Pipeline.anonymize().process("hubungi john@example.com atau @admin")
MIT licensed, Python 3.10+, v1.7.1 on PyPI. Powers the preprocessing workflow behind the Indonesian classification models on Hugging Face.