Parveshiiii commited on
Commit
259d7d9
·
verified ·
1 Parent(s): e0651a9

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +102 -0
README.md ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## 🧠 Dataset Card: Embedder — Multilingual Triplet Embedding Dataset
2
+
3
+ ### 📌 Overview
4
+ **Embedder** is a multilingual triplet dataset designed for training and evaluating sentence embedding models using contrastive or triplet loss. It contains 60,000 examples across 11 Indic languages and English, derived from the Samanantar parallel corpus. Each example is structured as a triplet: `(anchor, positive, negative)`.
5
+
6
+ This dataset is ideal for building cross-lingual retrieval systems, semantic search engines, and multilingual embedding models.
7
+
8
+ ---
9
+
10
+ ### 🏗️ Construction Details
11
+
12
+ The dataset was built using the following pipeline:
13
+
14
+ - **Source**: [AI4Bharat Samanantar](https://huggingface.co/datasets/ai4bharat/samanantar) — a high-quality parallel corpus for 11 Indic languages ↔ English.
15
+ - **Step 1: Sampling**
16
+ Randomly sampled bilingual sentence pairs from Samanantar, ensuring diverse language coverage and semantic alignment.
17
+ - **Step 2: Triplet Formation**
18
+ - `anchor`: One sentence from the bilingual pair (randomly chosen to be either English or Indic).
19
+ - `positive`: The aligned translation from the pair.
20
+ - `negative`: A randomly sampled sentence from the same language as the anchor, but semantically unrelated.
21
+ - **Step 3: Column Renaming & Structuring**
22
+ - Original columns like `sentence_en` and `sentence_hi` were renamed to `anchor` and `positive` based on directionality.
23
+ - Negative samples were injected from a shuffled pool and assigned to the `negative` column.
24
+ - **Step 4: Directionality Randomization**
25
+ To avoid bias, each triplet randomly flips between Indic→English and English→Indic.
26
+
27
+ ---
28
+
29
+ ### 📦 Dataset Format
30
+
31
+ - File type: `.jsonl`
32
+ - Each line contains:
33
+ ```json
34
+ {
35
+ "anchor": "मैं स्कूल जा रहा हूँ।",
36
+ "positive": "I am going to school.",
37
+ "negative": "The weather is nice today."
38
+ }
39
+ ```
40
+
41
+ - Total examples: 60,000
42
+ - Languages: Hindi, Bengali, Tamil, Marathi, Gujarati, Punjabi, Kannada, Malayalam, Oriya, Assamese, Telugu, English
43
+
44
+ ---
45
+
46
+ ### 🎯 Intended Use
47
+
48
+ - Fine-tuning multilingual embedding models (e.g., Gemma, BGE, LaBSE)
49
+ - Training contrastive or triplet loss models
50
+ - Cross-lingual semantic retrieval
51
+ - Evaluation of embedding alignment across languages
52
+
53
+ ---
54
+
55
+ ### 🧪 Supported Tasks
56
+
57
+ | Task | Description |
58
+ |--------------------------|--------------------------------------------------|
59
+ | Sentence Embedding | Learn language-agnostic representations |
60
+ | Semantic Similarity | Evaluate cosine similarity between anchor/positive |
61
+ | Cross-lingual Retrieval | Retrieve aligned sentences across languages |
62
+ | Contrastive Learning | Train models to distinguish semantic similarity |
63
+
64
+ ---
65
+
66
+ ### ⚖️ Language Balance
67
+
68
+ Each language contributes ~5,454 triplets, ensuring balanced representation. Directionality is randomized to prevent source-target bias.
69
+
70
+ ---
71
+
72
+ ### 🔐 License
73
+
74
+ - License: CC-BY 4.0 (inherits from Samanantar)
75
+ - Free for academic, commercial, and open-source use
76
+ - Attribution required
77
+
78
+ ---
79
+
80
+ ### 🛠 Preprocessing Tips
81
+
82
+ - Tokenize using model-specific tokenizer (e.g., GemmaTokenizer)
83
+ - Truncate or chunk long sequences to fit model limits
84
+ - Optional: Add language tags for anchor/positive/negative for analysis
85
+
86
+ ---
87
+
88
+ ### 📈 Evaluation Metrics
89
+
90
+ - Cosine similarity
91
+ - Mean Reciprocal Rank (MRR)
92
+ - nDCG
93
+ - Retrieval accuracy
94
+
95
+ ---
96
+
97
+ ### 👤 Maintainer
98
+
99
+ - **Author**: Parvesh Rawal (XenArcAI)
100
+ - **Contact**: [your GitHub or email]
101
+
102
+ ---