YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Legal Request Classification Model

Model Description

This model is a fine-tuned DistilBERT model for classifying legal-related text into predefined categories.


Labels

  • criminal-law
  • employment
  • tax-law
  • trademark

Training Details

  • Dataset: jonathanli/law-stack-exchange

  • Preprocessing:

    • Column cleaning
    • Label encoding
    • Tokenization
  • Framework: Hugging Face Transformers

  • Training: Trainer API

  • Mixed precision (FP16)


Performance

  • Accuracy: ~95%

Usage

Load model

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)

Inference

from transformers import pipeline

classifier = pipeline(
    "text-classification",
    model=model_name
)

classifier("I need help with employment law")

Example Output

[
  {
    "label": "employment",
    "score": 0.96
  }
]

Interpretation

  • label: predicted class
  • score: confidence level

Limitations

  • Limited dataset size
  • Class imbalance
  • Domain-specific training

Use Cases

  • Legal document classification
  • NLP experimentation
  • AI assistants

Author

Badr Joulali


Source Code

https://github.com/BADR-JOULALI/legal-request-classification-nlp

Downloads last month
10
Safetensors
Model size
65.8M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support