Traditional Chinese Data and Models
Collection
繁體中文(台灣)資料集與模型:合成資料蒸餾、DRCD QA、醫療選擇題微調,皆附配對統計與授權邊界。 • 12 items • Updated
num_paragraphs int64 | dim int64 | model string | precision string | encode_seconds float64 | sentences_per_sec int64 | gpu string | batch_size int64 | built_at timestamp[s] |
|---|---|---|---|---|---|---|---|---|
50,000 | 1,024 | BAAI/bge-m3 | fp16 encode, fp32 index | 52.2 | 958 | NVIDIA GeForce RTX 4090 | 128 | 2026-07-11T23:20:55 |
這個 repo 存放 zhtw-wiki-semantic-search 專案預先建好的索引,供 Gradio demo Space 啟動時下載使用。
| 檔案 | 內容 |
|---|---|
index.faiss |
FAISS IndexFlatIP,50,000 × 1024 維、L2-normalized 的 BAAI/bge-m3 dense embedding(內積 = cosine 相似度) |
metadata.parquet |
每列對應一個 FAISS vector id:id(= 向量位置)、pageid、title、text(段落全文)、url(維基原文連結) |
import faiss, numpy as np, pandas as pd
from huggingface_hub import hf_hub_download
from sentence_transformers import SentenceTransformer
repo = "steven0226/zhtw-wiki-semsearch-index"
index = faiss.deserialize_index(np.frombuffer(bytearray(open(
hf_hub_download(repo, "index.faiss", repo_type="dataset"), "rb").read()), dtype=np.uint8))
df = pd.read_parquet(hf_hub_download(repo, "metadata.parquet", repo_type="dataset"))
model = SentenceTransformer("BAAI/bge-m3") # 查詢不需要任何 instruction prefix
q = model.encode(["天空為什麼藍藍的"], normalize_embeddings=True)
scores, ids = index.search(q.astype("float32"), 5)
print(df.iloc[ids[0]][["title", "url"]])
metadata.parquet 中的段落文字取自中文維基百科,
© Wikipedia 貢獻者,依 CC BY-SA 4.0
授權(維基媒體自 2023 年 6 月起採 4.0 版)。每列的 url 欄位即該段落的來源條目,供逐條署名。程式碼、訓練與評估流程、測試與完整證據都在 GitHub:https://github.com/kuotunyu/zhtw-wiki-semantic-search。GitHub kuotunyu 與 Hugging Face steven0226 為同一人。
Source code, the training/evaluation pipeline, tests and the full evidence trail live at https://github.com/kuotunyu/zhtw-wiki-semantic-search. GitHub kuotunyu and Hugging Face steven0226 are the same author.