/ Модель

Характеристики

Контекст
8 194 токена
Параметры
659 млн
Архитектура
xlm-roberta · dense
Базовая модель
bge-m3
Библиотека
transformers
Опубликована
23 мар 2025

legal-bge-m3

Сходство предложенийТекст → score5 профессий

Дообученная на синтетических юридических данных модель эмбеддингов BGE-M3 для семантического поиска и извлечения фрагментов документов в RAG.

118скачиваний за 30 дней1лайквеса обновлены23 мар 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Эмбеддинги» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

legal-bge-m3 — модель эмбеддингов на базе BGE-M3, разработанная Yuriy Perezhohin для поиска по юридическим текстам. Она преобразует документы, их фрагменты, предложения и запросы в плотные векторные представления для семантического поиска, сравнения предложений и извлечения релевантных фрагментов в системах RAG.

Модель дообучена с помощью функции потерь multiple negative ranking на примерно 400 тысячах строк синтетических юридических данных, подготовленных на основе LEGALBENCH-RAG. В метаданных указаны архитектура XLM-RoBERTa, 658,7 млн параметров, контекст до 8194 токенов и английский язык. Базовая модель BGE-M3 рассчитана на многоязычный семантический, лексический и гибридный поиск, однако карточка этой версии заявляет английский язык.

Модель подходит для поиска релевантных фрагментов юридических документов и вычисления сходства текстов. Ограничение — обучение на синтетических данных, поэтому возможны унаследованные от них смещения. Сведения о лицензии в предоставленных источниках отсутствуют.

Сценарии применения

  • поиск релевантных фрагментов в юридических документах
  • семантический поиск по базе правовых текстов
  • ранжирование документов по соответствию юридическому запросу
  • поиск похожих предложений в правовых текстах
  • подбор контекстных фрагментов для юридической RAG-системы

Ограничения

Модель обучалась на синтетических данных, поэтому может наследовать их смещения. Карточка указывает английский язык; качество на других языках не подтверждено.

Для каких профессий подходит5

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

legal-bge-m3

BGE-m3 is a domain-specific text embedding model tailored for legal applications. It converts legal documents, sentences, and queries into dense vector representations that capture nuanced semantic relationships in legal language.

Details

Training Approach: The model was fine-tuned using a multiple negative ranking loss strategy. This approach helps the model distinguish between relevant (positive) and irrelevant (negative) passages effectively. The dataset consists of roughly 400k rows of synthetically generated legal data (derived from the LEGALBENCH-RAG dataset). The dataset, along with details about its construction, will be available soon. Each document chunk was paired with one positive (golden) chunks and three generated positive and negative passages. The LLama3.18B Instruct model was used for builduing synthetic training data.

  • Developed by: [Yuriy Perezhohin]
  • Model type: [sentence-transformers]
  • Language(s) (NLP): [English]
  • Finetuned from model [optional]: [sentence-transformers/multi-qa-mpnet-base-cos-v1]

Uses

The intention of this fine-tuning is to create a model capable of retrieving correct chunks for RAG applications. Can be used for semantic search or sentence similarity

Usage Sentence-Transformers

from sentence_transformers import SentenceTransformer, util

query = "How many people live in London?"
docs = ["What is the legal status of the parties to this Distributor Agreement, as stated in the introductory paragraph ?", 
"The legal status of parties do not have anything to do with this contract.",
"EXHIBIT 10.6\n\n                              DISTRIBUTOR AGREEMENT\n\n         THIS  DISTRIBUTOR  AGREEMENT (the  \"Agreement\")  is made by and between Electric City Corp.,  a Delaware  corporation  (\"Company\")  and Electric City of Illinois LLC (\"Distributor\") this 7th day of September, 1999.\n\n                                    RECITALS\n\n         A. The  Company's  Business.  The Company is  presently  engaged in the business  of selling an energy  efficiency  device,  which is  referred to as an \Energy  Saver\  which may be improved  or  otherwise  changed  from its present composition (the \"Products\").  The Company may engage in the business of selling other  products  or  other  devices  other  than  the  Products,  which  will be considered  Products if Distributor  exercises its options pursuant to Section 7 hereof.\n\n         B. Representations.  As an inducement to the Company to enter into this Agreement,  the  Distributor  has  represented  that  it has or  will  have  the facilities,  personnel,  and financial capability to promote the sale and use of Products.  As an  inducement  to  Distributor  to enter into this  Agreement the Company has  represented  that it has the  facilities,  personnel  and financial capability to have the Products  produced and supplied as needed pursuant to the terms hereof.\n\n         C. The Distributor's  Objectives.  The Distributor  desires to become a distributor  for the Company and to develop  demand for and sell and  distribute Products  solely  for the use within the State of  Illinois,  including  but not limited to public  and  private  entities,  institutions,  corporations,  public schools, park districts,  corrections facilities,  airports,  government housing authorities and other government agencies and facilities (the \"Market\").\n\n         D. The Company's  Appointment.  The Company appoints the Distributor as an  exclusive  distributor  of Products in the Market,  subject to the terms and conditions of this Agreement"]

#Load the model
model = SentenceTransformer('yuriyvnv/legal-bge-m3')

#Encode query and documents
query_emb = model.encode(query)
doc_emb = model.encode(docs)

#Compute cosine similarity between query and all document embeddings
scores = util.cos_sim(query_emb, doc_emb)[0].cpu().tolist()

#Combine docs & scores
doc_score_pairs = list(zip(docs, scores))

#Sort by decreasing score
doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)

#Output passages & scores
for doc, score in doc_score_pairs:
    print(score, doc)

Bias, Risks, and Limitations

The model was fine-tuned on synthetic data, from the probabilistic nature of LLM's, the model could have inherited some potential bias, although not know for the autor.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
XLMRobertaModel
Ревизия весов
4f52c3b

0 моделей