embedder_collection / README.md
kalle07's picture
Update README.md
a0643c9 verified
|
raw
history blame
7.15 kB
metadata
library_name: sentence-transformers
pipeline_tag: sentence-similarity
tags:
  - sentence-transformers
  - sentence-similarity
  - feature-extraction
  - embedder
  - embedding
  - models
  - GGUF
  - Bert
  - Nomic
  - Gist
  - BGE
  - text-embeddings-inference
  - RAG
misc:
  - text-embeddings-inference
language:
  - en
  - de
architecture:
  - GIST

All models tested with ALLM(AnythingLLM) with LM as server, all models should be work with ollama

GPT4All has only one model (nomic), but the setup for local documents described below is the same

(sometimes the results are more truthful if the “chat with document only” option is used)
give me a ❤️, if you like ;)

My short impression:

  • nomic-embed-text
  • mxbai-embed-large
  • mug-b-1.6
  • Ger-RAG-BGE-M3 (german)
  • german-roberta
Working well, all other its up to you! (jina and qwen based not yet supported)

...

Short hints for using (Example for a large context with many expected hits):

Set your (Max Tokens)context-lenght 16000t main-model, set your embedder-model (Max Embedding Chunk Length) 1024t,set (Max Context Snippets) 14, but in ALLM its cutting all in 1024 character parts, so aprox two times or bit more ~20!

-> Ok what that mean!
You can receive 14-snippets a 1024t (14336t) from your document ~10000words and 1600t left for the answer ~1000words (2 pages)
You can play and set for your needs, eg 8-snippets a 2048t, or 28-snippets a 512t ...

  • 8000t (~6000words) ~0.8GB VRAM usage
  • 16000t (~12000words) ~1.5GB VRAM usage
  • 32000t (~24000words) ~3GB VRAM usage

...

How embedding and search works:

You have a txt/pdf file maybe 90000words(~300pages) a book. You ask the model lets say "what is described in chapter called XYZ in relation to person ZYX". Now it searches for keywords or similar semantic terms in the document. if it has found them, lets say word and meaning around “XYZ and ZYX” , now a piece of text 1024token around this word “XYZ/ZYX” is cut out at this point. This text snippet is then used for your answer.

  • If, for example, the word “XYZ” occurs 100 times in one file, not all 100 are found.
  • If only one snippet corresponds to your question all other snippets can negatively influence your answer because they do not fit the topic (usually 4 to 32 snippet are fine)
  • If you expect multible search results in your docs try 16-snippets or more, if you expect only 2 than dont use more!
  • If you use snipets-size ~1024t you receive more content, if you use ~256t you receive more facts.
  • A question for "summary of the document" is most time not useful, if the document has an introduction or summaries its searching there if you have luck.
  • If a book has a table of contents or a bibliography, I would delete these pages as they often contain relevant search terms but do not help answer the user's question.
  • If the documents small like 10-20 Pages, its better you copy the whole text inside the prompt, some options called "pin".

...

Nevertheless, the main model is also important!

Especially to deal with the context length and I don't mean just the theoretical number you can set. Some models can handle 128k or 1M tokens, but even with 16k or 32k input the response with the same snippets as input is worse than with other well developed models.

...

Important -> The Systemprompt (some examples):

  • The system prompt is weighted with a certain amount of influence around your question. You can easily test it once without or with a nonsensical system prompt.
  • "You are a helpful assistant who provides an overview of ... under the aspects of ... . You use attached excerpts from the collection to generate your answers! Weight each individual excerpt in order, with the most important excerpts at the top and the less important ones further down. The context of the entire article should not be given too much weight.
    Answer the user's question!
    After your answer, briefly explain why you included excerpts (1 to X) in your response and justify briefly if you considered some of them unimportant!"
    (change it for your needs, this example works well when I consult a book about a person and a term related to them, the explanation part was just a test for myself)

    or:

    "You are an imaginative storyteller who crafts compelling narratives with depth, creativity, and coherence. Your goal is to develop rich, engaging stories that captivate readers, staying true to the themes, tone, and style appropriate for the given prompt. You use attached excerpts from the collection to generate your answers! When generating stories, ensure the coherence in characters, setting, and plot progression. Be creative and introduce imaginative twists and unique perspectives."

    or:

    "You are are a warm and engaging companion who loves to talk about cooking, recipes and the joy of food. Your aim is to share delicious recipes, cooking tips and the stories behind different cultures in a personal, welcoming and knowledgeable way."

    ...
    usual models works well:
    llama3.1, llama3.2, qwen2.5, deepseek-r1-distill, SauerkrautLM-Nemo(german) ...
    (llama3 or phi3.5 are not working well)

    btw. Jinja templates very new ... the usual templates with usual models are fine, but merged models have a lot of optimization potential (but dont ask me iam not a coder)

    ...

    " on discord (sevenof9) "
    ...
    One hint for fast search on 10000s of PDF (its only indexing not embedding) you can use it as a simple way to find your top 5-10 articles or books, you can then make these available to a Ki.
    Jabref - https://www.jabref.org/
    or
    docfetcher - https://docfetcher.sourceforge.io/en/index.html (yes old but very useful)

    (ALL licenses and terms of use go to original author)

    ...

    • avemio/German-RAG-BGE-M3-MERGED-x-SNOWFLAKE-ARCTIC-HESSIAN-AI (German, English)
    • maidalun1020/bce-embedding-base_v1 (English and Chinese)
    • maidalun1020/bce-reranker-base_v1 (English, Chinese, Japanese and Korean)
    • BAAI/bge-reranker-v2-m3 (English and Chinese)
    • BAAI/bge-reranker-v2-gemma (English and Chinese)
    • BAAI/bge-m3 (English and Chinese)
    • avsolatorio/GIST-large-Embedding-v0 (English)
    • ibm-granite/granite-embedding-278m-multilingual (English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, and Chinese)
    • Labib11/MUG-B-1.6 (?)
    • mixedbread-ai/mxbai-embed-large-v1 (multi)
    • nomic-ai/nomic-embed-text-v1.5 (English, multi)
    • Snowflake/snowflake-arctic-embed-l-v2.0 (English, multi)
    • intfloat/multilingual-e5-large-instruct (100 languages)
    • T-Systems-onsite/german-roberta-sentence-transformer-v2
    • mixedbread-ai/mxbai-embed-2d-large-v1