Datasets:
The dataset viewer is not available for this dataset.
Error code: JWTInvalidSignature
Exception: InvalidSignatureError
Message: Signature verification failed
Traceback: Traceback (most recent call last):
File "/src/libs/libapi/src/libapi/jwt_token.py", line 286, in validate_jwt
decoded = jwt.decode(
jwt=token,
...<2 lines>...
options=options,
)
File "/usr/local/lib/python3.14/site-packages/jwt/api_jwt.py", line 368, in decode
decoded = self.decode_complete(
jwt,
...<8 lines>...
leeway=leeway,
)
File "/usr/local/lib/python3.14/site-packages/jwt/api_jwt.py", line 265, in decode_complete
decoded = self._jws.decode_complete(
jwt,
...<3 lines>...
detached_payload=detached_payload,
)
File "/usr/local/lib/python3.14/site-packages/jwt/api_jws.py", line 270, in decode_complete
self._verify_signature(
~~~~~~~~~~~~~~~~~~~~~~^
signing_input,
^^^^^^^^^^^^^^
...<4 lines>...
options=merged_options,
^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/jwt/api_jws.py", line 417, in _verify_signature
raise InvalidSignatureError("Signature verification failed")
jwt.exceptions.InvalidSignatureError: Signature verification failedNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Mr.TyDi Japanese Retrieval (rebuilt with kNN + reranker)
JMTEB の mrtydi-query / mrtydi-corpus (Mr.TyDi Japanese subset) を元に、 corpus を 1024 トークン以下の chunk に分割したうえで kNN 検索と Cross-Encoder リランカーで positive と hard negative を選び直した日本語 retrieval 学習データセット。
pairs / triplets / n-tuples の 3 形式と、Cross-Encoder の生 logit から計算した quality_score で valid 行のみを抽出した n-tuples-filtered の計 4 config を提供する。 Dense Retriever / Cross-Encoder / SPLADE などの日本語検索モデル学習および KL Divergence 蒸留に使える。
Configs
| config | rows | columns | 説明 |
|---|---|---|---|
| pairs | 3602 | query, positive | クエリと、kNN + リランカーで選定した最関連チャンクのペア |
| triplets | 3602 | query, positive, negative | 1 件の hard negative を付けた triplet |
| n-tuples | 3602 | query, positive, negative_1〜negative_5, label | 5 件の hard negative + Cross-Encoder の生 logit を label に付与 |
| n-tuples-filtered | 3602 | (n-tuples と同じ) | n-tuples を quality_score で valid 判定した行のみ抽出 |
すべての config の split は train のみ。
label カラムの形式 (n-tuples / n-tuples-filtered 共通)
List[float] × 6 で [score(query, positive), score(query, neg_1), …, score(query, neg_5)]。 label[0] が positive、label[1:] が negative_1〜negative_5 に 1:1 で順序通り対応する。 スコアは Cross-Encoder の生 logit (sigmoid 適用前)。
Background
旧バージョンでは sbintuitions/JMTEB の mrtydi-query (train, 3,697 件) と mrtydi-corpus (7,000,027 件) の relevant_docs を docid で結合し、positive を title + 改行 + text 形式で そのまま付与した (query, positive) ペアのみを提供していた。
このセットを Sentence Transformers や SPLADE などの学習に直接使う場合、以下の点が課題となる。
- hard negative が無い: 1 ペアのみで提供しているため、対照学習や蒸留学習に必要な negative を学習側で別途用意する必要がある。
- コーパス内の自然な hard negative が活かせない: Mr.TyDi の corpus は Wikipedia パッセージ 7M 件で、トピックとして関連した近接パッセージを多く含むが、relevant_docs が 1 件しか付与されていない構造上、コーパス内の hard negative を取り込めない。
- positive 候補が relevant_docs 1 件に固定: corpus には同じトピックを別角度で記述 したパッセージが複数存在することがあり、必ずしも relevant_docs[0] が最も学習価値の 高い positive とは限らない。
そこで本データセットでは、JMTEB の train query 自体は使いつつ、positive と negative は mrtydi-corpus 内の全 chunk を対象に、クエリ自身からの retrieval ベースで再選定 する ことで、(query, positive) のペアリングを取り直し、さらに 5 件の hard negative と Cross-Encoder 教師スコアを付与している。
元データセット (sbintuitions/JMTEB) の意図そのものを否定する記述ではなく、 JMTEB は評価ベンチマークとして設計されている関係上、train split の relevant_docs は 評価のための最小情報のみが付与されている。本セットのように対照学習・蒸留学習用の 入力データとして使う場合に「コーパス内の自然な hard negative も加味した形に再整形した」 という位置付けである。
Positive を 1024 トークン上限に揃えた理由
Mr.TyDi corpus の大半 (97.5%) はそもそも 512 トークン以下の短いパッセージだが、ごく一部 (~3%) に長文パッセージが混じる。Sentence Transformers ベースの学習で max_seq_length を 過度に大きく取ると GPU メモリと計算量が無駄に膨らむため、利用者の計算予算に合わせて 1024 トークン上限の chunk 単位に揃えた。短い doc はそのまま 1 chunk として保持し、上限を超える doc のみ slide window で chunk 化している。
データセットの構築手順
1. Corpus のチャンク化
mrtydi-corpus (7,000,027 件) の各 doc に対して、以下の手順で 1024 トークン以内の chunk に分割する。
- doc の title と text を title + 改行 + text の形式に結合
- sbintuitions/modernbert-ja-310m トークナイザーで結合テキストのトークン長を一括計測
- トークン長が 1024 以下の doc はそのまま 1 chunk として確定
- 1024 を超える doc のみ、以下のアルゴリズムで chunk 化:
- text を「。」または「.」で文 (passage) 単位に分割
- 1 文単独で 1024 トークンを超える場合は、その文をトークン単位の sliding window (window=1024, stride=256) で細分化
- 連続する文を合計 1024 トークン以下になる範囲で束ね、stride 256 トークン分ずらして overlap を持たせた chunk 列を作る
- 各 chunk の先頭に元 doc の title を改めて prepend
長文 doc はトピックの導入部 (title 含む) を毎チャンクで共有することで、後段の埋め込みでも chunk 単位で適切に「どの記事の話題か」を捉えやすくしている。
| 項目 | 値 |
|---|---|
| 入力 doc 数 | 7000027 |
| 出力 chunk 数 | 7007646 |
| 長文 doc (1024 トークン超で chunk 化したもの) | 1545 |
| chunk/doc (mean / median / max) | 1.0011 / 1 / 49 |
| tokens/chunk (mean / median / max) | 79.0 / 62 / 1041 |
2. Embedding
chunk と query の両方を cl-nagoya/ruri-v3-310m (768 次元) で埋め込み、L2 正規化して fp16 で保存する。 Ruri v3 の prefix を使い、query 側は「検索クエリ: 」、document 側は「検索文書: 」を先頭に付与する。
3. kNN 検索 (GPU matmul)
L2 正規化済み埋め込みに対して内積 = cosine 類似度で top-50 を検索する。RTX PRO 6000 Blackwell 上での GPU matmul + chunked topk (fp16) を採用し、Query × Chunk = 3697 × 7007646 の 全件検索を実行する。後段のフォールバック (rank 15 → 50 への候補拡張) を再検索なしで扱えるよう、 最初から top-50 まで保持しておく。
4. リランカーでのスコアリングと選定
各クエリについて、kNN 上位 15 件を初期候補とする。候補ごとに教師モデル cl-nagoya/ruri-v3-reranker-310m (Japanese ModernBERT ベースの Cross-Encoder) で 生 logit (sigmoid 適用前) を計算し、以下の手順で positive / negative を選ぶ。
- 初期 15 件のスコアがすべて 2.0 未満なら、行ごと drop (corpus 内に十分関連する chunk が無いと判断)
- 最高スコアの chunk を positive とする
- 残り 14 件のうち、pos - neg >= 4.0 を満たす chunk を高スコア順に最大 5 件まで採用
- 採用 negative が 5 件未満なら、kNN top-50 まで候補を拡張 (rank 16〜50 をリランカーで追加スコアリング) して同じフィルタを適用し、不足分を補う
- 拡張後もなお 5 件揃わない場合は行ごと drop
| 設定 | 値 |
|---|---|
| reranker | cl-nagoya/ruri-v3-reranker-310m |
| max_length | 1024 |
| 出力 | 生 logit (sigmoid 未適用) |
| 推論精度 | bfloat16 |
| 候補初期取得数 | top-15 |
| 候補拡張上限 | top-50 |
| positive 採用閾値 (POS_THRESHOLD) | 2.0 |
| pos - neg 採用閾値 (MARGIN_THRESHOLD) | 4.0 |
| 統計 | 値 |
|---|---|
| 総 train クエリ数 | 3697 |
| 全候補スコア < 2.0 で drop | 95 |
| 候補拡張を利用した行 | 16 |
| 拡張後も negative 不足で drop | 0 |
| 最終採用行数 | 3602 |
5. quality_score と n-tuples-filtered
n-tuples-filtered は、生 logit から計算した quality_score で validated と判定された行のみを 抽出したサブセット。本データセットの選定ロジックでは pos >= 2.0 / pos - max(neg) >= 4.0 を 通過させているため、validation で弾かれるのは候補拡張時に MARGIN_THRESHOLD = 4.0 ぎりぎりに 入った negative が、quality_score 側の MARGIN_MIN = 0.5 を下回るケースなどに限られる。
定義 (distillation_score.md の実装に沿う):
POS_MIN = 2.0 # positive の最低 logit
MARGIN_MIN = 0.5 # pos - max(neg) の最低マージン
MARGIN_PENALTY = 0.1 # margin が大きすぎる「楽勝行」へのペナルティ係数
def quality_score_vec(labels):
p, neg = labels[:, 0], labels[:, 1:]
margin = p - neg.max(axis=1)
fn_mask = margin <= 0
weak_mask = (~fn_mask) & (p < POS_MIN)
border_mask = (~fn_mask) & (~weak_mask) & (margin < MARGIN_MIN)
valid_mask = (~fn_mask) & (~weak_mask) & (~border_mask)
return np.where(valid_mask, neg.mean(axis=1) - MARGIN_PENALTY * margin, -np.inf)
n-tuples 全 3602 行のうち、validated = True と判定された 3602 行を n-tuples-filtered として切り出している。
モデル
| 用途 | モデル | 役割 |
|---|---|---|
| トークナイザー (chunk 分割) | sbintuitions/modernbert-ja-310m | 文単位の分割と、各 chunk のトークン長計測 |
| 埋め込み (kNN 検索) | cl-nagoya/ruri-v3-310m | query / chunk の dense embedding (768d, L2 正規化) |
| リランカー (スコアリング) | cl-nagoya/ruri-v3-reranker-310m | (query, chunk) ペアの生 logit を出力する日本語 Cross-Encoder |
License
CC BY-SA 4.0
直接のソースである sbintuitions/JMTEB が CC BY-SA 4.0 で配布されているため、本データセットも CC BY-SA 4.0 を継承する。元の Mr.TyDi は Apache-2.0、corpus の Wikipedia 由来テキストは CC BY-SA に従う。chunk 化と再選定処理のみが本データセット側の付加物である。
Citation
@misc{sbintuitions_jmteb,
author = {SB Intuitions},
title = {JMTEB: Japanese Massive Text Embedding Benchmark},
year = {2024},
url = {https://huggingface.co/datasets/sbintuitions/JMTEB},
}
@inproceedings{mrtydi,
title = {Mr. TyDi: A Multi-lingual Benchmark for Dense Retrieval},
author = {Zhang, Xinyu and Ma, Xueguang and Shi, Peng and Lin, Jimmy},
booktitle = {Proceedings of the 1st Workshop on Multilingual Representation Learning (MRL)},
year = {2021},
url = {https://aclanthology.org/2021.mrl-1.12/},
}
Acknowledgements
- Source benchmark: https://huggingface.co/datasets/sbintuitions/JMTEB
- Original Mr.TyDi: https://github.com/castorini/mr.tydi
- Tokenizer (chunking / length stats): https://huggingface.co/sbintuitions/modernbert-ja-310m
- Dense retriever (kNN): https://huggingface.co/cl-nagoya/ruri-v3-310m
- Cross-Encoder (rerank / distillation teacher): https://huggingface.co/cl-nagoya/ruri-v3-reranker-310m
- Downloads last month
- 46