PaulBurca2005's picture
Upload README.md with huggingface_hub
58f4afb verified
|
Raw
History Blame Contribute Delete
4.5 kB
---
language:
- ro
license: cc-by-4.0
task_categories:
- text-retrieval
- sentence-similarity
tags:
- romanian
- retrieval
- triplets
- hard-negatives
- bm25
size_categories:
- 10K<n<100K
configs:
- config_name: default
data_files:
- split: train
path: data/triplets_27b_bm25_hf_train.parquet
- split: eval
path: data/triplets_27b_bm25_hf_eval.parquet
- split: test
path: data/triplets_27b_bm25_hf_test.parquet
---
# Romanian retrieval triplets (BM25 hard negatives)
`(anchor, positive, negative)` triplets for training a Romanian retriever,
generated with Gemma 3 27B over a merged Romanian corpus and mined for hard
negatives with BM25.
A late-interaction variant of the same triplets is at
[`PaulBurca2005/ro-retrieval-triplets-late-interaction`](https://huggingface.co/datasets/PaulBurca2005/ro-retrieval-triplets-late-interaction).
The two are close to disjoint - over the queries both contain, mean Jaccard
overlap between their negative sets is 0.053 and 73% share no negative at
all - so training on the union exposes a model to both failure modes.
The column layout follows
[`alina0195/ro-msmarco-divided`](https://huggingface.co/datasets/alina0195/ro-msmarco-divided),
with one column added.
| column | |
|---|---|
| `anchor` | the query |
| `positive` | the document the query was generated from |
| `negative` | one hard negative, mined by BM25 |
| `query_source` | the upstream dataset or outlet the query comes from |
One row per (query, positive, negative) pair, so a query with four negatives is
four rows repeating the anchor and the positive.
## How it was built
The positive is not retrieved, it is known: every query was generated *from* a
document, so that document is the positive by construction. Retrieval is used
only to mine negatives.
Candidates come from the BM25 top-100 within the positive's own
document type. A candidate becomes a negative only if it scores in a band
relative to the positive's own score for that query, shares enough of the
query's idf mass, contains one of the query's rarest terms, and is not a
near-copy of the positive or of a negative already picked.
The corpus is deduplicated by a near-duplicate key first, boilerplate is
dropped, and self-referential queries ("what does the article say…") are
removed - identically in both variants, so the two are comparable.
## Sources
![Query provenance](triplets_27b_bm25_query_sources.png)
| source | rows | share |
|---|---:|---:|
| `realitatea` | 8 098 | 10.1% |
| `readerbench/ro-stories` | 7 206 | 9.0% |
| `protv` | 7 141 | 8.9% |
| `readerbench/ro-text-summarization (alephnews)` | 6 982 | 8.7% |
| `readerbench/ro-text-summarization (digi24)` | 6 530 | 8.1% |
| `zf` | 5 994 | 7.5% |
| `evz` | 5 885 | 7.3% |
| `libertatea` | 5 616 | 7.0% |
| `mediafax` | 5 543 | 6.9% |
| `digi24` | 5 479 | 6.8% |
| `aleph` | 4 799 | 6.0% |
| `cotidianul` | 3 953 | 4.9% |
| `BlackKakapo/recipes-ro` | 3 819 | 4.8% |
| `adevarul` | 3 087 | 3.8% |
| `readerbench/ro-text-summarization (mediafax)` | 231 | 0.3% |
## Known limitations
Read these before training on it.
1. **Residual false negatives.** The guards remove candidates that answer the
query better than the positive does, not every candidate that happens to
answer it. A second article about the same event, worded differently, can
still appear as a negative. The builder also records candidates it judged to
be the positive's own story — that judgement was measured at roughly **70%
precision**, because lexical overlap sees shared *topic*, not shared *event*:
it cannot separate two different earthquakes, or two different articles about
the same person. Those are recorded for a reranker to re-judge, not treated
as verified positives.
2. **Source imbalance.** The corpus is a merge of news outlets, folk tales,
recipes and summarisation corpora with very different sizes and registers.
`query_source` exists so this can be weighted or filtered; the distribution
above is not uniform.
3. **Machine-generated queries.** The queries are Gemma 3 27B output over the
source documents. They were filtered but not human-verified.
4. **No stemming.** The BM25 tokenizer folds diacritics but does not stem, and
Romanian is heavily inflected, so lexical matching is weaker than it could be.
## Splits
`eval`, `test`, `train`.
Where splits exist they are grouped by the positive's duplicate group, so a
query and a re-published copy of its positive never land on opposite sides.