/ Модель

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

Контекст
514 токенов
Параметры
138 млн
Лицензия
MIT
Архитектура
camembert · dense
Базовая модель
camembert-base
Библиотека
RAGatouille
Опубликована
22 дек 2023

colbertv1-camembert-base-mmarcoFR

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

Франкоязычная модель ColBERTv1 для семантического поиска и извлечения релевантных фрагментов документов по запросу.

65скачиваний за 30 дней5лайковвеса обновлены26 мар 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

colbertv1-camembert-base-mmarcoFR — модель ColBERTv1 для семантического поиска на французском языке, созданная Antoine Louis на основе camembert-base. Она кодирует запросы и фрагменты документов в матрицы векторных представлений токенов и ранжирует фрагменты по контекстному сходству с помощью MaxSim; модель предназначена для поиска по крупным коллекциям и извлечения документов для систем RAG.

Модель дообучена на французской части mMARCO — машинно переведённой версии MS MARCO. В README указаны размерность представлений 128, максимальная длина запроса 32 токена и фрагмента 256 токенов; метаданные указывают 137,8 млн параметров и нативный контекст 514 токенов. На тестовом наборе mMARCO-fr с 8,8 млн фрагментов она показала MRR@10 29,5 и R@100 80,0.

Модель рассчитана на франкоязычный поиск по текстовым запросам и коллекциям документов. Индекс коллекции из 8,8 млн фрагментов в описанной конфигурации занимает около 28 ГБ. Лицензия — MIT.

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

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

Ограничения

Индекс для коллекции масштаба mMARCO-fr (8,8 млн фрагментов) занимает около 28 ГБ в описанной конфигурации. README приводит оценку на dev-наборе mMARCO-fr, поэтому результаты могут отличаться на других корпусах и запросах.

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

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

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

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

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

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

Открыть на Hugging Face

colbertv1-camembert-base-mmarcoFR

This is a ColBERTv1 model for French that can be used for semantic search. It encodes queries and passages into matrices of token-level embeddings and efficiently finds passages that contextually match the query using scalable vector-similarity (MaxSim) operators.

Usage

Here are some examples for using the model with RAGatouille or colbert-ai.

Using RAGatouille

First, you will need to install the following libraries:

pip install -U ragatouille

Then, you can use the model like this:

from ragatouille import RAGPretrainedModel

index_name: str = "my_index" # The name of your index, i.e. the name of your vector database
documents: list = ["Ceci est un premier document.", "Voici un second document.", "etc."] # Corpus

# Step 1: Indexing.
RAG = RAGPretrainedModel.from_pretrained("antoinelouis/colbertv1-camembert-base-mmarcoFR")
RAG.index(name=index_name, collection=documents)

# Step 2: Searching.
RAG = RAGPretrainedModel.from_index(index_name) # if not already loaded
RAG.search(query="Comment effectuer une recherche avec ColBERT ?", k=10)

Using ColBERT-AI

First, you will need to install the following libraries:

pip install git+https://github.com/stanford-futuredata/ColBERT.git torch faiss-gpu==1.7.2

Then, you can use the model like this:

from colbert import Indexer, Searcher
from colbert.infra import Run, RunConfig

n_gpu: int = 1 # Set your number of available GPUs
experiment: str = "colbert" # Name of the folder where the logs and created indices will be stored
index_name: str = "my_index" # The name of your index, i.e. the name of your vector database
documents: list = ["Ceci est un premier document.", "Voici un second document.", "etc."] # Corpus

# Step 1: Indexing. This step encodes all passages into matrices, stores them on disk, and builds data structures for efficient search.
with Run().context(RunConfig(nranks=n_gpu,experiment=experiment)):
    indexer = Indexer(checkpoint="antoinelouis/colbertv1-camembert-base-mmarcoFR")
    indexer.index(name=index_name, collection=documents)

# Step 2: Searching. Given the model and index, you can issue queries over the collection to retrieve the top-k passages for each query.
with Run().context(RunConfig(nranks=n_gpu,experiment=experiment)):
    searcher = Searcher(index=index_name) # You don't need to specify checkpoint again, the model name is stored in the index.
    results = searcher.search(query="Comment effectuer une recherche avec ColBERT ?", k=10)
    # results: tuple of tuples of length k containing ((passage_id, passage_rank, passage_score), ...)

Evaluation

The model is evaluated on the smaller development set of mMARCO-fr, which consists of 6,980 queries for a corpus of 8.8M candidate passages. We report the mean reciprocal rank (MRR), normalized discounted cumulative gainand (NDCG), mean average precision (MAP), and recall at various cut-offs (R@k). Below, we compare its performance with other publicly available French ColBERT models fine-tuned on the same dataset. To see how it compares to other neural retrievers in French, check out the DécouvrIR leaderboard.

model#Param.(↓)SizeDim.IndexR@1000R@500R@100R@10MRR@10
colbertv2-camembert-L4-mmarcoFR54M0.2GB329GB91.990.381.956.732.3
FraColBERTv2111M0.4GB12828GB90.088.981.257.132.4
colbertv1-camembert-base-mmarcoFR111M0.4GB12828GB89.788.480.054.229.5

NB: Index corresponds to the size of the mMARCO-fr index (8.8M passages) on disk when using ColBERTv2's residual compression mechanism.

Training

Data

We use the French training set from the mMARCO dataset, a multilingual machine-translated version of MS MARCO that contains 8.8M passages and 539K training queries. We sample 12.8M (q, p+, p-) triples from the official ~39.8M training triples.

Implementation

The model is initialized from the camembert-base checkpoint and optimized via a combination of the pairwise softmax cross-entropy loss computed over predicted scores for the positive and hard negative passages (as in ColBERTv1) and the in-batch sampled softmax cross-entropy loss (as in ColBERTv2). It was trained on a single Tesla V100 GPU with 32GBs of memory during 200k steps using a batch size of 64 and the AdamW optimizer with a constant learning rate of 3e-06. The embedding dimension was set to 128, and the maximum sequence lengths for questions and passages length were fixed to 32 and 256 tokens, respectively.

Citation

@online{louis2024decouvrir,
	author    = 'Antoine Louis',
	title     = 'DécouvrIR: A Benchmark for Evaluating the Robustness of Information Retrieval Models in French',
	publisher = 'Hugging Face',
	month     = 'mar',
	year      = '2024',
	url       = 'https://huggingface.co/spaces/antoinelouis/decouvrir',
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
HF_ColBERT
Ревизия весов
ec36305

0 моделей