Toolverse
All skills

sentence-transformers

by davila7

Framework for state-of-the-art sentence, text, and image embeddings. Provides 5000+ pre-trained models for semantic similarity, clustering, and retrieval. Supports multilingual, domain-specific, and multimodal models. Use for generating embeddings for RAG, semantic search, or

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
davila7
Category
Security
Views
14

About this skill

Framework for state-of-the-art sentence, text, and image embeddings. Provides 5000+ pre-trained models for semantic similarity, clustering, and retrieval. Supports multilingual, domain-specific, and multimodal models. Use for generating embeddings for RAG, semantic search, or similarity tasks. Best for production embedding generation.

How to use

  1. Zainstaluj framework poleceniem pip install sentence-transformers. Wymaga PyTorch i biblioteki transformers — instalator pobierze je automatycznie.
  2. Załaduj wybrany model, np. all-MiniLM-L6-v2 (szybki, lekki) lub all-mpnet-base-v2 (dokładniejszy). Wywołaj SentenceTransformer('nazwa-modelu') — przy pierwszym uruchomieniu model pobierze się z huggingface.co.
  3. Przygotuj listę tekstów do osadzenia (zdania, paragrafy, dokumenty). Przekaż je metodzie model.encode(lista_tekstów) — otrzymasz macierz wektorów.
  4. Oblicz podobieństwo między osadzeniami za pomocą cos_sim() z modułu sentence_transformers.util. Wynik to wartość od 0 do 1 — im bliżej 1, tym bardziej podobne teksty.
  5. Użyj osadzeń w systemie RAG: indeksuj dokumenty wektorami, a przy zapytaniu użytkownika porównaj jego osadzenie z bazą — zwróć najbardziej podobne dokumenty jako kontekst dla LLM.
  6. Dla wielojęzyczności wybierz model z prefiksem multilingual- (np. multilingual-e5-base) — obsługuje 100+ języków w jednym modelu, bez potrzeby tłumaczenia.

Related skills