ybWw/bge-base-financial-matryoshka-dataset_v1_chinadatapay
SentenceTransformer
This is a sentence-transformers model trained on the json dataset. 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: Unknown -->
- Maximum Sequence Length: 512 tokens
- Output Dimensionality: 768 tokens
- Similarity Function: Cosine Similarity
- Training Dataset:
- json <!-- - Language: Unknown --> <!-- - License: Unknown -->
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
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-transformersThen you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("ybWw/bge-base-financial-matryoshka-dataset_v1_chinadatapay")
# Run inference
sentences = [
'它可以在手机解锁系统中使用,以确保只有真实的用户才能进入设备。活体检测可以应用于人脸支付领域,为用户提供更加安全和便捷的交易方式。在线视频会议和语音聊天等应用中,活体检测也可以验证用户身份,并防止冒充或欺诈行为的发生。另外,一些银行、金融机构以及政府机关等领域也利用活体检测技术来加强身份认证的可靠性和准确性。安卓活体检测在各个领域都具有广泛且重要的应用价值。',
'活体检测有哪些应用场景?',
'需要注意哪些因素在使用人像比对api时?',
]
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]<!--
Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details> -->
<!--
Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details> -->
<!--
Out-of-Scope Use
List how the model may foreseeably be misused and address what users ought not to do with the model. -->
Evaluation
Metrics
Information Retrieval
- Dataset:
dim_768 - Evaluated with <code>InformationRetrievalEvaluator</code>
Information Retrieval
- Dataset:
dim_512 - Evaluated with <code>InformationRetrievalEvaluator</code>
Information Retrieval
- Dataset:
dim_256 - Evaluated with <code>InformationRetrievalEvaluator</code>
Information Retrieval
- Dataset:
dim_128 - Evaluated with <code>InformationRetrievalEvaluator</code>
Information Retrieval
- Dataset:
dim_64 - Evaluated with <code>InformationRetrievalEvaluator</code>
<!--
Bias, Risks and Limitations
What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->
<!--
Recommendations
What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->
Training Details
Training Dataset
json
- Dataset: json
- Size: 2,709 training samples
- Columns: <code>positive</code> and <code>anchor</code>
- Approximate statistics based on the first 1000 samples: | | positive | anchor | |:--------|:-------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------| | type | string | string | | details | <ul><li>min: 12 tokens</li><li>mean: 296.04 tokens</li><li>max: 512 tokens</li></ul> | <ul><li>min: 8 tokens</li><li>mean: 20.47 tokens</li><li>max: 43 tokens</li></ul> |
- Samples: | positive | anchor | |:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------| | <code>在Android开发过程中,可以通过以下步骤集成和使用人脸识别活体检测API:<br>1、需要将相关的人脸识别活体检测库添加到项目的依赖中。这些库可以从第三方提供商或者开源社区获取。<br>2、在代码中引入相应的类和方法来进行人脸识别活体检测功能的调用。通常情况下,这些类和方法会提供一系列接口用于初始化、启动摄像头、捕捉图像,并返回检测结果。<br>3、在使用之前,请确保已经申请并获取了必要的权限,比如访问相机和存储设备等权限。<br>4、创建一个预览界面来展示实时视频流,并通过调用上述引入的类及其方法,在界面上显示摄像头捕捉到的图像内容。<br>5、调整设置参数以满足特定需求,例如设置最小可靠度阈值、配置活体检测算法类型等。这些参数将直接影响到人脸识别活体检测效果。<br>6、开始监听预览画面,并在每个新帧到达时进行处理。此时,可以调用相关方法对当前帧进行人脸识别与活体检测操作,并根据返回结果做出相应业务逻辑处理。<br>7、确保在使用完毕后正确释放资源,包括停止预览、释放摄像头等操作。<br>需要注意的是,在集成和使用人脸识别活体检测API时,可能会遇到一些性能和兼容性问题。为了提供更好的用户体验,请尽量优化算法、适配不同设备,并通过错误处理机制及时捕捉异常情况。同时,建议参考相关文档和示例代码以获取更详细的操作指南。</code> | <code>在Android开发过程中如何集成和使用人脸识别活体检测API?</code> | | <code>方便问一下你这边公司全称是什么吗?不方便透露全称(为什么要公司全称:我们这边是正规合法的企业,需要确定是真实的企业和真实的运用场景),如果您不方便的话留一个简称也可以的,我稍后让领导和你对接,给您发一下产品资料和报价。</code> | <code>数据库没有公司全称?</code> | | <code>要找到合适的车辆VIN核验接口供应商,你可以采取以下步骤:<br>1、市场研究:进行市场调查,了解目前有哪些车辆VIN核验接口供应商可供选择。通过搜索引擎、专业论坛和社交媒体等渠道收集相关信息。<br>2、产品质量:考虑供应商的产品质量是否符合标准。可以阅读其他用户的评价和反馈,在互联网上寻找产品质量方面的信息,并与不同供应商进行对比。<br>3、价格竞争力:价格是选择供应商时重要的考虑因素之一。比较不同供应商之间的价格差异,并注意是否提供优惠或折扣政策。<br>4、可靠性和信誉度:确保所选供应商具有良好的声誉和可靠性。可以参考客户评价、行业认证和持续合作关系等方面来判断其信誉度。<br>5、运营支持:询问潜在供应商有关售后服务、技术支持以及订单处理能力等方面的问题,以确保他们能够满足你未来可能需要的所有需求。<br>6、试用测试:向感兴趣的车辆VIN核验接口供应商提出需要接口进行测试,验证其适用性和质量。<br>您可以了解下数据宝公司。数据宝作为接口服务商,直连50+国家部委数据,接口直连国家数据库内数据,数据源覆盖全国所有车辆,实时核验,从源头保证数据合规性,非爬虫、缓存数据库,规避数据污染及合规风险。仅需输入车辆vin识别码,可输出品牌名称、发动机型号、整备质量、核定载客数、车辆型号代码等几十项相关车辆参数。还设有多个服务器防范防灾,确保接口服务稳定不间断。</code> | <code>如何找到合适的车辆vin核验接口供应商?</code> |
- Loss: <code>MatryoshkaLoss</code> 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: epochper_device_train_batch_size: 32per_device_eval_batch_size: 16gradient_accumulation_steps: 16learning_rate: 2e-05num_train_epochs: 4lr_scheduler_type: cosinewarmup_ratio: 0.1bf16: Truetf32: Trueload_best_model_at_end: Trueoptim: adamwtorchfusedbatch_sampler: no_duplicates
All Hyperparameters
<details><summary>Click to expand</summary>
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: epochprediction_loss_only: Trueper_device_train_batch_size: 32per_device_eval_batch_size: 16per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 16eval_accumulation_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 4max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Truefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Truelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamwtorchfusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Falsehub_always_push: Falsegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseeval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Nonedispatch_batches: Nonesplit_batches: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falsebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportional
</details>
Training Logs
- The bold row denotes the saved checkpoint.
Framework Versions
- Python: 3.8.20
- Sentence Transformers: 3.2.1
- Transformers: 4.41.2
- PyTorch: 2.1.2+cu121
- Accelerate: 1.0.1
- 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}
}<!--
Glossary
Clearly define terms in order to be accessible across audiences. -->
<!--
Model Card Authors
Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->
<!--
Model Card Contact
Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->
