Omartificial-Intelligence-Space commited on
Commit
6c3bb2c
·
verified ·
1 Parent(s): d6018e9

Update readme.md

Browse files
Files changed (1) hide show
  1. README.md +124 -0
README.md CHANGED
@@ -24,4 +24,128 @@ configs:
24
  data_files:
25
  - split: train
26
  path: data/train-*
 
 
 
 
 
 
 
 
27
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  data_files:
25
  - split: train
26
  path: data/train-*
27
+ license: apache-2.0
28
+ task_categories:
29
+ - feature-extraction
30
+ - sentence-similarity
31
+ language:
32
+ - ar
33
+ size_categories:
34
+ - 1K<n<10K
35
  ---
36
+ # Arabic With Ranked Hard Negatives
37
+
38
+ ## Dataset Summary
39
+
40
+ The Arabic Hard Negative Dataset is derived from the Arabic subset of the Mr. TyDi dataset. Using an advanced Arabic embedding model, this dataset restructures the original data to include a query, a positive passage, and the top 4 hard negatives for each query based on similarity scores. These hard negatives are the most semantically similar non-relevant passages to the positive passage, providing a challenging dataset for retrieval and re-ranking tasks.
41
+ This dataset is tailored for applications in retrieval model training, re-ranking, and contrastive learning where the presence of "hard negatives" can significantly improve the performance of machine learning models.
42
+
43
+ ## Dataset Structure
44
+
45
+ - The dataset contains the following fields:
46
+ - **query**: The user query string.
47
+ - **positive**: The relevant passage for the query.
48
+ - **negative1, negative2, negative3, negative4**: The top 4 semantically similar but non-relevant passages to the positive.
49
+
50
+ ### Example Data
51
+
52
+ ```json
53
+ {
54
+ "query": "ما هي نظرية الحقل الكمي؟",
55
+ "positive": {
56
+ "text": "بدأت نظرية الحقل الكمي بشكل طبيعي بدراسة التفاعلات الكهرومغناطيسية ..."
57
+ },
58
+ "negative1": {
59
+ "text": "تم تطوير النهج مؤخرًا ليشمل نسخة جبرية من الحقل الكمي ..."
60
+ },
61
+ "negative2": {
62
+ "text": "نظرية الحقول الكمومية لها تطبيقات واسعة تشمل العديد من العلوم الفيزيائية ..."
63
+ },
64
+ "negative3": {
65
+ "text": "النظرية الكهرومغناطيسية لها دور محوري في نظرية الحقول الكمومية ..."
66
+ },
67
+ "negative4": {
68
+ "text": "الحقل الكمي يستخدم الآن في الفيزياء النظرية وتطبيقات أخرى ..."
69
+ },
70
+ "similarity1": 0.75,
71
+ "similarity2": 0.72,
72
+ "similarity3": 0.70,
73
+ "similarity4": 0.68
74
+ }
75
+ ```
76
+
77
+ ## Dataset Statistics
78
+
79
+ 🔸Number of rows: 362,000
80
+ 🔸Fields: 6 (query, positive, 4 negatives)
81
+
82
+ Similarity Ranges:
83
+ 🔸`negative1`: Average similarity: ~0.7
84
+ 🔸`negative4`: Average similarity: ~0.65
85
+
86
+ Languages: Arabic (Modern Standard Arabic).
87
+
88
+ ## Dataset Analysis and Insights
89
+
90
+ 1. Average Similarity Across Negatives:
91
+
92
+ ![Gate-sim-results](https://i.ibb.co/7SKdT2F/Gate-sim-results.png)
93
+
94
+ 🔸The average similarity between the positive passage and the negatives decreases as the rank increases. Below is a bar chart visualizing the average similarity for the top 30 negatives in the original dataset, focusing on the top 4 for this version.
95
+
96
+ ![Gate-sim-results-dis](https://i.ibb.co/gTQD4GH/Gate-sim-result-dis.png)
97
+
98
+ 2. Similarity Distributions:
99
+
100
+ 🔸The similarity scores for each negative passage are distributed differently. Below are the histograms for the similarity distributions of the top 30 negatives, emphasizing the scores for negative1 to negative4.
101
+
102
+ 3. Insights
103
+
104
+ The top-ranked negatives (negative1 and negative2) are significantly closer in similarity to the positive passage, making them challenging and ideal for training advanced retrieval models.
105
+ The similarity drops slightly for negative3 and negative4, but they remain "hard negatives," offering diverse yet challenging non-relevant passages for contrastive learning.
106
+
107
+ ## How to Use This Dataset
108
+
109
+ ```python
110
+ from datasets import load_dataset
111
+
112
+ dataset = load_dataset('Omartificial-Intelligence-Space/Arabic-With-Ranked-Hard-Negatives')
113
+ dataset
114
+ ```
115
+
116
+ ## Recommended Applications
117
+ ▪️ Training Retrieval Models: Use the triplet structure (query, positive, negative) to train retrieval models with loss functions like triplet loss or contrastive loss.
118
+ ▪️ Fine-Tuning Re-Ranking Models: Use the ranked negatives to train models to rank positives above hard negatives.
119
+ ▪️ Evaluation Benchmarks: Use the dataset as a benchmark to evaluate retrieval models’ ability to handle hard negatives.
120
+
121
+ ## Dataset Creation Process
122
+
123
+ ✔️ Original Data: The Arabic subset of the Mr. TyDi dataset [Mr. TyDi dataset](https://huggingface.co/datasets/castorini/mr-tydi) was used as the foundation.
124
+ ✔️ Embedding Model: An Arabic embedding model [GATE](Omartificial-Intelligence-Space/GATE-AraBert-v1) was employed to calculate similarity scores between the positive and all negatives.
125
+ ✔️ Ranking Negatives: For each query, the negatives were ranked by descending similarity, and the top 4 were selected as hard negatives.
126
+ ✔️ Filtering and Validation: The dataset was validated to ensure the semantic integrity of negatives.
127
+
128
+ ## Limitations and Considerations
129
+
130
+ ▪️ Domain-Specific Bias: The embedding model might favor specific domains, impacting the selection of negatives.
131
+ ▪️ Similarity Metric: The dataset relies on the embedding model's similarity scores, which may not perfectly align with human judgment.
132
+
133
+ ### Citation Information
134
+
135
+ If you use this dataset in your research, please cite the original Mr. TyDi paper and this dataset as follows:
136
+
137
+ ```
138
+ @article{mrtydi,
139
+ title={{Mr. TyDi}: A Multi-lingual Benchmark for Dense Retrieval},
140
+ author={Xinyu Zhang and Xueguang Ma and Peng Shi and Jimmy Lin},
141
+ year={2021},
142
+ journal={arXiv:2108.08787},
143
+ }
144
+
145
+ @dataset{Omartificial-Intelligence-Space,
146
+ title={Arabic With Ranked Hard Negatives},
147
+ author={Omer Nacar},
148
+ year={2024},
149
+ note={Hugging Face Dataset Repository}
150
+ }
151
+ ```