/ Модель

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

Контекст
8 194 токена
Параметры
659 млн
Лицензия
Apache 2.0
Архитектура
xlm-roberta · dense
Базовая модель
bge-m3
Библиотека
sentence-transformers
Опубликована
22 июн 2024

bge-m3-financial-matryoshka

ЭмбеддингиТекст → embedding5 профессий

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

226скачиваний за 30 дней1лайквеса обновлены9 июл 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

haophancs/bge-m3-financial-matryoshka — англоязычная модель Sentence Transformers, дообученная на базе BAAI/bge-m3 для сравнения предложений и поиска по финансовым текстам. Она преобразует предложения и абзацы в нормализованные плотные векторы для вычисления косинусного сходства; архитектура включает XLM-RoBERTa, пулинг по CLS-токену и нормализацию. Размер модели — 658,7 млн параметров, максимальная длина последовательности — 8192 токена. Обучение на 6300 парах запросов и релевантных фрагментов использует MatryoshkaLoss и поддерживает векторы размерности 1024, 768, 512 и 384.

Модель подходит для семантического поиска финансовых сведений, оценки сходства и перефразирования, кластеризации и классификации текста. В README приведены метрики поиска по нескольким размерностям векторов, однако название и примеры датасета указывают на финансовое назначение, а результаты нельзя автоматически переносить на другие наборы данных или языки. Указана лицензия Apache-2.0.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

BGE-M3 Financial Matryoshka

This is a sentence-transformers model finetuned from BAAI/bge-m3. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: BAAI/bge-m3
  • Maximum Sequence Length: 8192 tokens
  • Output Dimensionality: 1024 tokens
  • Similarity Function: Cosine Similarity
  • Language: en
  • License: apache-2.0

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: XLMRobertaModel 
  (1): Pooling({'word_embedding_dimension': 1024, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
  (2): Normalize()
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("haophancs/bge-m3-financial-matryoshka")
# Run inference
sentences = [
    'As of January 28, 2024 the net carrying value of our inventories was $1.3 billion, which included provisions for obsolete and damaged inventory of $139.7 million.',
    "What is the status of the company's inventory as of January 28, 2024, in terms of its valuation and provisions for obsolescence?",
    'What is the relationship between the ESG goals and the long-term growth strategy?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 1024]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Evaluation

Metrics

Information Retrieval

MetricValue
cosine_accuracy@10.7171
cosine_accuracy@30.8314
cosine_accuracy@50.87
cosine_accuracy@100.9143
cosine_precision@10.7171
cosine_precision@30.2771
cosine_precision@50.174
cosine_precision@100.0914
cosine_recall@10.7171
cosine_recall@30.8314
cosine_recall@50.87
cosine_recall@100.9143
cosine_ndcg@100.8152
cosine_mrr@100.7836
cosine_map@1000.7867

Information Retrieval

MetricValue
cosine_accuracy@10.7129
cosine_accuracy@30.8343
cosine_accuracy@50.8657
cosine_accuracy@100.91
cosine_precision@10.7129
cosine_precision@30.2781
cosine_precision@50.1731
cosine_precision@100.091
cosine_recall@10.7129
cosine_recall@30.8343
cosine_recall@50.8657
cosine_recall@100.91
cosine_ndcg@100.8122
cosine_mrr@100.7809
cosine_map@1000.7843

Information Retrieval

MetricValue
cosine_accuracy@10.7114
cosine_accuracy@30.8357
cosine_accuracy@50.8643
cosine_accuracy@100.91
cosine_precision@10.7114
cosine_precision@30.2786
cosine_precision@50.1729
cosine_precision@100.091
cosine_recall@10.7114
cosine_recall@30.8357
cosine_recall@50.8643
cosine_recall@100.91
cosine_ndcg@100.811
cosine_mrr@100.7793
cosine_map@1000.7827

Information Retrieval

MetricValue
cosine_accuracy@10.7143
cosine_accuracy@30.8329
cosine_accuracy@50.8629
cosine_accuracy@100.9129
cosine_precision@10.7143
cosine_precision@30.2776
cosine_precision@50.1726
cosine_precision@100.0913
cosine_recall@10.7143
cosine_recall@30.8329
cosine_recall@50.8629
cosine_recall@100.9129
cosine_ndcg@100.8126
cosine_mrr@100.7806
cosine_map@1000.7838

Training Details

Training Dataset

Unnamed Dataset

  • Size: 6,300 training samples
  • Columns: positive and anchor
  • Approximate statistics based on the first 1000 samples:
    positiveanchor
    typestringstring
    detailsmin: 11 tokensmean: 51.97 tokensmax: 1146 tokensmin: 7 tokensmean: 21.63 tokensmax: 47 tokens
  • Samples:
    positiveanchor
    From fiscal year 2022 to 2023, the cost of revenue as a percentage of total net revenue decreased by 3 percent.What was the percentage change in cost of revenue as a percentage of total net revenue from fiscal year 2022 to 2023?
    •Operating income increased $321 million, or 2%, to $18.1 billion versus year ago due to the increase in net sales, partially offset by a modest decrease in operating margin.What factors contributed to the increase in operating income for Procter & Gamble in 2023?
    market specific brands including 'Aurrera,' 'Lider,' and 'PhonePe.'What specific brands does Walmart International market?
  • Loss: MatryoshkaLoss with these parameters:
    {
        "loss": "MultipleNegativesRankingLoss",
        "matryoshka_dims": [
            1024,
            768,
            512,
            384
        ],
        "matryoshka_weights": [
            1,
            1,
            1,
            1
        ],
        "n_dims_per_step": -1
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: epoch
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 2
  • gradient_accumulation_steps: 2
  • learning_rate: 2e-05
  • num_train_epochs: 4
  • lr_scheduler_type: cosine
  • warmup_ratio: 0.1
  • bf16: True
  • tf32: True
  • load_best_model_at_end: True
  • optim: adamw_torch_fused
  • batch_sampler: no_duplicates

All Hyperparameters

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: epoch
  • prediction_loss_only: True
  • per_device_train_batch_size: 4
  • per_device_eval_batch_size: 2
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 2
  • eval_accumulation_steps: None
  • learning_rate: 2e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 4
  • max_steps: -1
  • lr_scheduler_type: cosine
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.1
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • use_ipex: False
  • bf16: True
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: True
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: True
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamw_torch_fused
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: False
  • hub_always_push: False
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • dispatch_batches: None
  • split_batches: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: False
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional

Training Logs

EpochStepTraining Lossdim_1024_cosine_map@100dim_384_cosine_map@100dim_512_cosine_map@100dim_768_cosine_map@100
0.0127100.2059----
0.0254200.2612----
0.0381300.0873----
0.0508400.1352----
0.0635500.156----
0.0762600.0407----
0.0889700.09----
0.1016800.027----
0.1143900.0978----
0.12701000.0105----
0.13971100.0402----
0.15241200.0745----
0.16511300.0655----
0.17781400.0075----
0.19051500.0141----
0.20321600.0615----
0.21591700.0029----
0.22861800.0269----
0.24131900.0724----
0.25402000.0218----
0.26672100.0027----
0.27942200.007----
0.29212300.0814----
0.30482400.0326----
0.31752500.0061----
0.33022600.0471----
0.34292700.0115----
0.35562800.0021----
0.36832900.0975----
0.38103000.0572----
0.39373100.0125----
0.40633200.04----
0.41903300.0023----
0.43173400.0121----
0.44443500.0116----
0.45713600.0059----
0.46983700.0217----
0.48253800.0294----
0.49523900.1102----
0.50794000.0103----
0.52064100.0023----
0.53334200.0157----
0.54604300.0805----
0.55874400.0168----
0.57144500.1279----
0.58414600.2012----
0.59684700.0436----
0.60954800.0204----
0.62224900.0097----
0.63495000.0013----
0.64765100.0042----
0.66035200.0034----
0.67305300.0226----
0.68575400.0267----
0.69845500.0007----
0.71115600.0766----
0.72385700.2174----
0.73655800.0089----
0.74925900.0794----
0.76196000.0031----
0.77466100.0499----
0.78736200.0105----
0.86300.0097----
0.81276400.0028----
0.82546500.0029----
0.83816600.1811----
0.85086700.064----
0.86356800.0139----
0.87626900.055----
0.88897000.0013----
0.90167100.0402----
0.91437200.0824----
0.92707300.03----
0.93977400.0337----
0.95247500.1192----
0.96517600.0039----
0.97787700.004----
0.99057800.1413----
0.9994787-0.78510.77940.78220.7863
1.00327900.019----
1.01598000.0587----
1.02868100.0186----
1.04138200.0018----
1.05408300.0631----
1.06678400.0127----
1.07948500.0037----
1.09218600.0029----
1.10488700.1437----
1.11758800.0015----
1.13028900.0024----
1.14299000.0133----
1.15569100.0245----
1.16839200.0017----
1.18109300.0007----
1.19379400.002----
1.20639500.0044----
1.21909600.0009----
1.23179700.01----
1.24449800.0026----
1.25719900.0017----
1.269810000.0014----
1.282510100.0009----
1.295210200.0829----
1.307910300.0011----
1.320610400.012----
1.333310500.0019----
1.346010600.0007----
1.358710700.0141----
1.371410800.0003----
1.384110900.001----
1.396811000.0005----
1.409511100.0031----
1.422211200.0004----
1.434911300.0054----
1.447611400.0003----
1.460311500.0007----
1.473011600.0009----
1.485711700.001----
1.498411800.0006----
1.511111900.0046----
1.523812000.0003----
1.536512100.0002----
1.549212200.004----
1.561912300.0017----
1.574612400.0003----
1.587312500.0027----
1.612600.1134----
1.612712700.0007----
1.625412800.0005----
1.638112900.0008----
1.650813000.0001----
1.663513100.0023----
1.676213200.0005----
1.688913300.0004----
1.701613400.0003----
1.714313500.0347----
1.727013600.0339----
1.739713700.0003----
1.752413800.0005----
1.765113900.0002----
1.777814000.0031----
1.790514100.0002----
1.803214200.0012----
1.815914300.0002----
1.828614400.0002----
1.841314500.0004----
1.854014600.011----
1.866714700.0824----
1.879414800.0003----
1.892114900.0004----
1.904815000.0006----
1.917515100.015----
1.930215200.0004----
1.942915300.0004----
1.955615400.0011----
1.968315500.0003----
1.981015600.0006----
1.993715700.0042----
2.01575-0.78620.78550.78520.7878
2.006315800.0005----
2.019015900.002----
2.031716000.0013----
2.044416100.0002----
2.057116200.0035----
2.069816300.0004----
2.082516400.0002----
2.095216500.0032----
2.107916600.0916----
2.120616700.0002----
2.133316800.0006----
2.146016900.0002----
2.158717000.0003----
2.171417100.0001----
2.184117200.0001----
2.196817300.0004----
2.209517400.0004----
2.222217500.0001----
2.234917600.0002----
2.247617700.0007----
2.260317800.0001----
2.273017900.0002----
2.285718000.0004----
2.298418100.0711----
2.311118200.0001----
2.323818300.0005----
2.336518400.0004----
2.349218500.0001----
2.361918600.0005----
2.374618700.0003----
2.387318800.0001----
2.418900.0002----
2.412719000.0001----
2.425419100.0002----
2.438119200.0002----
2.450819300.0002----
2.463519400.0004----
2.476219500.0001----
2.488919600.0002----
2.501619700.0002----
2.514319800.0001----
2.527019900.0001----
2.539720000.0002----
2.552420100.0023----
2.565120200.0002----
2.577820300.0001----
2.590520400.0003----
2.603220500.0003----
2.615920600.0002----
2.628620700.0001----
2.641320800.0----
2.654020900.0001----
2.666721000.0001----
2.679421100.0001----
2.692121200.0001----
2.704821300.0001----
2.717521400.0048----
2.730221500.0005----
2.742921600.0001----
2.755621700.0001----
2.768321800.0001----
2.781021900.0001----
2.793722000.0001----
2.806322100.0001----
2.819022200.0001----
2.831722300.0002----
2.844422400.0036----
2.857122500.0001----
2.869822600.0368----
2.882522700.0003----
2.895222800.0002----
2.907922900.0001----
2.920623000.0005----
2.933323100.0001----
2.946023200.0001----
2.958723300.0003----
2.971423400.0001----
2.984123500.0001----
2.996823600.0002----
2.99942362-0.78640.78050.78380.7852
3.009523700.0025----
3.022223800.0002----
3.034923900.0001----
3.047624000.0001----
3.060324100.0001----
3.073024200.0001----
3.085724300.0001----
3.098424400.0002----
3.111124500.0116----
3.123824600.0002----
3.136524700.0001----
3.149224800.0001----
3.161924900.0001----
3.174625000.0001----
3.187325100.0001----
3.225200.0001----
3.212725300.0001----
3.225425400.0001----
3.238125500.0002----
3.250825600.0001----
3.263525700.0001----
3.276225800.0001----
3.288925900.0001----
3.301626000.063----
3.314326100.0001----
3.327026200.0001----
3.339726300.0001----
3.352426400.0001----
3.365126500.0002----
3.377826600.0001----
3.390526700.0001----
3.403226800.0001----
3.415926900.0001----
3.428627000.0001----
3.441327100.0001----
3.454027200.0002----
3.466727300.0001----
3.479427400.0001----
3.492127500.0001----
3.504827600.0001----
3.517527700.0002----
3.530227800.0001----
3.542927900.0001----
3.555628000.0001----
3.568328100.0001----
3.581028200.0001----
3.593728300.0001----
3.606328400.0001----
3.619028500.0----
3.631728600.0001----
3.644428700.0001----
3.657128800.0001----
3.669828900.0001----
3.682529000.0001----
3.695229100.0001----
3.707929200.0001----
3.720629300.0003----
3.733329400.0001----
3.746029500.0001----
3.758729600.0001----
3.771429700.0002----
3.784129800.0001----
3.796829900.0001----
3.809530000.0001----
3.822230100.0001----
3.834930200.0002----
3.847630300.0001----
3.860330400.0001----
3.873030500.0214----
3.885730600.0001----
3.898430700.0001----
3.911130800.0001----
3.923830900.0001----
3.936531000.0001----
3.949231100.0001----
3.961931200.0001----
3.974631300.0001----
3.987331400.0001----
3.99753148-0.78670.78380.78270.7843
  • The bold row denotes the saved checkpoint.

Framework Versions

  • Python: 3.12.2
  • Sentence Transformers: 3.0.1
  • Transformers: 4.41.2
  • PyTorch: 2.2.0+cu121
  • Accelerate: 0.31.0
  • Datasets: 2.19.1
  • Tokenizers: 0.19.1

Citation

BibTeX

Sentence Transformers

@inproceedings{reimers-2019-sentence-bert,
    title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month = "11",
    year = "2019",
    publisher = "Association for Computational Linguistics",
    url = "https://arxiv.org/abs/1908.10084",
}

MatryoshkaLoss

@misc{kusupati2024matryoshka,
    title={Matryoshka Representation Learning}, 
    author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
    year={2024},
    eprint={2205.13147},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

MultipleNegativesRankingLoss

@misc{henderson2017efficient,
    title={Efficient Natural Language Response Suggestion for Smart Reply}, 
    author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
    year={2017},
    eprint={1705.00652},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей