CoolFace
Modelpublic

johnyy212/moe-girl-v3

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes70downloads
Model Card

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

This is a sentence-transformers model finetuned from BAAI/bge-small-zh-v1.5 on the json dataset. It maps sentences & paragraphs to a 512-dimensional dense vector space and can be used for retrieval.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: BAAI/bge-small-zh-v1.5 <!-- at revision 7999e1d3359715c523056ef9478215996d62a620 -->
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 512 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modality: Text
  • Training Dataset:
  • json <!-- - Language: Unknown --> <!-- - License: Unknown -->

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': 512, 'pooling_mode': 'cls', 'include_prompt': True})
  (2): Normalize({})
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("johnyy212/moe-girl-v3")
# Run inference
sentences = [
    '御姐、长短袜、下乳、长靴、红瞳',
    '角色:少女前线:PTRD\n本名:PTRD41反坦克步枪\n别名:卤蛋、南半球\n声优:清水爱\n萌点:长发、巨乳、黑丝、御姐、下乳、呆毛、哥萨克帽\n发色:亚麻\n瞳色:红',
    '少女前线:PTRD',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 512]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[ 1.0000,  0.5500, -0.1585],
#         [ 0.5500,  1.0000, -0.1041],
#         [-0.1585, -0.1041,  1.0000]])

<!--

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. -->

<!--

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: 58,482 training samples
  • Columns: <code>anchor</code>, <code>positive</code>, and <code>char_name</code>
  • Approximate statistics based on the first 1000 samples: | | anchor | positive | char_name | |:--------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 3 tokens</li><li>mean: 11.96 tokens</li><li>max: 36 tokens</li></ul> | <ul><li>min: 13 tokens</li><li>mean: 77.78 tokens</li><li>max: 478 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 7.23 tokens</li><li>max: 23 tokens</li></ul> |
  • Samples: | anchor | positive | char_name | |:---------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------| | <code>杀手、吐槽、红发、混血儿</code> | <code>角色:风吹雪<br>本名:风吹雪<br>别名:雪妹、花、天意之花<br>年龄:16<br>瞳色:棕<br>发色:红<br>血型:O<br>萌点:长直、傲娇、女神系、吐槽、妹妹、裹胸布</code> | <code>风吹雪</code> | | <code>黑发、百合、高中生、半马尾、黑色连裤袜</code> | <code>角色:高远凛<br>本名:高远、凛<br>别名:凛、Rin<br>声优:长妻树里<br>生日:10月10日<br>瞳色:棕<br>发色:黑<br>三围:85、60、86<br>萌点:高中生、短发、穿越者、百合、黑丝、半马尾</code> | <code>高远凛</code> | | <code>小野凉子、北见六花</code> | <code>角色:世计丸<br>本名:世计、丸<br>声优:北见六花配音角色、小野凉子配音角色<br>发色:紫<br>瞳色:紫<br>三围:90、58、81<br>生日:12月1日<br>星座:射手<br>萌点:过膝袜、长发、下双马尾、毒舌、绝对领域、姐控、遮眼发、巨乳、傲娇</code> | <code>世计丸</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false,
      "directions": [
          "query_to_doc"
      ],
      "partition_mode": "joint",
      "hardness_mode": null,
      "hardness_strength": 0.0
  }

Evaluation Dataset

json
  • Dataset: json
  • Size: 3,615 evaluation samples
  • Columns: <code>anchor</code>, <code>positive</code>, and <code>char_name</code>
  • Approximate statistics based on the first 1000 samples: | | anchor | positive | char_name | |:--------|:----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 9 tokens</li><li>mean: 15.88 tokens</li><li>max: 29 tokens</li></ul> | <ul><li>min: 21 tokens</li><li>mean: 77.17 tokens</li><li>max: 307 tokens</li></ul> | <ul><li>min: 3 tokens</li><li>mean: 7.31 tokens</li><li>max: 24 tokens</li></ul> |
  • Samples: | anchor | positive | char_name | |:--------------------------------|:-------------------------------------------------------------------------------------------------------------|:-----------------------| | <code>萝莉控、黑色吊带袜、手套、绿瞳</code> | <code>角色:碧蓝航线:皇家方舟<br>本名:HMS Ark Royal<br>别名:狱友<br>发色:紫<br>瞳色:绿<br>萌点:御姐、黑色吊带袜、萝莉控、巨乳、遮眼发<br>生日:4月13日</code> | <code>碧蓝航线:皇家方舟</code> | | <code>孤儿、紫瞳、披风、长直、黑发、黑长直</code> | <code>角色:江昙<br>本名:江昙、Jiang Tan<br>别名:“圣女”、小昙花<br>声优:白杺瓒、皛四白、富田美忧<br>发色:黑<br>瞳色:紫<br>萌点:披风、针织衫、黑长直、孤儿</code> | <code>江昙</code> | | <code>尾巴、自大、嗜杀</code> | <code>角色:紫影狒狒<br>本名:Purprill、the、Mandroid、紫影狒狒<br>声优:高木涉<br>瞳色:绿<br>萌点:狒狒、尾巴、自大、嗜杀</code> | <code>紫影狒狒</code> |
  • Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
json
  {
      "scale": 20.0,
      "similarity_fct": "cos_sim",
      "gather_across_devices": false,
      "directions": [
          "query_to_doc"
      ],
      "partition_mode": "joint",
      "hardness_mode": null,
      "hardness_strength": 0.0
  }

Training Hyperparameters

Non-Default Hyperparameters
  • per_device_train_batch_size: 64
  • learning_rate: 2e-05
  • num_train_epochs: 5
  • warmup_steps: 0.1
  • fp16: True
  • load_best_model_at_end: True
  • batch_sampler: no_duplicates
All Hyperparameters

<details><summary>Click to expand</summary>

  • do_predict: False
  • prediction_loss_only: True
  • per_device_train_batch_size: 64
  • per_device_eval_batch_size: 8
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_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: 5
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: None
  • warmup_ratio: None
  • warmup_steps: 0.1
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • enable_jit_checkpoint: False
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • use_cpu: False
  • seed: 42
  • data_seed: None
  • bf16: False
  • fp16: True
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: -1
  • ddp_backend: None
  • debug: []
  • dataloader_drop_last: False
  • dataloader_num_workers: 0
  • dataloader_prefetch_factor: None
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: True
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • accelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamwtorchfused
  • optim_args: None
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • 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
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • hub_revision: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • auto_find_batch_size: False
  • full_determinism: False
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_num_input_tokens_seen: no
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: True
  • use_cache: False
  • prompts: None
  • batch_sampler: no_duplicates
  • multi_dataset_batch_sampler: proportional
  • router_mapping: {}
  • learning_rate_mapping: {}

</details>

Training Logs

EpochStepTraining LossValidation Loss
0.10941002.4634-
0.21882001.1738-
0.32823001.0204-
0.43764000.8706-
0.54705000.8237-
0.65656000.8114-
0.76597000.7423-
0.87538000.7134-
0.98479000.6652-
1.0914-0.1627
1.094110000.6096-
1.203511000.6270-
1.312912000.6147-
1.422313000.5881-
1.531714000.6169-
1.641115000.5780-
1.750516000.5719-
1.860017000.5977-
1.969418000.5682-
2.01828-0.1404
2.078819000.5367-
2.188220000.5234-
2.297621000.4955-
2.407022000.5051-
2.516423000.5314-
2.625824000.4933-
2.735225000.4881-
2.844626000.4982-
2.954027000.4992-
3.02742-0.1312
3.063528000.4945-
3.172929000.4468-
3.282330000.4524-
3.391731000.4675-
3.501132000.4591-
3.610533000.4627-
3.719934000.4545-
3.829335000.4718-
3.938736000.4558-
4.03656-0.1237
4.048137000.4439-
4.157538000.4375-
4.267039000.4384-
4.376440000.4486-
4.485841000.4373-
4.595242000.4356-
4.704643000.4425-
4.814044000.4285-
4.923445000.4219-
5.04570-0.1243
  • The bold row denotes the saved checkpoint.

Training Time

  • Training: 15.3 minutes

Framework Versions

  • Python: 3.12.13
  • Sentence Transformers: 5.4.1
  • Transformers: 5.0.0
  • PyTorch: 2.10.0+cu128
  • Accelerate: 1.13.0
  • Datasets: 4.8.5
  • Tokenizers: 0.22.2

Citation

BibTeX

Sentence Transformers
bibtex
@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",
}
MultipleNegativesRankingLoss
bibtex
@misc{oord2019representationlearningcontrastivepredictive,
      title={Representation Learning with Contrastive Predictive Coding},
      author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
      year={2019},
      eprint={1807.03748},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1807.03748},
}

<!--

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. -->