Downloads · 30 days
4
6% of all-time downloads
sailu4/legal-request-classification-nlp-model
legal-request-classification-nlp-model is a machine learning model from sailu4. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a fine-tuned DistilBERT model for classifying legal-related text into predefined categories.
Downloads · 30 days
4
6% of all-time downloads
All-time downloads
64
Public
Parameters
65.8M
263 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors263 MB · 100%
From the Hugging Face model README
This model is a fine-tuned DistilBERT model for classifying legal-related text into predefined categories.
Dataset: jonathanli/law-stack-exchange
Preprocessing:
Framework: Hugging Face Transformers
Training: Trainer API
Mixed precision (FP16)
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_name = "sailu4/legal-request-classification-nlp-model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
from transformers import pipeline
classifier = pipeline(
"text-classification",
model=model_name
)
classifier("I need help with employment law")
[
{
"label": "employment",
"score": 0.96
}
]
label: predicted classscore: confidence levelBadr Joulali
https://github.com/BADR-JOULALI/legal-request-classification-nlp