mirror of
https://github.com/eth-library/CHNOBLi-embedding-engine.git
synced 2026-12-04 13:18:43 +00:00
Read-only mirror of https://github.com/eth-library/CHNOBLi-embedding-engine — ETH Library. Issues & pull requests at the source.
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| src/embedding_engine | ||
| tests | ||
| .gitignore | ||
| pyproject.toml | ||
| README.md | ||
Embedding Engine
Getting started
To install the module use
uv venv
source .venv/bin/activate
uv pip install -e .
Usage
to create embeddings with different huggingface models use the following routine:
from embedding_engine.embeddings import generate_embedding
backend = "huggingface"
model = "Snowflake/snowflake-arctic-embed-l-v2.0"
texts = ["Some text to embedd",
"Some other text to also embedd"]
embeddings = generate_embedding(text = texts,
backend= backend,
model_name= model)
print(embeddings)
tested with, but not limited to following models:
SUPPORTED_MODELS = ["Snowflake/snowflake-arctic-embed-l-v2.0",
"sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
"sentence-transformers/LaBSE",
"sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
"nomic-ai/nomic-embed-text-v2-moe",
"intfloat/multilingual-e5-small",
"intfloat/multilingual-e5-base"
]