Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Romansh–German Parallel Dataset (FineWeb-based)
|
| 3 |
+
colorFrom: gray
|
| 4 |
+
colorTo: red
|
| 5 |
+
sdk: static
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# Romansh–German Parallel Dataset (FineWeb-Based)
|
| 9 |
+
|
| 10 |
+
This dataset contains automatically aligned Romansh–German document pairs, extracted from the [Fineweb2](https://huggingface.co/datasets/HuggingFaceFW/fineweb-2) using cosine similarity over OpenAI embeddings. It was created as part of a university programming project focused on document-level parallel data extraction.
|
| 11 |
+
|
| 12 |
+
## Contents
|
| 13 |
+
|
| 14 |
+
The dataset consists of several alignment outputs based on different cosine similarity thresholds and sentence-length penalties:
|
| 15 |
+
|
| 16 |
+
threshold_matches/
|
| 17 |
+
├── matched_{THRESHOL*100}_{ALPHA*100}.jsonl
|
| 18 |
+
|
| 19 |
+
├── matched_60_5.0.jsonl
|
| 20 |
+
|
| 21 |
+
...
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
Each file contains one JSON line per aligned document.
|
| 25 |
+
|
| 26 |
+
## Format
|
| 27 |
+
|
| 28 |
+
Each `.jsonl` file contains entries with the following fields:
|
| 29 |
+
|
| 30 |
+
```json
|
| 31 |
+
{
|
| 32 |
+
"romansh_text": "Romansh document text",
|
| 33 |
+
"german_text": "Most similar German document text or null",
|
| 34 |
+
"similarity": 0.6123, // Score after optional length penalty
|
| 35 |
+
"original_similarity": 0.6085 // Raw cosine similarity
|
| 36 |
+
}
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Methodology
|
| 40 |
+
|
| 41 |
+
1. Documents were embedded using [OpenAI](https://platform.openai.com/docs/models/text-embedding-3-small) `text-embedding-3-small`.
|
| 42 |
+
2. Cosine similarity was computed between Romansh and German documents.
|
| 43 |
+
3. A length penalty was applied:
|
| 44 |
+
`penalized_score = cosine_similarity - alpha × |len_diff|`
|
| 45 |
+
4. For each Romansh document, the best-scoring German document was selected.
|
| 46 |
+
5. Only matches above a given threshold were retained.
|
| 47 |
+
|
| 48 |
+
**Thresholds tested:** `0.5 – 0.8`
|
| 49 |
+
**Final dataset:** `matched_0.600.jsonl` (best match)
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
## Evaluation
|
| 53 |
+
|
| 54 |
+
A negative gold standard was used to ensure quality: a set of Romansh documents known to have no valid German alignment. These were checked for false positives.
|
| 55 |
+
|
| 56 |
+
Unit tests confirmed:
|
| 57 |
+
|
| 58 |
+
No false matches for known non-aligned documents
|
| 59 |
+
|
| 60 |
+
Low similarity scores for false-alignment candidates
|
| 61 |
+
|
| 62 |
+
## File Organization
|
| 63 |
+
|
| 64 |
+
| File | Description |
|
| 65 |
+
| --------------------- | ---------------------------------- |
|
| 66 |
+
| `parallel_data/` | All alignment outputs by threshold |
|
| 67 |
+
| `matched_0.600.jsonl` | Main result (highest quality) |
|
| 68 |
+
| `README.md` | You are here |
|