Mehd1SLH commited on
Commit
3a50172
·
verified ·
1 Parent(s): eb6a195

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +157 -0
README.md ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: mit
5
+ task_categories:
6
+ - text-classification
7
+ task_ids:
8
+ - binary-classification
9
+ pretty_name: Project Sentinel – Semantic Filtering Dataset
10
+ ---
11
+
12
+ # Project Sentinel – Semantic Filtering Dataset
13
+
14
+ ## Dataset Summary
15
+
16
+ This dataset is designed to train and evaluate **lightweight semantic filtering models** for **Retrieval-Augmented Generation (RAG)** systems deployed in **resource-constrained / edge environments**.
17
+
18
+ It supports **binary classification** of `(query, candidate_sentence)` pairs into:
19
+
20
+ - **1 – Supporting Fact**: Factually useful evidence required to answer the query
21
+ - **0 – Distractor**: Topically similar but factually insufficient or misleading text
22
+
23
+ The dataset was created to address the *hallucination-by-distraction* failure mode commonly observed in local RAG pipelines.
24
+
25
+ This dataset was used to fine-tune a **4-layer TinyBERT cross-encoder** for the *Project Sentinel* semantic gatekeeping module.
26
+
27
+ ---
28
+
29
+ ## Supported Tasks
30
+
31
+ - Semantic filtering
32
+ - Evidence verification
33
+ - Hallucination reduction in RAG
34
+ - Binary text classification
35
+
36
+ ---
37
+
38
+ ## Dataset Structure
39
+
40
+ The dataset consists of **sentence-level query–evidence pairs** derived from the **HotpotQA (Distractor) dataset**.
41
+
42
+ Each sample follows the structure:
43
+
44
+ | Field | Type | Description |
45
+ |-----|------|------------|
46
+ | `query` | string | Natural language question |
47
+ | `sentence` | string | Candidate sentence extracted from context |
48
+ | `label` | int | 1 = supporting fact, 0 = distractor |
49
+
50
+ ---
51
+
52
+ ## Dataset Splits
53
+
54
+ | Split | Samples |
55
+ |------|--------|
56
+ | Train | 69,101 |
57
+ | Validation | 7,006 |
58
+
59
+ The class distribution is intentionally **imbalanced**, reflecting real-world retrieval conditions where distractors vastly outnumber true evidence.
60
+
61
+ ---
62
+
63
+ ## Data Construction
64
+
65
+ ### Source Dataset
66
+
67
+ - **HotpotQA – Distractor Setting**
68
+ - Multi-hop QA dataset with explicit annotations for supporting facts and distractor paragraphs
69
+
70
+ ### Positive Samples
71
+
72
+ - Extracted exclusively from annotated *supporting fact sentences*
73
+ - Based on `(title, sentence index)` ground-truth supervision
74
+
75
+ ### Negative Samples
76
+
77
+ - Non-annotated sentences from gold paragraphs *(hard negatives)*
78
+ - Sentences from distractor paragraphs intentionally selected for topical similarity
79
+
80
+ This strategy produces **adversarial negatives** closely matching real retrieval errors.
81
+
82
+ ---
83
+
84
+ ## Preprocessing Pipeline
85
+
86
+ - Removal of null or malformed samples
87
+ - Sentence-level deduplication
88
+ - Text normalization and whitespace cleanup
89
+ - Controlled negative sampling
90
+ - Label integrity verification
91
+
92
+ ---
93
+
94
+ ## Input Representation
95
+
96
+ The dataset is intended for **cross-encoder architectures**.
97
+
98
+ Model input format:
99
+
100
+ ```
101
+ [CLS] query [SEP] sentence [SEP]
102
+ ```
103
+
104
+ - Maximum sequence length: 512 tokens
105
+ - Designed for TinyBERT / MiniLM-style encoders
106
+
107
+ ---
108
+
109
+ ## Class Imbalance Handling
110
+
111
+ Due to natural imbalance, training is expected to use:
112
+
113
+ - **Weighted cross-entropy loss**
114
+ - Recall-preserving thresholds
115
+
116
+ This ensures evidence recall is prioritized over aggressive filtering.
117
+
118
+ ---
119
+
120
+ ## Intended Use
121
+
122
+ ✔ Training semantic gatekeepers for RAG
123
+ ✔ Edge-deployed LLM pipelines
124
+ ✔ Hallucination suppression
125
+ ✔ Early-exit decision systems
126
+
127
+ ---
128
+
129
+ ## Limitations
130
+
131
+ - Derived from Wikipedia-based QA (HotpotQA)
132
+ - English-only
133
+ - Sentence-level relevance only (not passage-level)
134
+
135
+ Performance may vary when applied to highly domain-specific corpora.
136
+
137
+ ---
138
+
139
+ ## Citation
140
+
141
+ If you use this dataset, please cite:
142
+
143
+ ```
144
+ @article{salih2025sentinel,
145
+ title={Project Sentinel: Lightweight Semantic Filtering for Edge RAG},
146
+ author={Salih, El Mehdi and Ait El Mouden, Khaoula and Akchouch, Abdelhakim},
147
+ year={2025}
148
+ }
149
+ ```
150
+
151
+ ---
152
+
153
+ ## Contact
154
+
155
+ **El Mehdi Salih**
156
+ Mohammed V University – Rabat
157
+ Email: elmehdi.salih@um5.ac.ma