Downloads · 30 days
10
19% of all-time downloads
sekarkrishna/legalbert-int8
legalbert-int8 is a feature extraction model from sekarkrishna. Use it when you need embeddings to search or compare text. It is set up for onnxruntime. The card lists the license as cc-by-sa-4.0.
ONNX INT8 quantized version of nlpaueb/legal-bert-base-uncased for efficient legal text embeddings.
Downloads · 30 days
10
19% of all-time downloads
All-time downloads
52
Public
Repo size
111 MB
Likes
0
Public
Click a slice to open those files.
.onnx111 MB · 99%
From the Hugging Face model README
ONNX INT8 quantized version of nlpaueb/legal-bert-base-uncased for efficient legal text embeddings.
| Property | Value |
|---|---|
| Base Model | nlpaueb/legal-bert-base-uncased |
| Format | ONNX |
| Quantization | INT8 (dynamic quantization) |
| Embedding Dimension | 768 |
| Quantized by | JustEmbed |
This is a quantized ONNX export of LEGAL-BERT, a BERT model pre-trained on 12GB of diverse legal text including EU legislation, UK legislation, European Court of Justice cases, and US court cases and contracts. The INT8 quantization reduces model size and improves inference speed while maintaining high accuracy for legal domain embeddings.
model_quantized.onnx — INT8 quantized ONNX modeltokenizer.json — Fast tokenizervocab.txt — Vocabulary fileconfig.json — Model configurationfrom justembed import Embedder
embedder = Embedder("legalbert-int8")
vectors = embedder.embed(["breach of fiduciary duty"])
import onnxruntime as ort
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(".")
session = ort.InferenceSession("model_quantized.onnx")
inputs = tokenizer("breach of fiduciary duty", return_tensors="np")
outputs = session.run(None, dict(inputs))
This model is a derivative work of nlpaueb/legal-bert-base-uncased.
The original model is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). This quantized version is distributed under the same license as required by the ShareAlike clause. See the LICENSE file for details.
@inproceedings{chalkidis2020legal,
title={LEGAL-BERT: The Muppets straight out of Law School},
author={Chalkidis, Ilias and Fergadiotis, Manos and Malakasiotis, Prodromos and Aletras, Nikolaos and Androutsopoulos, Ion},
booktitle={Findings of EMNLP},
year={2020}
}