Model Card for FRIDA GGUF

FRIDA is a full-scale finetuned general text embedding model inspired by denoising architecture based on T5. The model is based on the encoder part of FRED-T5 model and continues research of text embedding models (ruMTEB, ru-en-RoSBERTa). It has been pre-trained on a Russian-English dataset and fine-tuned for improved performance on the target task.

For more model details please refer to our technical report [TODO].

Usage

The model can be used as is with prefixes. It is recommended to use CLS pooling. The choice of prefix and pooling depends on the task.

We use the following basic rules to choose a prefix:

  • "search_query: " and "search_document: " prefixes are for answer or relevant paragraph retrieval
  • "paraphrase: " prefix is for symmetric paraphrasing related tasks (STS, paraphrase mining, deduplication)
  • "categorize: " prefix is for asymmetric matching of document title and body (e.g. news, scientific papers, social posts)
  • "categorize_sentiment: " prefix is for any tasks that rely on sentiment features (e.g. hate, toxic, emotion)
  • "categorize_topic: " prefix is intended for tasks where you need to group texts by topic
  • "categorize_entailment: " prefix is for textual entailment task (NLI)

To better tailor the model to your needs, you can fine-tune it with relevant high-quality Russian and English datasets.

Below are examples of texts encoding using the Transformers and SentenceTransformers libraries.

Ollama

ollama pull evilfreelancer/FRIDA:f16
import json
import requests
import numpy as np

OLLAMA_HOST = "http://localhost:11434"
MODEL_NAME = "evilfreelancer/FRIDA:f16"


def get_embedding(text):
    payload = {
        "model": MODEL_NAME,
        "input": text
    }

    response = requests.post(
        f"{OLLAMA_HOST}/api/embed",
        data=json.dumps(payload, ensure_ascii=False),
        headers={"Content-Type": "application/x-www-form-urlencoded"}
    )
    response.raise_for_status()
    return np.array(response.json()["embeddings"][0])


def normalize(vectors):
    vectors = np.atleast_2d(vectors)
    norms = np.linalg.norm(vectors, axis=1, keepdims=True)
    norms[norms == 0] = 1.0
    return vectors / norms


def cosine_diag_similarity(a, b):
    return np.sum(a * b, axis=1)


inputs = [
    #
    "paraphrase: В Ярославской области разрешили работу бань, но без посетителей",
    "categorize_entailment: Женщину доставили в больницу за ее жизнь сейчас борются врачи.",
    "search_query: Сколько программистов нужно, чтобы вкрутить лампочку?",
    #
    "paraphrase: Ярославским баням разрешили работать без посетителей",
    "categorize_entailment: Женщину спасают врачи.",
    "search_document: Чтобы вкрутить лампочку нужно три программиста.",
]
size = int(len(inputs)/2)

embeddings = normalize(np.array([get_embedding(text) for text in inputs]))
sim_scores = cosine_diag_similarity(embeddings[:size], embeddings[size:])
print(sim_scores.tolist())

Authors

Citation

@misc{TODO
}

Limitations

The model is designed to process texts in Russian, the quality in English is unknown. Maximum input text length is limited to 512 tokens.

Downloads last month
542
GGUF
Model size
823M params
Architecture
t5encoder
Hardware compatibility
Log In to view the estimation

1-bit

2-bit

8-bit

16-bit

32-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for evilfreelancer/FRIDA-GGUF

Finetuned
ai-forever/FRIDA
Quantized
(1)
this model