6 min read · AI for business · AI technology and models

Documents in Thai factories are often bilingual. The purchase order says a Thai term for pressure sensor, the manual says pressure transmitter, and the technician searches with the Thai transliteration of transmitter. All three mean the same thing, but a search system that was never tested on documents like this may find only one of them.
This article walks through building a small test set to see whether a search system finds the right document when questions and documents mix languages, without needing a research team. The examples are hypothetical.
Why you need to test it yourself
Model reports are usually measured on public datasets, which are not like our documents. Internal abbreviations, product codes, Thai transliterations of English words, and each employee's own spelling are not in those datasets. A good score therefore does not tell you it will do well on our work. You have to measure on our own documents.
Problems found in bilingual documents
| Question type | Example | Why it is hard to find |
|---|---|---|
| Thai only | How to replace a pump seal (in Thai) | The words in the question and in the document may be different words with the same meaning |
| Thai mixed with English terms | Set the PID of the temperature controller (Thai sentence with the English term PID) | The system has to link the Thai words with the English terms in the document |
| Thai transliteration | Inverter not working (inverter spelled in Thai script) | The document says inverter or VFD, and the Thai spelling does not match the English letters |
| English question, Thai documents | pump seal replacement | The document is in Thai but the question is in English |
Build the test question set
- Pick 20 to 50 real documents that people search for often, such as manuals, procedures and product data sheets.
- Have people who actually use them write 30 to 50 questions, in the way they really type them, including misspellings, abbreviations and transliterated words.
- Have them state which document is the correct answer (one question can map to one document or to several).
- Split the questions into groups according to the table above, with a similar number in each group.
- Keep this question set as a spreadsheet file under version control. Do not edit the questions to make them pass based on the results.
The important point is that the owner of the work writes the questions, not the person who builds the system, because the builder will unintentionally type the words the system already knows.
A simple measure: hit@k
hit@k is the share of questions for which the system puts the correct document within the top k results. For example, hit@5 asks whether the correct document is in the top five. Score each question as right or wrong, then divide by the number of questions.
Choose k to match what the system will actually show the user or pass to the AI to read. If the system will pass five items to the AI, use k = 5. Other measures, such as MRR or precision, can be added later, but hit@k is enough to start with, and you can explain it to management in one sentence.
Check Thai word segmentation problems
Thai does not put spaces between words, so keyword search needs a word segmenter first, and a segmenter can cut wrongly. For example, the Thai string romanized as ta-klom can be read as tak + lom (to dry in the wind) or as ta + klom (round eye). If the document and the question are segmented differently, the system will not find the match even though the word is the same.
- Pick questions that were not found, and look at the segmentation of both the question and the document.
- Look at technical terms, model names and transliterated words, and check whether the segmenter splits them into meaningless pieces.
- If this happens often, add a dictionary of the company's own terms, or use semantic search (embedding) together with keyword search.
- An embedding model has its own way of splitting text, but it should also be tested against our own terms.
Compare multilingual embedding models
An embedding model turns text into vectors so that search works by meaning. Some models are designed to cover many languages in one model, such as BGE-M3, which the developers' report says supports more than a hundred languages. But supporting many languages does not mean it understands our Thai factory terminology well.
Use the same question set for every option: keyword only, semantic only, and a mix of the two. Then compare hit@k by group and see which group is weakest, because the overall figure can hide a bad group.
A hypothetical example: 30 questions, three methods
A hypothetical team has 40 documents and 30 questions, split into three groups of 10: Thai only, Thai mixed with English terms, and Thai transliteration. Measured hit@5, the results are as follows.
| Search method | Thai only | Thai with English terms | Thai transliteration | All 30 questions |
|---|---|---|---|---|
| Keyword only | 8 of 10 | 6 of 10 | 4 of 10 | 18 of 30 = 60% |
| Semantic only | 9 of 10 | 8 of 10 | 7 of 10 | 24 of 30 = 80% |
| Mixed | 9 of 10 | 9 of 10 | 9 of 10 | 27 of 30 = 90% |
The working: keyword 8+6+4 = 18, divided by 30 gives 0.60. Semantic 9+8+7 = 24, divided by 30 gives 0.80. Mixed 9+9+9 = 27, divided by 30 gives 0.90. Keyword search is weakest in the transliteration group, which the overall figure alone would not show.
A caution: this set is very small. One question is worth 10 percentage points within a group and about 3.3 percentage points in the overall figure (1 divided by 30). A small difference between two methods may therefore be just chance. Enlarge the question set before making a big decision.
Common mistakes
- Letting the system builder write the questions, so the questions match what the system already knows.
- Changing questions or correct answers after seeing the results, to make the score look better.
- Looking only at the overall figure and not at each group.
- Not keeping the test set, which makes before and after comparisons impossible when the model changes.
- Forgetting that documents keep being added, so the test set must be rerun whenever the documents or the model change.
Limits and cautions
The figures in the example, including the 40 documents, the 30 questions and the hit@5 result of each method, are hypothetical. They are not results of any model or real project. Real results depend on the documents, the model and the settings. hit@k only measures whether the correct document is near the top. It does not measure whether the answer the AI writes from that document is correct. That has to be checked separately, and for work where a mistake causes damage, a person must always check the answer.
Starting references
- Wikipedia — Evaluation measures (information retrieval)
- Chen et al. — BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings (arXiv 2402.03216)
- Hugging Face — BAAI/bge-m3
- Wikipedia — Text segmentation




