[Bug]: Bm25 splits Tamil, Hindi, Sinhala and other words on their combining marks
Los mantenedores suelen responder en 4 días
@Nipuna-Lakruwan ya está trabajando en esto.
Desde el 19/11/2026.
- #887 de @Nipuna-Lakruwan — abierto
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 30/100
Línea de trabajo
The issue identifies remove_non_alphanumeric and SimpleTokenizer as the two places that split combining marks, and links open PR #887 for this fix. Read those tokenizer paths and the proposed tests in the PR; verify Tamil and other listed scripts stay intact, while text without combining marks keeps its existing token ids.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened?
Qdrant/bm25 breaks words that contain combining marks into fragments. That covers Tamil (a supported language), Hindi, Sinhala, Bengali, Thai and Arabic with diacritics.
Two places strip the marks before the stemmer ever sees the words:
remove_non_alphanumericuses[^\w\s];SimpleTokenizeruses[^\w].
Python's \w does not include combining marks (Unicode categories Mn and Mc). The vowel signs and the virama in "தமிழ்" (Tamil) are therefore treated as separators, and the word becomes ["தம", "ழ"].
The fragments are shared by unrelated words, which causes false matches. With language="tamil", a query for "தமிழ்" (Tamil) also matches a document that only contains "தம்" (own) and "மழை" (rain):
from fastembed import SparseTextEmbedding
m = SparseTextEmbedding("Qdrant/bm25", language="tamil")
print(m.model.tokenizer.tokenize("தமிழ் மொழி அழகானது"))
# ['தம', 'ழ', 'ம', 'ழ', 'அழக', 'னத'] expected ['தமிழ்', 'மொழி', 'அழகானது']
tamil, rain = m.embed(["தமிழ் மொழி", "தம் ஊரில் மழை"])
query = next(m.query_embed("தமிழ்"))
print(set(query.indices) & set(rain.indices)) # not empty: the "rain" document matches
Other scripts, with disable_stemmer=True:
| Input | Tokens now | Expected |
|---|---|---|
| हिन्दी भाषा (Hindi) | ह न द भ ष |
हिन्दी भाषा |
| ශ්රී ලංකාව (Sinhala) | ශ ර ල ක ව |
ශ්රී ලංකාව |
| كَتَبَ الطالب (Arabic, voweled) | ك ت ب الطالب |
كَتَبَ الطالب |
The Snowball Tamil stemmer never receives a whole word, so language="tamil" cannot work as intended.
What is the expected behaviour?
Combining marks (and the zero-width joiner and non-joiner used in Indic and Sinhala conjuncts) should stay inside the word, as nltk.wordpunct_tokenize and LangChain's BM25 preprocessing already do.
A minimal reproducible example
See above.
What Python version are you on? e.g. python --version
Python 3.12
FastEmbed version
v0.8.1 (also on main)
What os are you seeing the problem on?
MacOS
Relevant stack traces and/or logs
No response
I have a fix with tests ready and can open a PR. It would change token ids only for text that contains combining marks, so Latin-script English and other text without them hashes exactly as before.
- Lenguaje dominante
- Python
- Estrellas
- 3.3k
- Forks
- 314
- Merge medio
- 5 d 7 h
- PR fusionados (30 d)
- 23
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de qdrant/fastembed
-
miniCOIL clean_words mutates input and loses counts when normalized words collidePosiblemente ocupada @pear1-pea la tomó hace 20 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 1/100
Los mantenedores suelen responder en 4 días
-
[Bug]: Revision-pinned HF downloads can falsely report intact files as corruptedPosiblemente ocupada @N7766 la tomó hace 24 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 82/100
Los mantenedores suelen responder en 4 días
-
[Bug]: URL-backed custom models with the same basename reuse the wrong cached modelPosiblemente ocupada @rtmalikian la tomó hace 24 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 4 días
-
[Bug]: rerank_pairs raises TypeError when pairs are passed as a tuple of pairsPosiblemente ocupada @michaelkillgta la tomó hace 53 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 22/100
Los mantenedores suelen responder en 4 días
-
[Feature]: Support huggingface-hub 2.0Quizá libre de nuevo @joein la tomó hace 63 días y no hay ningún pull request abierto. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
qdrant/fastembed#742 · 1 asignado ·
Los mantenedores suelen responder en 4 días
Todos los issues de qdrant/fastembed
Issues similares
-
accepted
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
future-agi/future-agi#5274 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
GenericMappingTools/pygmt#5014 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Feed validator crashes with "Memory error" when validating https://www.tidyverse.org/index.xmlAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
w3c/feedvalidator#204 ·
-
[BUG][Low–Medium] founder_numbers.py silently reads a SAFE discount or pool target given as a fraction (0.2) as 0.2%Posiblemente ocupada @sumitkhond111-del la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bmad-code-org/BMAD-METHOD#3358 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
open-mmlab/mmcv#3352 ·