Instructions to use SoTrxII/analytical-pattern-embedder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use SoTrxII/analytical-pattern-embedder with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("SoTrxII/analytical-pattern-embedder") 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
|
Download README.md from SoTrxII/analytical-pattern-embedder: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/SoTrxII/analytical-pattern-embedder/resolve/main/README.md
- Command line
-
hf download hf://SoTrxII/analytical-pattern-embedder/README.md
-
curl -L -o README.md https://huggingface.co/SoTrxII/analytical-pattern-embedder/resolve/main/README.md
1.26 kB
metadata
license: apache-2.0
library_name: sentence-transformers
pipeline_tag: sentence-similarity
base_model: unsloth/embeddinggemma-2
tags:
- sentence-transformers
- feature-extraction
MoMa analytical pattern embedder
EmbeddingGemma 2 fine-tuned to match a user's task to the Analytical Pattern (AP) that answers it, for the search of the DataGEMS MoMa Management service. Text only, 768 dimensions.
It is a LoRA adapter merged into unsloth/embeddinggemma-2 at revision c8f89cc7ecb4ba5122cd15fdd487422b2b487daf.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("<this repository>", config_kwargs={"vision_config": None, "audio_config": None})
task = model.encode_query("Which students are at risk of failing?")
aps = model.encode_document(["Translates a natural-language string into a safe SQL query, ..."])
Queries and AP texts are given different prefixes, so use encode_query and
encode_document rather than encode. The AP text the model was trained on is the one
AnalyticalPattern.describe() builds from an AP's operators, not the AP's own description.
Dataset, training and benchmark: https://github.com/datagems-eosc/moma-management/tree/main/packages/analytical-pattern-embedder