CoolFace
Datasetpublic

ericssonbear/mr-right-zhtw-embeddings

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… See the full description on the dataset page: https://huggingface.co/datasets/ericssonbear/mr-right-zhtw-embeddings.

sourceHugging Facecc-by-sa-4.0updated 1mo agoView on Hugging Face
0likes54downloads
Dataset Card

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.

fileshape / sizenotes
emb.npy(769245, 4096) float16, 6.3 GBL2-normalised — cosine similarity is a plain dot product
ids.json769,245 ints, 6.0 MBdocument 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

python
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:

  1. 1.the document image, hard-capped at 896×896 pixels;
  2. 2.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.