Feature Extraction
Transformers.js
ONNX
English
bert
decidekit
system-one
text-classification
zero-shot-classification
calibration
on-device
Instructions to use debuffjp/decide-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use debuffjp/decide-small with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('feature-extraction', 'debuffjp/decide-small');
Model card
Browse files
README.md
CHANGED
|
@@ -3,31 +3,62 @@ license: mit
|
|
| 3 |
library_name: transformers.js
|
| 4 |
pipeline_tag: feature-extraction
|
| 5 |
base_model: BAAI/bge-small-en-v1.5
|
| 6 |
-
language:
|
|
|
|
| 7 |
tags:
|
| 8 |
- decidekit
|
| 9 |
- system-one
|
| 10 |
- text-classification
|
|
|
|
|
|
|
| 11 |
- onnx
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
|
|
|
|
|
|
| 14 |
# Decide Small
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
```ts
|
| 19 |
import { createDecider } from "decidekit";
|
| 20 |
|
| 21 |
-
const d = await createDecider();
|
| 22 |
-
const { choice, confidence } = await d.decide("my card still hasn't arrived", ["card_arrival", "refund"]);
|
| 23 |
```
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
|
|
|
| 3 |
library_name: transformers.js
|
| 4 |
pipeline_tag: feature-extraction
|
| 5 |
base_model: BAAI/bge-small-en-v1.5
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
tags:
|
| 9 |
- decidekit
|
| 10 |
- system-one
|
| 11 |
- text-classification
|
| 12 |
+
- zero-shot-classification
|
| 13 |
+
- calibration
|
| 14 |
- onnx
|
| 15 |
+
- on-device
|
| 16 |
+
thumbnail: https://huggingface.co/debuffjp/decide-small/resolve/main/assets/banner.png
|
| 17 |
---
|
| 18 |
|
| 19 |
+

|
| 20 |
+
|
| 21 |
# Decide Small
|
| 22 |
|
| 23 |
+
Decide reads a short piece of text and picks one of your labels, on the user's device, with a confidence you can act on: answers at 0.9 are right about 90% of the time. It's the default model in [decidekit](https://debuff.jp/decide/).
|
| 24 |
+
|
| 25 |
+
[Docs](https://debuff.jp/decide/docs/) 路 [Try it in your browser](https://debuff.jp/decide/playground/) 路 [GitHub](https://github.com/debuffjp/decidekit) 路 [npm](https://www.npmjs.com/package/decidekit)
|
| 26 |
+
|
| 27 |
+
## Use it
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
npm install decidekit
|
| 31 |
+
```
|
| 32 |
|
| 33 |
```ts
|
| 34 |
import { createDecider } from "decidekit";
|
| 35 |
|
| 36 |
+
const d = await createDecider(); // loads this model
|
| 37 |
+
const { choice, confidence } = await d.decide("my card still hasn't arrived", ["card_arrival", "lost_card", "refund"]);
|
| 38 |
```
|
| 39 |
|
| 40 |
+
The files download from this repo on first use, then stay in the browser's cache. To serve them yourself, copy this repo's files to your own host and pass `modelHost` to `createDecider()`.
|
| 41 |
+
|
| 42 |
+
## Numbers
|
| 43 |
+
|
| 44 |
+
| | |
|
| 45 |
+
|---|---|
|
| 46 |
+
| BANKING77, 77 labels, all training data | 90.7% |
|
| 47 |
+
| CLINC150, 150 labels, all training data | 94.4% |
|
| 48 |
+
| BANKING77 with 5 examples per label | 82.3% |
|
| 49 |
+
| A decision in Chrome (worker, median) | 7.7 ms |
|
| 50 |
+
| Download at 8-bit | 34 MB |
|
| 51 |
+
|
| 52 |
+
Ryzen 7 260 laptop, Chrome 156. Results and scripts: [eval/results-bge-small.json](https://github.com/debuffjp/decidekit/blob/main/eval/results-bge-small.json).
|
| 53 |
+
|
| 54 |
+
## Limits
|
| 55 |
+
|
| 56 |
+
- English. Use [Decide Multilingual](https://huggingface.co/debuffjp/decide-multilingual) for other languages.
|
| 57 |
+
- It reads what a text is about better than how it feels: 61% on tweet sentiment.
|
| 58 |
+
- About a paragraph at a time. Split longer text.
|
| 59 |
|
| 60 |
+
## What's in this repo
|
| 61 |
|
| 62 |
+
This repo holds the encoder, the part that turns text into vectors. decidekit adds the trained head and the calibrated confidence.
|
| 63 |
|
| 64 |
+
The weights are an unmodified copy of [Xenova/bge-small-en-v1.5](https://huggingface.co/Xenova/bge-small-en-v1.5) at revision `ea104da`, the ONNX conversion of [BAAI/bge-small-en-v1.5](https://huggingface.co/BAAI/bge-small-en-v1.5). We did not train them. They are here so decidekit has a stable, pinned source. MIT licensed, like the original.
|