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
model_tuned = SentenceTransformer("Quintu/bge-m3-legal_retrieval")
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."
]
query_embeddings = model_tuned.encode(queries)
document_embeddings = model_tuned.encode(documents)
from sklearn.metrics.pairwise import cosine_similarity
similarity_scores = cosine_similarity(query_embeddings, document_embeddings)
print(similarity_scores)