/ Модель

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

Контекст
512 токенов
Параметры
137 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Базовая модель
bge-base-en
Библиотека
sentence-transformers
Опубликована
8 июн 2024

bge-base-financial

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

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

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

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

riphunter7001x/bge-base-financial — англоязычная модель Sentence Transformers, дообученная на финансовых текстах от BAAI/bge-base-en. Она кодирует предложения и абзацы в плотные векторы размерностью 768 для семантического поиска и сравнения текстов; также подходит для поиска перефразировок, кластеризации и классификации. Архитектура основана на BERT: вектор формируется из CLS-токена, затем нормализуется. Максимальная длина входа — 512 токенов, сходство можно оценивать косинусной мерой.

Модель предназначена для поиска релевантных фрагментов в финансовых документах, например для сопоставления вопросов с выдержками из отчетности. В README приведены результаты оценки поиска для выходных размерностей от 64 до 768, однако они относятся к указанному в карточке набору данных и не гарантируют качество на других корпусах. Модель принимает текст и выдаёт эмбеддинги; генерация ответов не заявлена. Лицензия — Apache-2.0.

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

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

Ограничения

Вход ограничен 512 токенами. Качество оценки в README измерено на конкретном наборе данных и может отличаться на других финансовых корпусах.

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

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

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

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

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

Открыть на Hugging Face

BGE base Financial Matryoshka

This is a sentence-transformers model finetuned from BAAI/bge-base-en. It maps sentences & paragraphs to a 768-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-base-en
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 768 tokens
  • Similarity Function: Cosine Similarity
  • Language: en
  • License: apache-2.0

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': True}) with Transformer model: BertModel 
  (1): Pooling({'word_embedding_dimension': 768, '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("riphunter7001x/bge-base-financial")
# Run inference
sentences = [
    'The company offers Medicare eligible persons under HMO, PPO, Private Fee-For-Service, or PFFS, and Special Needs Plans, including Dual Eligible Special Needs, or D-SNP, plans in exchange for contractual payments received from CMS. With each of these products, the beneficiary receives benefits in excess of Medicare FFS, typically including reduced cost sharing, enhanced prescription drug benefits, care coordination, data analysis techniques to help identify member needs, complex case management, tools to guide members in their health care decisions, care management programs, wellness and prevention programs and, in some instances, a reduced monthly Part B premium. Most Medicare Advantage plans offer the prescription drug benefit under Part D as part of the basic plan, subject to cost sharing and other limitations.',
    'What types of Medicare plans does the company offer and what are the key benefits provided?',
    'What were the total cash discounts provided by AbbVie in 2023, 2022, and 2021?',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# 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.7029
cosine_accuracy@30.8371
cosine_accuracy@50.87
cosine_accuracy@100.9114
cosine_precision@10.7029
cosine_precision@30.279
cosine_precision@50.174
cosine_precision@100.0911
cosine_recall@10.7029
cosine_recall@30.8371
cosine_recall@50.87
cosine_recall@100.9114
cosine_ndcg@100.81
cosine_mrr@100.7773
cosine_map@1000.7807

Information Retrieval

MetricValue
cosine_accuracy@10.6943
cosine_accuracy@30.83
cosine_accuracy@50.87
cosine_accuracy@100.9129
cosine_precision@10.6943
cosine_precision@30.2767
cosine_precision@50.174
cosine_precision@100.0913
cosine_recall@10.6943
cosine_recall@30.83
cosine_recall@50.87
cosine_recall@100.9129
cosine_ndcg@100.8079
cosine_mrr@100.774
cosine_map@1000.7773

Information Retrieval

MetricValue
cosine_accuracy@10.6914
cosine_accuracy@30.8271
cosine_accuracy@50.8686
cosine_accuracy@100.9114
cosine_precision@10.6914
cosine_precision@30.2757
cosine_precision@50.1737
cosine_precision@100.0911
cosine_recall@10.6914
cosine_recall@30.8271
cosine_recall@50.8686
cosine_recall@100.9114
cosine_ndcg@100.8048
cosine_mrr@100.7705
cosine_map@1000.7738

Information Retrieval

MetricValue
cosine_accuracy@10.6814
cosine_accuracy@30.82
cosine_accuracy@50.8629
cosine_accuracy@100.91
cosine_precision@10.6814
cosine_precision@30.2733
cosine_precision@50.1726
cosine_precision@100.091
cosine_recall@10.6814
cosine_recall@30.82
cosine_recall@50.8629
cosine_recall@100.91
cosine_ndcg@100.7983
cosine_mrr@100.7624
cosine_map@1000.7654

Information Retrieval

MetricValue
cosine_accuracy@10.6629
cosine_accuracy@30.7986
cosine_accuracy@50.8414
cosine_accuracy@100.8971
cosine_precision@10.6629
cosine_precision@30.2662
cosine_precision@50.1683
cosine_precision@100.0897
cosine_recall@10.6629
cosine_recall@30.7986
cosine_recall@50.8414
cosine_recall@100.8971
cosine_ndcg@100.7802
cosine_mrr@100.7428
cosine_map@1000.7467

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: 2 tokensmean: 45.98 tokensmax: 208 tokensmin: 2 tokensmean: 20.76 tokensmax: 43 tokens
  • Samples:
    positiveanchor
    Adjusted EBITDA does not reflect costs associated with product recall related matters including adjustments to the return reserves, inventory write-downs, logistics costs associated with Member requests, the cost to move the recalled product for those that elect the option, subscription waiver costs of service, and recall-related hardware development and repair costs.What specific costs associated with product recalls are excluded from Adjusted EBITDA?
    The Company sold $17,704 million and $10,709 million of trade accounts receivables under this program during the years ended December 31, 2023 and 2022, respectively.How much did the Company sell in trade accounts receivables in the year ended December 31, 2023?
    Free cash flow less equipment finance leases and principal repayments of all other finance leases and financing obligations was -$12,786 million in 2022 and improved to $35,549 million in 2023.How did the free cash flow less equipment finance leases and principal repayments of all other finance leases and financing obligations change from 2022 to 2023?
  • Loss: MatryoshkaLoss with these parameters:
    {
        "loss": "MultipleNegativesRankingLoss",
        "matryoshka_dims": [
            768,
            512,
            256,
            128,
            64
        ],
        "matryoshka_weights": [
            1,
            1,
            1,
            1,
            1
        ],
        "n_dims_per_step": -1
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • eval_strategy: steps
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • num_train_epochs: 10
  • warmup_ratio: 0.1
  • fp16: True
  • batch_sampler: no_duplicates

All Hyperparameters

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 16
  • per_device_eval_batch_size: 16
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • learning_rate: 5e-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: 10
  • max_steps: -1
  • lr_scheduler_type: linear
  • 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: False
  • fp16: True
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • 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: False
  • 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
  • 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_128_cosine_map@100dim_256_cosine_map@100dim_512_cosine_map@100dim_64_cosine_map@100dim_768_cosine_map@100
0.25381002.42190.73200.75420.75820.69290.7561
0.50762000.4680.73430.75430.75740.70440.7569
0.76143000.31590.75690.76910.77490.72880.7713
1.01524000.3170.74550.76070.76460.71240.7643
1.26905000.20620.74650.76910.77410.72110.7748
1.52286000.10750.74950.75990.76960.72140.7697
1.77667000.10790.75720.76600.77520.72870.7764
2.03058000.04770.74470.76960.77600.72110.7786
2.28439000.05470.75690.77280.77570.74060.7746
2.538110000.02830.76680.77560.78230.74140.7841
2.791911000.02680.75400.76730.77660.74320.7748
3.045712000.02010.76330.77390.77990.74110.7775
3.299513000.01740.76350.77450.78560.74690.7851
3.553314000.01610.75950.77650.78250.74120.7782
3.807115000.00710.75520.76800.77540.73950.7739
4.060916000.0090.76330.77670.78340.74230.7843
4.314717000.00790.76390.77140.77700.74140.7728
4.568518000.01090.76620.77750.78450.73690.7843
4.822319000.00240.76740.77320.77760.74250.7810
5.076120000.00520.77290.77460.78200.74550.7849
5.329921000.00220.76150.77540.78130.74460.7862
5.583822000.00650.76910.77610.78090.74370.7777
5.837623000.00110.76720.77280.77570.74460.7772
6.091424000.00460.76710.77780.78050.74940.7838
6.345225000.00130.76550.77320.77800.74780.7806
6.599026000.00580.76730.77530.77790.75420.7797
6.852827000.0010.76540.77160.77380.75350.7776
7.106628000.00710.76840.77540.77920.75180.7824
7.360429000.0010.77230.77650.78140.75020.7826
7.614230000.00280.77200.77540.78070.74980.7806
7.868031000.00070.76850.77280.77730.74750.7816
8.121832000.0040.76900.77410.77730.74960.7806
8.375633000.00060.76830.77230.77550.74910.7791
8.629434000.00110.76780.77240.77560.75080.7804
8.883235000.00060.76550.77210.77690.74670.7825
9.137136000.00130.76740.77510.77880.74630.7802
9.390937000.00060.76640.77410.77930.74680.7821
9.644738000.00110.76620.77530.77820.74810.7803
9.898539000.00050.76540.77380.77730.74670.7807

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.0.1
  • Transformers: 4.41.2
  • PyTorch: 2.3.0+cu121
  • Accelerate: 0.31.0
  • Datasets: 2.19.2
  • 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…

Класс архитектуры
BertModel
Ревизия весов
8183a66

0 моделей