Text Classification
ONNX
English
multilingual
pico-type
pico_type
byte-level
content-classification
multi-head
classifier
edge-ai
code-detection
language-detection
clipboard
tiny
open-source
onnx-runtime
content-moderation
risk-detection
secrets-detection
prompt-injection-detection
pii-detection
pico-type-arth
Eval Results (legacy)
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -26,66 +26,22 @@ library_name: pico-type
|
|
| 26 |
|
| 27 |
**A tiny byte-level multi-head content classifier** — ~1.5M params, ~200KB ONNX, <12ms inference.
|
| 28 |
|
| 29 |
-
Classifies any content from raw bytes: **coarse type · modality · subtype · code language · text language · file MIME · risk flags**
|
| 30 |
-
|
| 31 |
-
[](https://pypi.org/project/pico-type/)
|
| 32 |
-
[](https://github.com/eulogik/pico-type)
|
| 33 |
-
[](https://huggingface.co/spaces/eulogik/pico-type)
|
| 34 |
-
|
| 35 |
</div>
|
| 36 |
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
## 📊 Evaluation (v2 — real data)
|
| 40 |
|
| 41 |
-
| Head |
|
| 42 |
-
|------|---------
|
| 43 |
-
|
|
| 44 |
-
|
|
| 45 |
-
|
|
| 46 |
-
|
|
| 47 |
-
|
|
| 48 |
-
| file_mime |
|
| 49 |
-
| risk (mAP) |
|
| 50 |
|
| 51 |
-
|
| 52 |
|
| 53 |
-
## 🚀 Usage
|
| 54 |
-
|
| 55 |
-
### Install
|
| 56 |
Defaulting to user installation because normal site-packages is not writeable
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
### Python
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
## 🧠 Model
|
| 65 |
-
|
| 66 |
-
| Tier | Dim | Params | ONNX Size |
|
| 67 |
-
|------|-----|--------|-----------|
|
| 68 |
-
| tiny | 16 | 1.43M | 203 KB |
|
| 69 |
-
| small | 64 | 1.45M | 203 KB |
|
| 70 |
-
| base | 192 | 1.48M | 206 KB |
|
| 71 |
-
| pro | 576 | 1.56M | 202 KB |
|
| 72 |
-
|
| 73 |
-
### Architecture
|
| 74 |
-
Bytes → ByteEmbed(256→96d) → 3×Conv1D(k=3,5,7) → 2×BiAttention(RoPE) → Pool(mean‖max‖std) → 7×Matryoshka Heads
|
| 75 |
-
|
| 76 |
-
### Classification Heads
|
| 77 |
-
| Head | Classes | Examples |
|
| 78 |
-
|------|---------|----------|
|
| 79 |
-
| coarse | 12 | text, code, link, image, file, config, markup, data, error, secret, archive, binary |
|
| 80 |
-
| modality | 8 | textual, binary_image, binary_archive, binary_executable, etc. |
|
| 81 |
-
| subtype | 24 | json, yaml, csv, html, markdown, sql, dockerfile, etc. |
|
| 82 |
-
| code_lang | 62 | python, javascript, java, c, cpp, go, rust, ruby, php, swift, kotlin, and 50 more |
|
| 83 |
-
| text_lang | 30 | en, es, fr, de, it, pt, ru, zh, ja, ko, vi, th, id, and 15 more |
|
| 84 |
-
| file_mime | 90 | application/json, image/png, video/mp4, font/ttf, application/wasm, and 84 more |
|
| 85 |
-
| risk | 6 | api_key, jwt, password, email, phone, ssh_key |
|
| 86 |
-
|
| 87 |
-
## 🌐 Links
|
| 88 |
-
|
| 89 |
-
- **Space**: [huggingface.co/spaces/eulogik/pico-type](https://huggingface.co/spaces/eulogik/pico-type)
|
| 90 |
-
- **GitHub**: [github.com/eulogik/pico-type](https://github.com/eulogik/pico-type)
|
| 91 |
-
- **PyPI**: Defaulting to user installation because normal site-packages is not writeable
|
|
|
|
| 26 |
|
| 27 |
**A tiny byte-level multi-head content classifier** — ~1.5M params, ~200KB ONNX, <12ms inference.
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
</div>
|
| 30 |
|
| 31 |
+
## Evaluation (v1 — synthetic)
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
| Head | Accuracy |
|
| 34 |
+
|------|----------|
|
| 35 |
+
| coarse | 100% |
|
| 36 |
+
| modality | 100% |
|
| 37 |
+
| subtype | 93.8% |
|
| 38 |
+
| code_lang | 41.7% |
|
| 39 |
+
| text_lang | 94.3% |
|
| 40 |
+
| file_mime | 100% |
|
| 41 |
+
| risk (mAP) | 100% |
|
| 42 |
|
| 43 |
+
## Usage
|
| 44 |
|
|
|
|
|
|
|
|
|
|
| 45 |
Defaulting to user installation because normal site-packages is not writeable
|
| 46 |
|
| 47 |
+
[GitHub](https://github.com/eulogik/pico-type) | [Space](https://huggingface.co/spaces/eulogik/pico-type)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|