Downloads · 30 days
10
5% of all-time downloads
hlevring/bert-punct-restoration-da-onnx
bert-punct-restoration-da-onnx is a token classification model from hlevring. Use it when you need labels on individual words, such as names. The card lists the license as apache-2.0.
ONNX conversion of Alvenir/bert-punct-restoration-da for use with transformers.js and other ONNX runtimes.
Downloads · 30 days
10
5% of all-time downloads
All-time downloads
214
Public
Repo size
772 MB
Likes
0
Public
Click a slice to open those files.
.onnx772 MB · 100%
From the Hugging Face model README
ONNX conversion of Alvenir/bert-punct-restoration-da for use with transformers.js and other ONNX runtimes.
Each label has format <punctuation><case>:
| Label | Punctuation | Capitalization |
|---|---|---|
| OO | None | lowercase |
| OU | None | Uppercase |
| .O | Period | lowercase |
| .U | Period | Uppercase |
| ,O | Comma | lowercase |
| ,U | Comma | Uppercase |
| ?O | Question mark | lowercase |
| ?U | Question mark | Uppercase |
| !O | Exclamation | lowercase |
| !U | Exclamation | Uppercase |
| :O | Colon | lowercase |
| :U | Colon | Uppercase |
| ;O | Semicolon | lowercase |
| 'O | Apostrophe | lowercase |
| -O | Hyphen | lowercase |
| File | Precision | Size |
|---|---|---|
onnx/model.onnx | FP32 | ~440 MB |
onnx/model_fp16.onnx | FP16 | ~220 MB |
onnx/model_quantized.onnx | INT8 | ~111 MB |
import { AutoTokenizer, BertForTokenClassification } from "@huggingface/transformers";
const tokenizer = await AutoTokenizer.from_pretrained("hlevring/bert-punct-restoration-da-onnx");
const model = await BertForTokenClassification.from_pretrained("hlevring/bert-punct-restoration-da-onnx", {
dtype: "q8",
});
const encoded = tokenizer("hej og velkommen til linket horoskop", { return_tensors: "pt" });
const output = await model(encoded);
// output.logits: [batch, seq_len, 15] - argmax to get label IDs
"fp32" - Full precision (440 MB)"fp16" - Half precision (220 MB)"q8" - INT8 quantized (111 MB)This is an ONNX export of Alvenir/bert-punct-restoration-da, part of the punctfix library.