omniembed-merged / README.md
shadowlilac's picture
Add new SentenceTransformer model
9122db9 verified
|
Raw
History Blame Contribute Delete
8.42 kB
metadata
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - dense
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
  - cosine_accuracy@1
  - cosine_accuracy@3
  - cosine_accuracy@5
  - cosine_accuracy@10
  - cosine_precision@1
  - cosine_precision@3
  - cosine_precision@5
  - cosine_precision@10
  - cosine_recall@1
  - cosine_recall@3
  - cosine_recall@5
  - cosine_recall@10
  - cosine_ndcg@10
  - cosine_mrr@10
  - cosine_map@100
model-index:
  - name: SentenceTransformer
    results:
      - task:
          type: information-retrieval
          name: Information Retrieval
        dataset:
          name: Unknown
          type: unknown
        metrics:
          - type: cosine_accuracy@1
            value: 0.7602405110860578
            name: Cosine Accuracy@1
          - type: cosine_accuracy@3
            value: 0.8357760240511086
            name: Cosine Accuracy@3
          - type: cosine_accuracy@5
            value: 0.8485531754979331
            name: Cosine Accuracy@5
          - type: cosine_accuracy@10
            value: 0.859075535512965
            name: Cosine Accuracy@10
          - type: cosine_precision@1
            value: 0.7602405110860578
            name: Cosine Precision@1
          - type: cosine_precision@3
            value: 0.2785920080170362
            name: Cosine Precision@3
          - type: cosine_precision@5
            value: 0.1697106350995866
            name: Cosine Precision@5
          - type: cosine_precision@10
            value: 0.08590755355129649
            name: Cosine Precision@10
          - type: cosine_recall@1
            value: 0.7602405110860578
            name: Cosine Recall@1
          - type: cosine_recall@3
            value: 0.8357760240511086
            name: Cosine Recall@3
          - type: cosine_recall@5
            value: 0.8485531754979331
            name: Cosine Recall@5
          - type: cosine_recall@10
            value: 0.859075535512965
            name: Cosine Recall@10
          - type: cosine_ndcg@10
            value: 0.8143497069526588
            name: Cosine Ndcg@10
          - type: cosine_mrr@10
            value: 0.7995083302016781
            name: Cosine Mrr@10
          - type: cosine_map@100
            value: 0.8018586288255459
            name: Cosine Map@100

SentenceTransformer

This is a sentence-transformers model trained. It maps sentences & paragraphs to a 1536-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
  • Maximum Sequence Length: 1000000000000000019884624838656 tokens
  • Output Dimensionality: 1536 dimensions
  • Similarity Function: Cosine Similarity
  • Supported Modalities: Text, Image, Audio, Video, Message

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}, 'image': {'method': 'forward', 'method_output_name': 'last_hidden_state'}, 'audio': {'method': 'forward', 'method_output_name': 'last_hidden_state'}, 'video': {'method': 'forward', 'method_output_name': 'last_hidden_state'}, 'message': {'method': 'forward', 'method_output_name': 'last_hidden_state', 'format': 'structured'}}, 'module_output_name': 'token_embeddings', 'architecture': 'Gemma4Model'})
  (1): MultiheadAttentionPooling({'hidden_size': 1536, 'num_attention_heads': 16, 'intermediate_size': 6144, 'layer_norm_eps': 1e-06})
  (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("shadowlilac/omniembed-merged")
# Run inference
queries = [
    'Which planet is known as the Red Planet?',
]
documents = [
    "Venus is often called Earth's twin because of its similar size and proximity.",
    'Mars, known for its reddish appearance, is often referred to as the Red Planet.',
    'Saturn, famous for its rings, is sometimes mistaken for the Red Planet.',
]
query_embeddings = model.encode_query(queries)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings.shape)
# [1, 1536] [3, 1536]

# Get the similarity scores for the embeddings
similarities = model.similarity(query_embeddings, document_embeddings)
print(similarities)
# tensor([[0.3457, 0.8750, 0.6484]], dtype=torch.bfloat16)

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.7602
cosine_accuracy@3 0.8358
cosine_accuracy@5 0.8486
cosine_accuracy@10 0.8591
cosine_precision@1 0.7602
cosine_precision@3 0.2786
cosine_precision@5 0.1697
cosine_precision@10 0.0859
cosine_recall@1 0.7602
cosine_recall@3 0.8358
cosine_recall@5 0.8486
cosine_recall@10 0.8591
cosine_ndcg@10 0.8143
cosine_mrr@10 0.7995
cosine_map@100 0.8019

Training Details

Training Logs

Epoch Step cosine_ndcg@10
-1 -1 0.8143

Framework Versions

  • Python: 3.12.13
  • Sentence Transformers: 5.7.0
  • Transformers: 5.14.1
  • PyTorch: 2.13.0+cu130
  • Accelerate: 1.14.0
  • Datasets: 5.0.1
  • Tokenizers: 0.22.2

Additional Resources

Citation

BibTeX