Datasets:
text int64 0 806k |
|---|
0 |
2 |
4 |
6 |
8 |
10 |
12 |
14 |
16 |
18 |
20 |
22 |
24 |
26 |
28 |
30 |
32 |
34 |
36 |
38 |
41 |
43 |
45 |
47 |
49 |
51 |
53 |
55 |
58 |
60 |
62 |
64 |
66 |
68 |
70 |
73 |
75 |
77 |
79 |
81 |
84 |
86 |
88 |
90 |
92 |
94 |
96 |
98 |
101 |
103 |
105 |
107 |
109 |
111 |
113 |
115 |
117 |
119 |
121 |
123 |
125 |
127 |
129 |
131 |
133 |
135 |
137 |
139 |
141 |
143 |
145 |
147 |
149 |
151 |
154 |
156 |
158 |
160 |
162 |
164 |
166 |
168 |
170 |
172 |
174 |
176 |
178 |
181 |
183 |
185 |
187 |
189 |
191 |
193 |
195 |
197 |
199 |
201 |
203 |
205 |
Mr. Right zh-TW — pre-computed document embeddings
The deployed document bank (zhen_img_v2) for the
Mr. Right zh-TW corpus:
one 4096-dimensional vector per document, covering all 769,245 documents.
Encoding all of them takes multiple GPU-days and requires the full 1.2 TB image tree. This repository exists so you can skip both and go straight to retrieval.
| file | shape / size | notes |
|---|---|---|
emb.npy |
(769245, 4096) float16, 6.3 GB |
L2-normalised — cosine similarity is a plain dot product |
ids.json |
769,245 ints, 6.0 MB | document id for each row, in row order |
ids.json[i] is the corpus id of emb[i]. Document ids are non-contiguous, so
always join through this file rather than assuming row == id.
Usage
import json, numpy as np
from huggingface_hub import hf_hub_download
repo = "ericssonbear/mr-right-zhtw-embeddings"
emb = np.load(hf_hub_download(repo, "emb.npy", repo_type="dataset"), mmap_mode="r")
ids = json.load(open(hf_hub_download(repo, "ids.json", repo_type="dataset")))
q = ... # (4096,) float32, L2-normalised query vector
scores = emb @ q.astype(np.float16)
top = np.argsort(-scores)[:10]
print([ids[i] for i in top])
For anything beyond a one-off query, put the matrix in FAISS (IndexFlatIP) or do the
dot product on GPU in chunks — a full scan reads all 6.3 GB.
How these were produced
Encoder: Qwen/Qwen3-VL-Embedding-8B + the doc_encoder adapter (embedder_11_r4)
from ericssonbear/qwen3-vl-emb-8b-mrright-zhtw-lora.
Per document, one prompt containing:
- the document image, hard-capped at 896×896 pixels;
- the text
指令:為以下文檔產生向量表示,以用於檢索任務:\n查詢:{title_zhtw}\n{doc_text_zhtw}.
Pooling is last-token hidden state from the inner base module, cast to fp32, L2-normalised, then stored as fp16.
Matching query vectors
Query vectors must come from the query_encoder adapter (embedder_11_r5) — a
different adapter from the one that built this bank. See the
model card
for the exact query-side prompt and instructions. Encoding queries with doc_encoder,
or documents with query_encoder, silently degrades retrieval.
Against these vectors, the deployed query encoder reaches R@1 .7283 / R@10 .9052 /
MRR@10 .7908 on the clean test split (n = 1,951, query_multi_zhtw as plain text).
Related banks (not published)
Two single-modality banks with identical shape exist for the modality ablation (text-only and image-only). They are ablation artifacts, not useful for retrieval, so only the deployed image+text bank is published here. The ablation numbers are in the model card.
License
CC BY-SA 4.0, inherited from the corpus these vectors encode. See the dataset card for the full provenance and attribution chain.
Built by Hsin-Yu Lin, Hong-Yan Huang, Shau-Yung Hsu, Song-Duo Ma, Pin-Yu Chen, Chu-Yun Chen, Wei-Te Ho and Pu-Jen Cheng. Funded under National Science and Technology Council, Taiwan, project NSTC 115-2634-F-001-006 ("Advancing Next-Generation Frontier AI Research" programme). Compute provided by the NCHC 晶創 (Nano5) cluster.
- Downloads last month
- 37