[Bug]: wrong retriever from version 0.6.0

オープン
#536 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
numpy, python

調査の方向性

retrieve_with_prf から始め、一覧にある embedding モデルを使って正確なクエリ "Errore 0x000006D9" を再現し、fastembed 0.5.1 と 0.6.0-0.7.1 を比較します。どの retrieval ステージが変わるのかを確認し、動作する短いクエリを比較対象として使用します。完了の条件は、正確なクエリで期待される Qdrant ドキュメントを再び取得できることです。Repository が回帰テストを提供している場合は、回帰テストも追加します。

索引モデルが issue の本文から書いたものです。

説明

What happened?

Hi, I implemented a prefech retriever.
I am using the model:
SparseTextEmbedding("Qdrant/bm25")
TextEmbedding("sentence-transformers/paraphrase-multilingual-mpnet-base-v2")
LateInteractionTextEmbedding("answerdotai/answerai-colbert-small-v1")

I tried the query: "Errore 0x000006D9"

This is the abnormal behaviour:
with fastembed version 0.5.1 it retrieves the right qdrant docuemnt
From fastembed 0.6.0 to 0.7.1 it retrieves the wrong qdrant document

instead, if the query is: "Erro 0x000006D9" or "Erro 0x000006D9" it works fine.

This is my function;

def retrieve_with_prf(query, limit=5, k_feedback=3):
    try:
        sparse_vec = list(sparse_embedding_model.embed([query]))[0]
        initial_results = client.query_points(
            collection_name=collection_name,
            query=models.SparseVector(**sparse_vec.as_object()),
            using=sparse_vector_name,
            with_payload=True,
            limit=k_feedback
        )

        if not initial_results or not initial_results.points:
            return []

        feedback_texts = [
            p.payload.get('text', '')[:1000]
            for p in initial_results.points
            if p.payload.get('text')
        ]
        if not feedback_texts:
            return []

        feedback_embeddings = list(dense_embedding_model.embed(feedback_texts))
        avg_vec = np.mean(feedback_embeddings, axis=0).tolist()

        return client.query_points(
            collection_name=collection_name,
            query=avg_vec,
            using=dense_vector_name,
            with_payload=True,
            limit=limit
        )
    except Exception:
        return []
What is the expected behaviour?

No response

A minimal reproducible example

No response

What Python version are you on? e.g. python --version

python 3.13

FastEmbed version

v0.7.1

What os are you seeing the problem on?

No response

Relevant stack traces and/or logs

主要言語
Python
スター
3.3k
フォーク
314
平均マージ
5日 7時間
マージ済み PR(30日)
23

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

qdrant/fastembed のほかの issue

qdrant/fastembed の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。