CoolFace
Modelpublic

avemio/German-RAG-BGE-M3-TRIPLES-HESSIAN-AI

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes84downloads
Model Card

German-RAG-BGE-M3-TRIPLES-HESSIAN-AI

This is a sentence-transformers model trained on this Dataset with roughly 300k Triple-Samples. 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. It was merged with the Base-Model BAAI/bge-m3 again to maintain performance on other languages again.

Model Details

Model Description

  • Model Type: Sentence Transformer <!-- - Base model: Unknown -->
  • Maximum Sequence Length: 8192 tokens
  • Output Dimensionality: 1024 tokens
  • Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->

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()
)

Evaluation MTEB-Tasks

Classification

  • AmazonCounterfactualClassification
  • AmazonReviewsClassification
  • MassiveIntentClassification
  • MassiveScenarioClassification
  • MTOPDomainClassification
  • MTOPIntentClassification

Pair Classification

  • FalseFriendsGermanEnglish
  • PawsXPairClassification

Retrieval

  • GermanQuAD-Retrieval
  • GermanDPR

STS (Semantic Textual Similarity)

  • GermanSTSBenchmark
Comparison between Base-Model (BGE-M3), Finetuned Model (German-RAG-BGE) and Merged Model with Base-Model (Merged-BGE)
TASK[BGE-M3](https://huggingface.co/BAAI/bge-m3)German-RAG-BGE[Merged-BGE](https://huggingface.co/avemio/German-RAG-BGE-M3-TRIPLES-MERGED-HESSIAN-AI/)German-RAG vs. BGEMerged vs. BGE
AmazonCounterfactualClassification0.69080.54490.7111-14.59%2.03%
AmazonReviewsClassification0.46340.27450.4571-18.89%-0.63%
FalseFriendsGermanEnglish0.53430.47770.5338-5.67%-0.05%
GermanQuAD-Retrieval0.94440.87140.9311-7.30%-1.33%
GermanSTSBenchmark0.80790.79210.8218-1.58%1.39%
MassiveIntentClassification0.65750.48840.6522-16.90%-0.52%
MassiveScenarioClassification0.73550.58370.7381-15.19%0.25%
GermanDPR0.82650.72100.8159-10.54%-1.06%
MTOPDomainClassification0.91210.74500.9139-16.71%0.17%
MTOPIntentClassification0.68080.45160.6684-22.92%-1.25%
PawsXPairClassification0.56780.50770.5710-6.01%0.33%
Comparison between Base-Model (BGE-M3), Merged Model with Base-Model (Merged-BGE) and our Merged-Model merged with Snowflake/snowflake-arctic-embed-l-v2.0
TASK[BGE-M3](https://huggingface.co/BAAI/bge-m3)[Merged-BGE](https://huggingface.co/avemio/German-RAG-BGE-M3-TRIPLES-MERGED-HESSIAN-AI/)[Merged-Snowflake](https://huggingface.co/avemio/German-RAG-BGE-M3-MERGED-x-SNOWFLAKE-ARCTIC-HESSIAN-AI/)Merged-BGE vs. BGEMerged-Snowflake vs. BGEMerged-Snowflake vs. Merged-BGE
AmazonCounterfactualClassification0.69080.71110.71522.94%3.53%0.58%
AmazonReviewsClassification0.46340.45710.4577-1.36%-1.23%0.13%
FalseFriendsGermanEnglish0.53430.53380.5378-0.09%0.66%0.75%
GermanQuAD-Retrieval0.94440.93110.9456-1.41%0.13%1.56%
GermanSTSBenchmark0.80790.82180.85581.72%5.93%4.14%
MassiveIntentClassification0.65750.65220.6826-0.81%3.82%4.66%
MassiveScenarioClassification0.73550.73810.74940.35%1.89%1.53%
GermanDPR0.82650.81590.8330-1.28%0.79%2.10%
MTOPDomainClassification0.91210.91390.92590.20%1.52%1.31%
MTOPIntentClassification0.68080.66840.7143-1.82%4.91%6.87%
PawsXPairClassification0.56780.57100.58030.56%2.18%1.63%

Evaluation on German-RAG-EMBEDDING-BENCHMARK

Accuracy is calculated by evaluating if the relevant context is the highest ranking embedding of the whole context array. See Eval-Dataset and Evaluation Code here

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("avemio/German-RAG-BGE-M3-TRIPLES-HESSIAN-AI")
# Run inference
sentences = [
    'The weather is lovely today.',
    "It's so sunny outside!",
    'He drove to the stadium.',
]
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]

<!--

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

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.2.1
  • Transformers: 4.44.2
  • PyTorch: 2.4.1+cu121
  • Accelerate: 0.34.2
  • Datasets: 3.0.1
  • Tokenizers: 0.19.1

Citation

@misc{bge-m3,
      title={BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation}, 
      author={Jianlv Chen and Shitao Xiao and Peitian Zhang and Kun Luo and Defu Lian and Zheng Liu},
      year={2024},
      eprint={2402.03216},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

The German-RAG AI Team

Marcel Rosiak Soumya Paul Siavash Mollaebrahim Zain ul Haq