All work
AIFeatured2025-05

0x1NLP

Configurable Indonesian text preprocessing library for slang normalisation, emoji handling, PII anonymisation, and PySastrawi stemming.

  • Python
  • NLP
  • PySastrawi
  • Bahasa Indonesia
  • PyPI
pip install 0x1-nlp

Project brief (5W + 1H)

Why I built it
Almost every text-preprocessing library assumes English morphology and clean prose, leaving every Indonesian NLP project to rewrite brittle regexes and slang dictionaries by hand for shorthand, stretched vowels, and Indonesian affixation.
What it is
A configurable Python text-preprocessing pipeline (ox1nlp) for Bahasa Indonesia covering HTML, URL, and mention cleaning, slang and spelling normalisation, repeated-character collapse, PII anonymisation, and PySastrawi stemming.
Who it is for
ML and NLP engineers and data scientists preparing Indonesian social, informal, or formal text for classification, NER, or downstream LLM pipelines.
Where it runs
Runs as a lightweight Python 3.10+ package across training notebooks, batch datasets, and inference services, including the preprocessing workflow behind Raihan's Hugging Face Indonesian models.
When it shipped
Started May 2025 (evolved from nahiarhdNLP); published as 0x1-nlp v1.7.1 on PyPI (MIT).
How it works
Exposes task presets (Pipeline.social(), Pipeline.formal(), Pipeline.anonymize()) and a declarative Pipeline(config) API that lazy-loads built-in Indonesian stopwords, slang lexicons, and emoji maps only for enabled stages.

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 from Pipeline.social(), Pipeline.formal(), or Pipeline.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")
flowchart LR T["Raw Indonesian Text"] --> C["Clean HTML, URLs, Mentions, Emoji"] C --> N["Normalise Slang, Spelling, Repeated Chars"] N --> L["Linguistic Tokenise, Stopwords, PySastrawi Stem"] L --> O["Model Input"]

MIT licensed, Python 3.10+, v1.7.1 on PyPI. Powers the preprocessing workflow behind the Indonesian classification models on Hugging Face.

Quick commands

⌘K

Navigate

Quick actions

Install CLI