Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
ontology
on2vec
graph-neural-networks
base-all-MiniLM-L6-v2
biomedical
biomedical-ontology
fusion-additive
gnn-gcn
medium-ontology
text-embeddings-inference
Instructions to use ellisdoro/EDAM-all-MiniLM-L6-v2_additive_gcn_h512_o64_cosine_e1024_early-on2vec-koji-early with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ellisdoro/EDAM-all-MiniLM-L6-v2_additive_gcn_h512_o64_cosine_e1024_early-on2vec-koji-early with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ellisdoro/EDAM-all-MiniLM-L6-v2_additive_gcn_h512_o64_cosine_e1024_early-on2vec-koji-early") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
metadata
base_model: all-MiniLM-L6-v2
library_name: sentence-transformers
license: apache-2.0
pipeline_tag: sentence-similarity
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- ontology
- on2vec
- graph-neural-networks
- base-all-MiniLM-L6-v2
- biomedical
- biomedical-ontology
- fusion-additive
- gnn-gcn
- medium-ontology
EDAM_all-MiniLM-L6-v2_additive_gcn_h512_o64_cosine_e1024_early
This is a sentence-transformers model created with on2vec, which augments text embeddings with ontological knowledge using Graph Neural Networks.
Model Details
- Base Text Model: all-MiniLM-L6-v2
- Text Embedding Dimension: 384
- Ontology: EDAM.owl
- Domain: biomedical
- Ontology Concepts: 3,511
- Concept Alignment: 3,511/3,511 (100.0%)
- Fusion Method: additive
- GNN Architecture: GCN
- Structural Embedding Dimension: 3511
- Output Embedding Dimension: 64
- Hidden Dimensions: 512
- Dropout: 0.0
- Training Date: 2025-09-19
- on2vec Version: 0.1.0
- Source Ontology Size: 3.2 MB
- Model Size: 115.3 MB
- Library: on2vec + sentence-transformers
Technical Architecture
This model uses a multi-stage architecture:
- Text Encoding: Input text is encoded using the base sentence-transformer model
- Ontological Embedding: Pre-trained GNN embeddings capture structural relationships
- Fusion Layer: Simple concatenation of text and ontological embeddings
Embedding Flow:
- Text: 384 dimensions → 512 hidden → 64 output
- Structure: 3511 concepts → GNN → 64 output
- Fusion: additive → Final embedding
How It Works
This model combines:
- Text Embeddings: Generated using the base sentence-transformer model
- Ontological Embeddings: Created by training Graph Neural Networks on OWL ontology structure
- Fusion Layer: Combines both embedding types using the specified fusion method
The ontological knowledge helps the model better understand domain-specific relationships and concepts.
Usage
from sentence_transformers import SentenceTransformer
# Load the model
model = SentenceTransformer('EDAM_all-MiniLM-L6-v2_additive_gcn_h512_o64_cosine_e1024_early')
# Generate embeddings
sentences = ['Example sentence 1', 'Example sentence 2']
embeddings = model.encode(sentences)
# Compute similarity
from sentence_transformers.util import cos_sim
similarity = cos_sim(embeddings[0], embeddings[1])
Training Process
This model was created using the on2vec pipeline:
- Ontology Processing: The OWL ontology was converted to a graph structure
- GNN Training: Graph Neural Networks were trained to learn ontological relationships
- Text Integration: Base model text embeddings were combined with ontological embeddings
- Fusion Training: The fusion layer was trained to optimally combine both embedding types
Intended Use
This model is particularly effective for:
- Biomedical domain text processing
- Tasks requiring understanding of domain-specific relationships
- Semantic similarity in specialized domains
- Classification tasks with domain knowledge requirements
Limitations
- Performance may vary on domains different from the training ontology
- Ontological knowledge is limited to concepts present in the source OWL file
- May have higher computational requirements than vanilla text models
Citation
If you use this model, please cite the on2vec framework:
@software{on2vec,
title={on2vec: Ontology Embeddings with Graph Neural Networks},
author={David Steinberg},
url={https://github.com/david4096/on2vec},
year={2024}
}
Created with on2vec 🧬→🤖