Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- pt
|
| 4 |
+
- en
|
| 5 |
+
tags:
|
| 6 |
+
- chunking
|
| 7 |
+
- rag
|
| 8 |
+
- text-splitter
|
| 9 |
+
- distillation
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# tinyzchunk weights
|
| 14 |
+
|
| 15 |
+
Tiny MLP weights for the **tinyzchunk** chunker — a GPU-free, numpy-only chunker
|
| 16 |
+
distilled from the [zChunk](https://github.com/zchunk) algorithm. English and
|
| 17 |
+
Brazilian Portuguese, robust to noisy/OCR'd text.
|
| 18 |
+
|
| 19 |
+
The package source lives on GitHub: https://github.com/cnmoro/tinyzchunk
|
| 20 |
+
|
| 21 |
+
## Install
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
pip install tinyzchunk
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
The pip package is weight-free: on first use the weights are fetched from this
|
| 28 |
+
repo automatically (and cached). No GPU, no tokenizer.
|
| 29 |
+
|
| 30 |
+
## Usage
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from tinyzchunk import Chunker
|
| 34 |
+
|
| 35 |
+
chunker = Chunker() # auto-fetches weights from this repo
|
| 36 |
+
chunks = chunker.chunk(long_document) # -> list[str]
|
| 37 |
+
|
| 38 |
+
# or fetch explicitly
|
| 39 |
+
chunker = Chunker.from_pretrained("cnmoro/tinyzchunk")
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Files
|
| 43 |
+
- `weights.npz` — char-level sentence/paragraph boundary model (fallback)
|
| 44 |
+
- `line_weights.npz` — line-level "does a new unit start here?" model (primary)
|
| 45 |
+
|
| 46 |
+
## Distillation
|
| 47 |
+
Trained from Qwen2.5-7B zChunk teachers on prose + structured corpora (Q&A
|
| 48 |
+
roteiros, schedules, bios, FAQs, legal, contact lists) plus simulated-PDF-noise
|
| 49 |
+
training. Event schedules boundary F1 0.92–0.98; Q&A roteiros 0.74–1.0; noisy
|
| 50 |
+
text 0.89–0.97. ~14 ms/document on CPU.
|