dongrixinyu/JioNLP

中文 NLP 预处理、解析工具包,准确、高效、易用 A Chinese NLP Preprocessing & Parsing Package www.jionlp.com

What it solves

Chinese NLP developers often spend huge amounts of time on boring but necessary preprocessing and parsing tasks — cleaning dirty text, identifying entities like times and addresses, converting between formats, and splitting datasets. JioNLP bundles many of these routines into one library so you can skip the busywork and focus on building your actual model or application.

How it works

You install the package with pip and then import it as jio. The library exposes a large set of functions grouped into categories:

  • Gadgets: parse time expressions, location addresses, ID cards, phone numbers, and more.
  • Data augmentation: methods like back-translation, same-sound substitution, and entity replacement to increase training data variety.
  • Regular expression extraction & cleaning: extract or remove emails, URLs, phone numbers, IPs, and clean up messy text.
  • File I/O: helpers to read and write files line by line, with timers and logging.
  • Dictionary loaders: load stopwords, idioms, Chinese place names, world cities, and other useful lexicons.
  • NER utilities: convert entity annotations to model tags, compare predictions, split datasets, and accelerate prediction.
  • Text classification & sentiment analysis: tools for analyzing category-specific words and computing lexicon-based sentiment scores.
  • Word segmentation support: convert word/tag formats and compute F1 scores.
  • Byte-level BPE: an implementation of the subword tokenization method.
  • MELLM: an algorithm for automatically evaluating large language models without human supervision, plus a loader for LLM test datasets.

Who it’s for

Primarily for developers and researchers working on Chinese natural language processing. It’s useful for anyone who needs fast, reliable text preprocessing, information extraction, or data augmentation for Chinese text. The included MELLM evaluation tool also appeals to people working with large language models.

Highlights

  • Time semantic parsing: extract timestamps, durations, and more from Chinese time phrases.
  • Location parsing: identify province, city, county, township, and village from address strings.
  • ID card parsing: extract province, birth date, gender, and checksum from Chinese ID numbers.
  • Data augmentation: back-translation, homophone substitution, and entity replacement for NER and text classification.
  • Regex extraction and cleaning: pull out or normalize emails, URLs, phone numbers, IP addresses, and remove HTML tags.
  • Dictionary loaders: access stopwords, idioms, Chinese location data, world cities, and more.
  • NER utilities: convert between entity formats and tags, compare manual vs. predicted entities, and split datasets with statistics.
  • Lexicon-based sentiment analysis: compute a sentiment score between 0 and 1 for a text.
  • Byte-level BPE implementation for subword tokenization.
  • MELLM: an automatic method for evaluating LLMs without human labels.

Related

  • Project
  • Project
  • Project
  • Project
  • Project