# bazingagin/npc_gzip

Code for Paper: “Low-Resource” Text Classification: A Parameter-Free Classification Method with Compressors

Repository: https://github.com/bazingagin/npc_gzip
Canonical: https://ross.abutalabs.com/products/npc_gzip
Language: Python
License: MIT
License Family: permissive
Last push: 2023-08-07T04:43:48+00:00

## Health v2 (maintenance only)
Score: 20/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 85
- inputs: {"age_days": 1196, "days_push": 1122, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1780, forks 157 (observed 2026-08-28T04:05:35.412170+00:00)

## What it is
A Python library and research codebase implementing the parameter-free 'kNN-gzip' text classification method from the ACL 2023 paper, which classifies text using compression-based distances (gzip, lzma, bz2) instead of trained models. It is installable via pip and includes CLI scripts for running experiments on standard datasets or custom data.

## Use cases
- classify text without training a model
- low-resource text classification for languages with little data
- run gzip-based kNN classification experiments
- benchmark compression-based classifiers on AG News or DBpedia
- classify a custom labeled dataset with compressors
- reproduce ACL 2023 paper results

## When to choose
- you need a parameter-free, training-free text classifier
- you have very few labeled examples per class
- you want to reproduce or extend the kNN-gzip paper
- you want a simple baseline that avoids GPU/model training

## When to avoid
- you need state-of-the-art accuracy on large datasets
- you need fast low-latency inference at scale
- you want embeddings or fine-tuning with transformers
- your text is very long, since compression distances scale poorly

## Facets
- artifact type: library
- maturity: maintenance
- function: nlp, machine-learning, compression, cli
- domain: machine-learning, data-science
- platform: python, cli, cross-platform
- tags: text-classification, gzip-classifier, knn, low-resource-nlp, research-code, acl2023, natural-language-processing

## Member repositories
- bazingagin/npc_gzip (main) score 20

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:35.412170+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:24:35.176005+00:00, confidence not recorded.
  - readme: https://github.com/bazingagin/npc_gzip (fetched 2026-08-28T04:05:35.412170+00:00, sha 21cb148abfaf)
  - registry_pypi: https://pypi.org/pypi/npc_gzip/json (fetched 2026-08-29T11:03:07.740682+00:00, sha 6d9f7dc24464)
- Data as of 2026-08-30T08:39:29.467469+00:00.
