SentenceTransformer based on BAAI/bge-base-zh-v1.5

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

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: BAAI/bge-base-zh-v1.5
  • Maximum Sequence Length: 256 tokens
  • Output Dimensionality: 768 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'BertModel'})
  (1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'cls', '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("liudev/novel-embedding-gpl-base-v1")
# Run inference
sentences = [
    '在异能觉醒爆发时安抚对方并带走宝物',
    '宴席上有人当众示爱引发全场震惊',
    '凶暴巨兽冲破防线引发骚乱',
    '山贼讲述当年的恐惧往事,结果再次遭遇强敌被瞬杀',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [4, 768]

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

Training Details

Training Dataset

Unnamed Dataset

  • Size: 435,262 training samples
  • Columns: anchor, sentence1, sentence2, and label
  • Approximate statistics based on the first 100 samples:
    anchor sentence1 sentence2 label
    type string string string float
    modality text text text
    details
    • min: 8 tokens
    • mean: 15.5 tokens
    • max: 25 tokens
    • min: 47 tokens
    • mean: 73.19 tokens
    • max: 256 tokens
    • min: 29 tokens
    • mean: 69.23 tokens
    • max: 92 tokens
    • min: 0.02
    • mean: 0.37
    • max: 0.84
  • Samples:
    anchor sentence1 sentence2 label
    看破敌人的隐身手段 周昂在围攻强敌时敏锐察觉到异样,通过观察灵气流动识破并破除隐身法术,最终果断出手将藏匿在墙头的施法者格杀。 李破在马场以赏罚分明的手段收拢人心并大摆酒宴后,在李碧的私下召见中,意外得知其欲随军出征辽东的计划并被征询意见。 0.759356061900818
    在仓库意外得到防身宝物 柳渊在医馆仓库意外获得防御法器佛珠及攻击真言,随后通过定星罗盘锁定义务星邪,并凭借缜密的推理引导葛老与辛捕头共同前往后院枯井探查。 沈河在烂尾楼工地通过系统指引接连开启宝箱,获得了具备强控效果的“大力飞砖”与防御性的“安全员安全帽”,在确认工地无剩余宝箱后,随即根据新坐标向十公里外进发。 0.09672797019024215
    进宫面圣前,太监好心提醒忌讳规矩 宦官郭穰在权衡利弊后决定拉拢入觐的天子待诏秀才张毅,不仅对其礼遇有加,更在入宫途中悉心传授面圣禁忌与生存经验,双方达成了初步的盟友共识。 在正月初一太子加冠的重大典礼上,南风费尽心思哄劝赖床的太子完成繁琐仪式并接手庞大的东宫官僚体系,同时担忧自己微服出游时的糗事在稍后的公开亮相中被路人认出。 0.5887360227245302
  • Loss: MarginMSELoss with these parameters:
    {
        "similarity_fct": "pairwise_dot_score"
    }
    

Training Hyperparameters

Non-Default Hyperparameters

  • per_device_train_batch_size: 32
  • num_train_epochs: 150
  • learning_rate: 2e-05
  • warmup_steps: 0.02
  • fp16: True
  • push_to_hub: True
  • hub_model_id: liudev/novel-embedding-gpl-base-v1
  • hub_strategy: checkpoint
  • dataloader_num_workers: 4

All Hyperparameters

Click to expand
  • per_device_train_batch_size: 32
  • num_train_epochs: 150
  • max_steps: -1
  • learning_rate: 2e-05
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_steps: 0.02
  • optim: adamw_torch_fused
  • optim_args: None
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • optim_target_modules: None
  • gradient_accumulation_steps: 1
  • average_tokens_across_devices: True
  • max_grad_norm: 1.0
  • label_smoothing_factor: 0.0
  • bf16: False
  • fp16: True
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • use_liger_kernel: False
  • liger_kernel_config: None
  • use_cache: False
  • neftune_noise_alpha: None
  • torch_empty_cache_steps: None
  • auto_find_batch_size: False
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • include_num_input_tokens_seen: no
  • log_level: passive
  • log_level_replica: warning
  • disable_tqdm: False
  • project: huggingface
  • trackio_space_id: None
  • trackio_bucket_id: None
  • trackio_static_space_id: None
  • per_device_eval_batch_size: 8
  • prediction_loss_only: True
  • eval_on_start: False
  • eval_do_concat_batches: True
  • eval_use_gather_object: False
  • eval_accumulation_steps: None
  • include_for_metrics: []
  • batch_eval_metrics: False
  • save_only_model: False
  • save_on_each_node: False
  • enable_jit_checkpoint: False
  • push_to_hub: True
  • hub_private_repo: None
  • hub_model_id: liudev/novel-embedding-gpl-base-v1
  • hub_strategy: checkpoint
  • hub_always_push: False
  • hub_revision: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • restore_callback_states_from_checkpoint: False
  • full_determinism: False
  • seed: 42
  • data_seed: None
  • use_cpu: False
  • accelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
  • parallelism_config: None
  • dataloader_drop_last: True
  • dataloader_num_workers: 4
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • dataloader_prefetch_factor: None
  • dataloader_multiprocessing_context: None
  • dataloader_in_order: True
  • remove_unused_columns: True
  • label_names: None
  • train_sampling_strategy: random
  • length_column_name: length
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • ddp_static_graph: None
  • ddp_backend: None
  • ddp_timeout: 1800
  • fsdp: None
  • fsdp_config: None
  • deepspeed: None
  • debug: []
  • skip_memory_metrics: True
  • do_predict: False
  • resume_from_checkpoint: None
  • local_rank: -1
  • prompts: None
  • batch_sampler: batch_sampler
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}
  • warmup_ratio: None

Training Logs

Click to expand
Epoch Step Training Loss
148.5368 1010050 0.0080
148.5441 1010100 0.0075
148.5515 1010150 0.0079
148.5588 1010200 0.0074
148.5662 1010250 0.0076
148.5735 1010300 0.0079
148.5809 1010350 0.0075
148.5882 1010400 0.0075
148.5956 1010450 0.0076
148.6029 1010500 0.0074
148.6103 1010550 0.0076
148.6176 1010600 0.0077
148.625 1010650 0.0074
148.6324 1010700 0.0073
148.6397 1010750 0.0069
148.6471 1010800 0.0074
148.6544 1010850 0.0079
148.6618 1010900 0.0073
148.6691 1010950 0.0075
148.6765 1011000 0.0076
148.6838 1011050 0.0076
148.6912 1011100 0.0072
148.6985 1011150 0.0077
148.7059 1011200 0.0073
148.7132 1011250 0.0075
148.7206 1011300 0.0072
148.7279 1011350 0.0077
148.7353 1011400 0.0074
148.7426 1011450 0.0074
148.75 1011500 0.0077
148.7574 1011550 0.0075
148.7647 1011600 0.0073
148.7721 1011650 0.0075
148.7794 1011700 0.0075
148.7868 1011750 0.0077
148.7941 1011800 0.0076
148.8015 1011850 0.0074
148.8088 1011900 0.0073
148.8162 1011950 0.0075
148.8235 1012000 0.0076
148.8309 1012050 0.0073
148.8382 1012100 0.0077
148.8456 1012150 0.0074
148.8529 1012200 0.0077
148.8603 1012250 0.0078
148.8676 1012300 0.0075
148.875 1012350 0.0077
148.8824 1012400 0.0076
148.8897 1012450 0.0076
148.8971 1012500 0.0074
148.9044 1012550 0.0077
148.9118 1012600 0.0080
148.9191 1012650 0.0075
148.9265 1012700 0.0073
148.9338 1012750 0.0075
148.9412 1012800 0.0073
148.9485 1012850 0.0076
148.9559 1012900 0.0075
148.9632 1012950 0.0076
148.9706 1013000 0.0076
148.9779 1013050 0.0077
148.9853 1013100 0.0074
148.9926 1013150 0.0078
149.0 1013200 0.0077
149.0074 1013250 0.0074
149.0147 1013300 0.0072
149.0221 1013350 0.0076
149.0294 1013400 0.0077
149.0368 1013450 0.0075
149.0441 1013500 0.0073
149.0515 1013550 0.0080
149.0588 1013600 0.0076
149.0662 1013650 0.0074
149.0735 1013700 0.0072
149.0809 1013750 0.0078
149.0882 1013800 0.0076
149.0956 1013850 0.0078
149.1029 1013900 0.0072
149.1103 1013950 0.0078
149.1176 1014000 0.0080
149.125 1014050 0.0079
149.1324 1014100 0.0074
149.1397 1014150 0.0072
149.1471 1014200 0.0078
149.1544 1014250 0.0079
149.1618 1014300 0.0075
149.1691 1014350 0.0079
149.1765 1014400 0.0079
149.1838 1014450 0.0073
149.1912 1014500 0.0077
149.1985 1014550 0.0075
149.2059 1014600 0.0075
149.2132 1014650 0.0076
149.2206 1014700 0.0076
149.2279 1014750 0.0074
149.2353 1014800 0.0074
149.2426 1014850 0.0078
149.25 1014900 0.0079
149.2574 1014950 0.0075
149.2647 1015000 0.0074
149.2721 1015050 0.0074
149.2794 1015100 0.0077
149.2868 1015150 0.0079
149.2941 1015200 0.0076
149.3015 1015250 0.0070
149.3088 1015300 0.0074
149.3162 1015350 0.0076
149.3235 1015400 0.0074
149.3309 1015450 0.0075
149.3382 1015500 0.0078
149.3456 1015550 0.0077
149.3529 1015600 0.0080
149.3603 1015650 0.0077
149.3676 1015700 0.0073
149.375 1015750 0.0074
149.3824 1015800 0.0077
149.3897 1015850 0.0079
149.3971 1015900 0.0074
149.4044 1015950 0.0075
149.4118 1016000 0.0074
149.4191 1016050 0.0077
149.4265 1016100 0.0078
149.4338 1016150 0.0073
149.4412 1016200 0.0072
149.4485 1016250 0.0075
149.4559 1016300 0.0078
149.4632 1016350 0.0077
149.4706 1016400 0.0077
149.4779 1016450 0.0074
149.4853 1016500 0.0077
149.4926 1016550 0.0076
149.5 1016600 0.0076
149.5074 1016650 0.0081
149.5147 1016700 0.0075
149.5221 1016750 0.0076
149.5294 1016800 0.0074
149.5368 1016850 0.0079
149.5441 1016900 0.0073
149.5515 1016950 0.0076
149.5588 1017000 0.0076
149.5662 1017050 0.0077
149.5735 1017100 0.0080
149.5809 1017150 0.0076
149.5882 1017200 0.0077
149.5956 1017250 0.0076
149.6029 1017300 0.0075
149.6103 1017350 0.0077
149.6176 1017400 0.0077
149.625 1017450 0.0071
149.6324 1017500 0.0078
149.6397 1017550 0.0077
149.6471 1017600 0.0075
149.6544 1017650 0.0071
149.6618 1017700 0.0074
149.6691 1017750 0.0076
149.6765 1017800 0.0078
149.6838 1017850 0.0076
149.6912 1017900 0.0076
149.6985 1017950 0.0075
149.7059 1018000 0.0074
149.7132 1018050 0.0079
149.7206 1018100 0.0075
149.7279 1018150 0.0078
149.7353 1018200 0.0075
149.7426 1018250 0.0073
149.75 1018300 0.0076
149.7574 1018350 0.0073
149.7647 1018400 0.0077
149.7721 1018450 0.0074
149.7794 1018500 0.0073
149.7868 1018550 0.0076
149.7941 1018600 0.0074
149.8015 1018650 0.0078
149.8088 1018700 0.0073
149.8162 1018750 0.0077
149.8235 1018800 0.0072
149.8309 1018850 0.0079
149.8382 1018900 0.0076
149.8456 1018950 0.0072
149.8529 1019000 0.0074
149.8603 1019050 0.0077
149.8676 1019100 0.0074
149.875 1019150 0.0076
149.8824 1019200 0.0078
149.8897 1019250 0.0075
149.8971 1019300 0.0070
149.9044 1019350 0.0075
149.9118 1019400 0.0076
149.9191 1019450 0.0075
149.9265 1019500 0.0074
149.9338 1019550 0.0072
149.9412 1019600 0.0080
149.9485 1019650 0.0073
149.9559 1019700 0.0077
149.9632 1019750 0.0075
149.9706 1019800 0.0078
149.9779 1019850 0.0075
149.9853 1019900 0.0077
149.9926 1019950 0.0074
150.0 1020000 0.0076

Training Time

  • Training: 1.4 hours

Framework Versions

  • Python: 3.13.15
  • Sentence Transformers: 5.7.0
  • Transformers: 5.16.1
  • PyTorch: 2.11.0+cu128
  • Accelerate: 1.14.0
  • Datasets: 4.8.5
  • Tokenizers: 0.23.1

Additional Resources

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",
}

MarginMSELoss

@misc{hofstätter2021improving,
    title={Improving Efficient Neural Ranking Models with Cross-Architecture Knowledge Distillation},
    author={Sebastian Hofstätter and Sophia Althammer and Michael Schröder and Mete Sertkan and Allan Hanbury},
    year={2021},
    eprint={2010.02666},
    archivePrefix={arXiv},
    primaryClass={cs.IR}
}
Downloads last month
269
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for liudev/novel-embedding-gpl-base-v1

Finetuned
(8)
this model
Finetunes
1 model

Papers for liudev/novel-embedding-gpl-base-v1