miniCOIL clean_words mutates input and loses counts when normalized words collide

Aperta
#877 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

@pear1-pea ci sta già lavorando.

Dal 11/11/2026.

  • #878 di @pear1-pea — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
1/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

The issue identifies SparseVectorConverter.clean_words() and provides two offline regression cases, with examples for input mutation and lost counts when normalized words collide. Start by reading that method and inspect the linked pull request #878, which is already open. Done means the cleaned result combines counts while retaining the known word's vocabulary ID and embedding, and the caller's input remains unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

SparseVectorConverter.clean_words() changes the caller's WordEmbedding when an unknown word normalizes to a known word. It also loses the unknown word's count if the known word occurs later in the input mapping.

Reproduced on current main, without downloading a model:

from py_rust_stemmers import SnowballStemmer
from fastembed.sparse.utils.sparse_vectors_converter import SparseVectorConverter, WordEmbedding

converter = SparseVectorConverter(set(), SnowballStemmer("english"))
known = WordEmbedding("cat", ["cat"], 1, 1, [1.0, 0.0])
unknown = WordEmbedding("cat!", ["cat!"], 2, -1, [1.0])
sentence = {"cat": known, "cat!": unknown}
converter.clean_words(sentence)
print(known.count)  # 3: caller's original count was 1
print(converter.clean_words(sentence)["cat"].count)  # 5 instead of 3

With fresh inputs in the reverse order, the cleaned count is 1 instead of 3. The known word should retain its vocabulary ID and embedding while combining both counts, without changing the input. Two parameterized offline regression cases fail on main (one for input mutation, one for the lost count).

AI assistance: Codex inspected the source and ran the reproductions and tests.

Lingua principale
Python
Stelle
3.3k
Fork
314
Merge medio
5g 7h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di qdrant/fastembed

Tutte le issue di qdrant/fastembed

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.