Quintu/bge-m3-legal_retrieval
This repository contains the Quintu/bge-m3-legal_retrieval, a fine-tuned version of the bge-m3 model optimized for legal document retrieval tasks. The model is specifically designed to handle the nuances of legal language, enabling accurate and efficient retrieval of relevant legal documents based on semantic similarity.
Model Details
- Base Model: bge-m3
- Task: Legal Document Retrieval
- Fine-tuning Dataset: Legal documents and associated queries from real-world legal scenarios.
- Framework: Sentence-Transformers
Key Features
- Legal Language Understanding: Optimized to understand legal terms, context, and phrases.
- Semantic Search: Retrieves documents based on meaning, not just keywords.
- High Precision Retrieval: Tailored for legal professionals and researchers.
How to Use
Load the Model
You can easily load and use the model with the SentenceTransformer
library:
from sentence_transformers import SentenceTransformer
# Load the fine-tuned model
model_tuned = SentenceTransformer("Quintu/bge-m3-legal_retrieval")
# Example usage: Encode queries and documents
queries = ["What are the key legal precedents for intellectual property disputes?"]
documents = [
"This document discusses key precedents in intellectual property law.",
"This document covers legal principles in criminal law."
]
# Encode the queries and documents
query_embeddings = model_tuned.encode(queries)
document_embeddings = model_tuned.encode(documents)
# Compute similarity (example with cosine similarity)
from sklearn.metrics.pairwise import cosine_similarity
similarity_scores = cosine_similarity(query_embeddings, document_embeddings)
# Output similarity scores
print(similarity_scores)
- Downloads last month
- 8
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.