Commit
8fc6b4a
·
verified ·
1 Parent(s): 3ed8b30

Add new SparseEncoder model

Browse files
README.md ADDED
@@ -0,0 +1,469 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: distilbert/distilbert-base-multilingual-cased
3
+ datasets:
4
+ - Omartificial-Intelligence-Space/Arabic-natural-questions
5
+ language:
6
+ - ar
7
+ library_name: sentence-transformers
8
+ license: apache-2.0
9
+ pipeline_tag: feature-extraction
10
+ tags:
11
+ - sentence-transformers
12
+ - sparse-encoder
13
+ - sparse
14
+ - asymmetric
15
+ - inference-free
16
+ - splade
17
+ - generated_from_trainer
18
+ - dataset_size:99000
19
+ - loss:SpladeLoss
20
+ - loss:SparseMultipleNegativesRankingLoss
21
+ - loss:FlopsLoss
22
+ widget:
23
+ - text: رولين (أغنية ليمب بيزكيت) تم تصوير الفيديو الموسيقي على قمة البرج الجنوبي
24
+ لمركز التجارة العالمي السابق في مدينة نيويورك. يتميز مقدمة بين ستيلر وستيفن دورف
25
+ يخطئون فريد ديرست لخادم ويعطيه مفاتيح بنتلي ازور. كما يقوم برقص كوميدي هو الرقص
26
+ السريع السيد ويجلز. بقية الفيديو لديها العديد من التخفيضات لدورست وزملائه في الفرقة
27
+ يشنقون من بنتلي أثناء قيادتهم حول مانهاتن. الأغنية التي يعزفها بن ستيلر في البداية
28
+ هي "جيلي" من نفس الألبوم. كما يضم الفيديو مشاهد فريد ديرست مع خمس فتيات يرقصن
29
+ في غرفة. تم تصوير الفيديو في نفس الوقت تقريبًا مع فيلم زولاندر ، والذي يفسر مظهر
30
+ ستيلر ودورف. يحتوي فريد ديرست على ظهور كوميدي صغير في ذلك الفيلم.
31
+ - text: حياة الجناح على سطح السفينة حياة الجناح على سطح السفينة هو مسلسل كوميدي أمريكي
32
+ تم بثه على قناة ديزني من 26 سبتمبر 2008 إلى 6 مايو 2011. إنه تتمة / تغيير لسلسلة
33
+ قناة ديزني الأصلية حياة زاك وكودي. السلسلة تتبع الأخوين التوأمين زاك وكودي مارتن
34
+ وريثة الفندق لندن تبتون في بيئة جديدة ، إس إس تبتون ، حيث يلتقيان بدروس في "مدرسة
35
+ سبعة بحار" ويلتقيان بيللي بيكيت بينما يدير السيد موزبي السفينة. تسافر السفينة
36
+ في جميع أنحاء العالم إلى دول مثل إيطاليا وفرنسا واليونان والهند والسويد والمملكة
37
+ المتحدة حيث تواجه الشخصيات ثقافات ومغامرات ومواقف مختلفة.
38
+ - text: الذي لعب دور الموسيقي في فيلم المحاربين
39
+ - text: الحفرة الحفرة هي أداة مزودة بمرفق أداة قطع أو مرفق أداة قيادة ، عادةً ما تكون
40
+ عبارة عن عدة حفر أو عدة حفر ، وتستخدم لحفر الثقوب في مختلف المواد أو تثبيت مختلف
41
+ المواد معًا. يتم التمسك بالعقدة في أحد أطراف الحفرة وتدويرها أثناء الضغط عليها
42
+ ضد المادة المستهدفة. يقوم طرف وأحياناً حواف أداة القطع بعمل القطع في المادة المستهدفة.
43
+ قد يكون ذلك قطع قطع رقيقة (حفرات التواء أو حفرة النفط) ، وتحطيم الجسيمات الصغيرة
44
+ (حفرة النفط) ، وتحطيم وإزالة قطعة العمل (حفرة البناء SDS) ، أو عمليات الاعتراض
45
+ أو التدفق أو عمليات أخرى.
46
+ - text: ليونيل ميسي ولد وترعرع في وسط الأرجنتين، تم تشخيص ميسي بضعف هرمون النمو في
47
+ طفولته. في سن 13 عاما، انتقل إلى إسبانيا للانضمام إلى برشلونة، التي وافقت على
48
+ دفع تكاليف علاجه الطبي. بعد التقدم السريع من خلال أكاديمية شباب برشلونة، ظهر ميسي
49
+ لأول مرة في التنافسية في سن 17 عاما في أكتوبر 2004. على الرغم من كونها عرضة للإصابة
50
+ خلال مسيرته المبكرة، فقد أسس نفسه كلاعبًا أساسيًا للنادي في غضون السنوات الثلاث
51
+ التالية، حيث أنهى 2007 كنهائي لكل من جائزة كرة الذهب و لاعب العالم للفيفا للعام،
52
+ وهو إنجاز كرره في العام التالي. جاءت أول حملة غير منقطعة له في موسم 2008-2009,
53
+ حيث ساعد برشلونة على تحقيق أول ثلاثية في كرة القدم الإسبانية. في سن 22 عاما، فاز
54
+ ميسي بجائزة كرة الذهب و لاعب العالم للفيفا بالعام عن طريق حافة التصويت.
55
+ ---
56
+
57
+ # Inference-free SPLADE distilbert-base-multilingual-cased trained on Natural-Questions tuples
58
+
59
+ This is a [Asymmetric Inference-free SPLADE Sparse Encoder](https://www.sbert.net/docs/sparse_encoder/usage/usage.html) model finetuned from [distilbert/distilbert-base-multilingual-cased](https://huggingface.co/distilbert/distilbert-base-multilingual-cased) on the [arabic-natural-questions](https://huggingface.co/datasets/Omartificial-Intelligence-Space/Arabic-natural-questions) dataset using the [sentence-transformers](https://www.SBERT.net) library. It maps sentences & paragraphs to a 119547-dimensional sparse vector space and can be used for semantic search and sparse retrieval.
60
+ ## Model Details
61
+
62
+ ### Model Description
63
+ - **Model Type:** Asymmetric Inference-free SPLADE Sparse Encoder
64
+ - **Base model:** [distilbert/distilbert-base-multilingual-cased](https://huggingface.co/distilbert/distilbert-base-multilingual-cased) <!-- at revision 45c032ab32cc946ad88a166f7cb282f58c753c2e -->
65
+ - **Maximum Sequence Length:** 512 tokens
66
+ - **Output Dimensionality:** 119547 dimensions
67
+ - **Similarity Function:** Dot Product
68
+ - **Training Dataset:**
69
+ - [arabic-natural-questions](https://huggingface.co/datasets/Omartificial-Intelligence-Space/Arabic-natural-questions)
70
+ - **Language:** ar
71
+ - **License:** apache-2.0
72
+
73
+ ### Model Sources
74
+
75
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
76
+ - **Documentation:** [Sparse Encoder Documentation](https://www.sbert.net/docs/sparse_encoder/usage/usage.html)
77
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
78
+ - **Hugging Face:** [Sparse Encoders on Hugging Face](https://huggingface.co/models?library=sentence-transformers&other=sparse-encoder)
79
+
80
+ ### Full Model Architecture
81
+
82
+ ```
83
+ SparseEncoder(
84
+ (0): Router(
85
+ (query_0_SparseStaticEmbedding): SparseStaticEmbedding({'frozen': False}, dim=119547, tokenizer=DistilBertTokenizerFast)
86
+ (document_0_MLMTransformer): MLMTransformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'DistilBertForMaskedLM'})
87
+ (document_1_SpladePooling): SpladePooling({'pooling_strategy': 'max', 'activation_function': 'relu', 'word_embedding_dimension': 119547})
88
+ )
89
+ )
90
+ ```
91
+
92
+ ## Usage
93
+
94
+ ### Direct Usage (Sentence Transformers)
95
+
96
+ First install the Sentence Transformers library:
97
+
98
+ ```bash
99
+ pip install -U sentence-transformers
100
+ ```
101
+
102
+ Then you can load this model and run inference.
103
+ ```python
104
+ from sentence_transformers import SparseEncoder
105
+
106
+ # Download from the 🤗 Hub
107
+ model = SparseEncoder("Omartificial-Intelligence-Space/inference-free-splade-distilbert-base-Arabic-cased-nq")
108
+ # Run inference
109
+ queries = [
110
+ "\u0643\u0645 \u0643\u0627\u0646 \u0639\u0645\u0631 \u0645\u064a\u0633\u064a \u0639\u0646\u062f\u0645\u0627 \u0628\u062f\u0623 \u062d\u064a\u0627\u062a\u0647 \u0627\u0644\u0645\u0647\u0646\u064a\u0629",
111
+ ]
112
+ documents = [
113
+ 'ليونيل ميسي ولد وترعرع في وسط الأرجنتين، تم تشخيص ميسي بضعف هرمون النمو في طفولته. في سن 13 عاما، انتقل إلى إسبانيا للانضمام إلى برشلونة، التي وافقت على دفع تكاليف علاجه الطبي. بعد التقدم السريع من خلال أكاديمية شباب برشلونة، ظهر ميسي لأول مرة في التنافسية في سن 17 عاما في أكتوبر 2004. على الرغم من كونها عرضة للإصابة خلال مسيرته المبكرة، فقد أسس نفسه كلاعبًا أساسيًا للنادي في غضون السنوات الثلاث التالية، حيث أنهى 2007 كنهائي لكل من جائزة كرة الذهب و لاعب العالم للفيفا للعام، وهو إنجاز كرره في العام التالي. جاءت أول حملة غير منقطعة له في موسم 2008-2009, حيث ساعد برشلونة على تحقيق أول ثلاثية في كرة القدم الإسبانية. في سن 22 عاما، فاز ميسي بجائزة كرة الذهب و لاعب العالم للفيفا بالعام عن طريق حافة التصويت.',
114
+ 'علم روسيا هناك تفسيرات مختلفة لما تعنيه الألوان على العلم الروسي. الأكثر شعبية هي كما يلي: اللون الأبيض يرمز إلى النبلاء والصراحة، والأزرق للاولاء والصدق والعفاف والعفاف، والأحمر للشجاعة والكرم والحب. [1]',
115
+ 'جمهورية تكساس جمهورية تكساس (بالإسبانية:RepÃoblica de Tejas) كانت دولة مستقلة ذات سيادة في أمريكا الشمالية كانت موجودة من 2 مارس 1836 إلى 19 فبراير 1846. تحدها المكسيك من الغرب والجنوب الغربي، وخليج المكسيك من الجنوب الشرقي، ولايتين أمريكيتين لويزيانا وأركنساس من الشرق والشمال الشرقي، وأراضي الولايات المتحدة التي تشمل أجزاء من ولايات أوكلاهوما وأكنساس وكولورادو ووايومنغ الحالية في الولايات المتحدة من الشمال. كان مواطنو الجمهورية يعرفون باسم تكسيين.',
116
+ ]
117
+ query_embeddings = model.encode_query(queries)
118
+ document_embeddings = model.encode_document(documents)
119
+ print(query_embeddings.shape, document_embeddings.shape)
120
+ # [1, 119547] [3, 119547]
121
+
122
+ # Get the similarity scores for the embeddings
123
+ similarities = model.similarity(query_embeddings, document_embeddings)
124
+ print(similarities)
125
+ # tensor([[6.5963, 0.2351, 1.0142]])
126
+ ```
127
+
128
+ <!--
129
+ ### Direct Usage (Transformers)
130
+
131
+ <details><summary>Click to see the direct usage in Transformers</summary>
132
+
133
+ </details>
134
+ -->
135
+
136
+ <!--
137
+ ### Downstream Usage (Sentence Transformers)
138
+
139
+ You can finetune this model on your own dataset.
140
+
141
+ <details><summary>Click to expand</summary>
142
+
143
+ </details>
144
+ -->
145
+
146
+ <!--
147
+ ### Out-of-Scope Use
148
+
149
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
150
+ -->
151
+
152
+ <!--
153
+ ## Bias, Risks and Limitations
154
+
155
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
156
+ -->
157
+
158
+ <!--
159
+ ### Recommendations
160
+
161
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
162
+ -->
163
+
164
+ ## Training Details
165
+
166
+ ### Training Dataset
167
+
168
+ #### arabic-natural-questions
169
+
170
+ * Dataset: [arabic-natural-questions](https://huggingface.co/datasets/Omartificial-Intelligence-Space/Arabic-natural-questions) at [2a52bde](https://huggingface.co/datasets/Omartificial-Intelligence-Space/Arabic-natural-questions/tree/2a52bde67a6aff666932f11b9d922d9565e7cead)
171
+ * Size: 99,000 training samples
172
+ * Columns: <code>query</code> and <code>answer</code>
173
+ * Approximate statistics based on the first 1000 samples:
174
+ | | query | answer |
175
+ |:--------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
176
+ | type | string | string |
177
+ | details | <ul><li>min: 7 tokens</li><li>mean: 15.69 tokens</li><li>max: 35 tokens</li></ul> | <ul><li>min: 10 tokens</li><li>mean: 166.92 tokens</li><li>max: 512 tokens</li></ul> |
178
+ * Samples:
179
+ | query | answer |
180
+ |:-----------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
181
+ | <code>الذي لعب دور الأب في أبي لا يُوعَظ</code> | <code>أليكس ماك آرثر (بالإنجليزية: Alex McArthur) (ولد في 6 مارس 1957) هو ممثل أمريكي.</code> |
182
+ | <code>أين كان موقع معركة هستيينغز</code> | <code>معركة هستنغز معركة هستنغز[1] عُقدت في 14 أكتوبر 1066 بين الجيش النورماندي الفرنسي لويليام دوق نورماندي والجيش الإنجليزي بقيادة الملك الأنجلو ساكسوني هارولد غودوينسون، وبدأت بذلك الفتح النورماني لإنجلترا. وقعت على بعد حوالي 7 أميال (11 كيلومتر) شمال غرب هستنغز، بالقرب من بلدة باتل الحالية في شرق ساسكس، وكانت انتصاراً نورماندياً حاسماً.</code> |
183
+ | <code>كم عدد الجراء الذي يمكن أن يولدها الكلب</code> | <code>التكاثر الكلابي تم تحديد أكبر حجم للقمامة حتى الآن من قبل مستطيل نابولي في مانيا ، كامبريدجشير ، المملكة المتحدة في 29 نوفمبر 2004 ؛ كان القمامة 24 جروًا. [1]</code> |
184
+ * Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
185
+ ```json
186
+ {
187
+ "loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score')",
188
+ "document_regularizer_weight": 0.003,
189
+ "query_regularizer_weight": 0
190
+ }
191
+ ```
192
+
193
+ ### Evaluation Dataset
194
+
195
+ #### arabic-natural-questions
196
+
197
+ * Dataset: [arabic-natural-questions](https://huggingface.co/datasets/Omartificial-Intelligence-Space/Arabic-natural-questions) at [2a52bde](https://huggingface.co/datasets/Omartificial-Intelligence-Space/Arabic-natural-questions/tree/2a52bde67a6aff666932f11b9d922d9565e7cead)
198
+ * Size: 1,000 evaluation samples
199
+ * Columns: <code>query</code> and <code>answer</code>
200
+ * Approximate statistics based on the first 1000 samples:
201
+ | | query | answer |
202
+ |:--------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
203
+ | type | string | string |
204
+ | details | <ul><li>min: 6 tokens</li><li>mean: 15.74 tokens</li><li>max: 30 tokens</li></ul> | <ul><li>min: 21 tokens</li><li>mean: 170.43 tokens</li><li>max: 512 tokens</li></ul> |
205
+ * Samples:
206
+ | query | answer |
207
+ |:---------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
208
+ | <code>أين نهر تيبر في إيطاليا</code> | <code>التايبر (/ taɪbər /، اللاتينية: Tiberis، [1] الإيطالية: Tevere [teːvere]) [2] هو ثالث أطول نهر في إيطاليا، يرتفع في جبال أبينين في إيميليا-رومانيا ويتدفق 406 كيلومتر (252 ميل) عبر توسكانا وأومبريا ولاتسيو، حيث ينضم إليه نهر أنين، إلى بحر تيرينيان، بين أوستيا وفيوميسينو. [3] يستنزف حوض يقدر بنحو 17،375 كيلومتر مربع (6،709 ميل مربع). حقق النهر شهرة دائمة باعتباره مجرى المياه الرئيسي لمدينة روما، التي تأسست على ضفافها الشرقية.</code> |
209
+ | <code>ما نوع السيارة التي يقودها جاي غاتسبي</code> | <code>جي غاتسبي في منزل بيوكانان ، قرر جوردان بيكر ، نيك ، جي ، والبيوكانانز زيارة مدينة نيويورك. استعار توم سيارة رولز رويس الصفراء من غاتسبي للقيادة إلى المدينة. في الطريق إلى مدينة نيويورك ، قام توم بتحويل محطة بنزين في "وادي الرماد" ، وهو جزء من لونغ آيلاند. يشارك المالك ، جورج ويلسون ، قلقه من أن زوجته ، ميرتل ، قد تكون على علاقة غرامية. هذا يزعج توم ، الذي كان على علاقة غرامية مع ميرتل ، ويغادر في عجلة من أمره.</code> |
210
+ | <code>من يغني إذا كنت أستطيع أن أحلم بك</code> | <code>"I Can Dream About You" هي أغنية أداءها المغني الأمريكي دان هارتمان في ألبوم الموسيقى الصوتية لفيلم Streets of Fire. تم إصداره في عام 1984 كأغنية فردية من الموسيقى الصوتية ، وشملت في ألبوم هارتمان I Can Dream About You ، حيث وصلت إلى المركز السادس في Billboard Hot 100. [1]</code> |
211
+ * Loss: [<code>SpladeLoss</code>](https://sbert.net/docs/package_reference/sparse_encoder/losses.html#spladeloss) with these parameters:
212
+ ```json
213
+ {
214
+ "loss": "SparseMultipleNegativesRankingLoss(scale=1.0, similarity_fct='dot_score')",
215
+ "document_regularizer_weight": 0.003,
216
+ "query_regularizer_weight": 0
217
+ }
218
+ ```
219
+
220
+ ### Training Hyperparameters
221
+ #### Non-Default Hyperparameters
222
+
223
+ - `eval_strategy`: steps
224
+ - `per_device_train_batch_size`: 16
225
+ - `per_device_eval_batch_size`: 16
226
+ - `learning_rate`: 2e-05
227
+ - `num_train_epochs`: 1
228
+ - `warmup_ratio`: 0.1
229
+ - `fp16`: True
230
+ - `batch_sampler`: no_duplicates
231
+ - `router_mapping`: {'query': 'query', 'answer': 'document'}
232
+ - `learning_rate_mapping`: {'SparseStaticEmbedding\\.weight': 0.001}
233
+
234
+ #### All Hyperparameters
235
+ <details><summary>Click to expand</summary>
236
+
237
+ - `overwrite_output_dir`: False
238
+ - `do_predict`: False
239
+ - `eval_strategy`: steps
240
+ - `prediction_loss_only`: True
241
+ - `per_device_train_batch_size`: 16
242
+ - `per_device_eval_batch_size`: 16
243
+ - `per_gpu_train_batch_size`: None
244
+ - `per_gpu_eval_batch_size`: None
245
+ - `gradient_accumulation_steps`: 1
246
+ - `eval_accumulation_steps`: None
247
+ - `torch_empty_cache_steps`: None
248
+ - `learning_rate`: 2e-05
249
+ - `weight_decay`: 0.0
250
+ - `adam_beta1`: 0.9
251
+ - `adam_beta2`: 0.999
252
+ - `adam_epsilon`: 1e-08
253
+ - `max_grad_norm`: 1.0
254
+ - `num_train_epochs`: 1
255
+ - `max_steps`: -1
256
+ - `lr_scheduler_type`: linear
257
+ - `lr_scheduler_kwargs`: {}
258
+ - `warmup_ratio`: 0.1
259
+ - `warmup_steps`: 0
260
+ - `log_level`: passive
261
+ - `log_level_replica`: warning
262
+ - `log_on_each_node`: True
263
+ - `logging_nan_inf_filter`: True
264
+ - `save_safetensors`: True
265
+ - `save_on_each_node`: False
266
+ - `save_only_model`: False
267
+ - `restore_callback_states_from_checkpoint`: False
268
+ - `no_cuda`: False
269
+ - `use_cpu`: False
270
+ - `use_mps_device`: False
271
+ - `seed`: 42
272
+ - `data_seed`: None
273
+ - `jit_mode_eval`: False
274
+ - `use_ipex`: False
275
+ - `bf16`: False
276
+ - `fp16`: True
277
+ - `fp16_opt_level`: O1
278
+ - `half_precision_backend`: auto
279
+ - `bf16_full_eval`: False
280
+ - `fp16_full_eval`: False
281
+ - `tf32`: None
282
+ - `local_rank`: 0
283
+ - `ddp_backend`: None
284
+ - `tpu_num_cores`: None
285
+ - `tpu_metrics_debug`: False
286
+ - `debug`: []
287
+ - `dataloader_drop_last`: False
288
+ - `dataloader_num_workers`: 0
289
+ - `dataloader_prefetch_factor`: None
290
+ - `past_index`: -1
291
+ - `disable_tqdm`: False
292
+ - `remove_unused_columns`: True
293
+ - `label_names`: None
294
+ - `load_best_model_at_end`: False
295
+ - `ignore_data_skip`: False
296
+ - `fsdp`: []
297
+ - `fsdp_min_num_params`: 0
298
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
299
+ - `fsdp_transformer_layer_cls_to_wrap`: None
300
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
301
+ - `deepspeed`: None
302
+ - `label_smoothing_factor`: 0.0
303
+ - `optim`: adamw_torch
304
+ - `optim_args`: None
305
+ - `adafactor`: False
306
+ - `group_by_length`: False
307
+ - `length_column_name`: length
308
+ - `ddp_find_unused_parameters`: None
309
+ - `ddp_bucket_cap_mb`: None
310
+ - `ddp_broadcast_buffers`: False
311
+ - `dataloader_pin_memory`: True
312
+ - `dataloader_persistent_workers`: False
313
+ - `skip_memory_metrics`: True
314
+ - `use_legacy_prediction_loop`: False
315
+ - `push_to_hub`: False
316
+ - `resume_from_checkpoint`: None
317
+ - `hub_model_id`: None
318
+ - `hub_strategy`: every_save
319
+ - `hub_private_repo`: None
320
+ - `hub_always_push`: False
321
+ - `gradient_checkpointing`: False
322
+ - `gradient_checkpointing_kwargs`: None
323
+ - `include_inputs_for_metrics`: False
324
+ - `include_for_metrics`: []
325
+ - `eval_do_concat_batches`: True
326
+ - `fp16_backend`: auto
327
+ - `push_to_hub_model_id`: None
328
+ - `push_to_hub_organization`: None
329
+ - `mp_parameters`:
330
+ - `auto_find_batch_size`: False
331
+ - `full_determinism`: False
332
+ - `torchdynamo`: None
333
+ - `ray_scope`: last
334
+ - `ddp_timeout`: 1800
335
+ - `torch_compile`: False
336
+ - `torch_compile_backend`: None
337
+ - `torch_compile_mode`: None
338
+ - `dispatch_batches`: None
339
+ - `split_batches`: None
340
+ - `include_tokens_per_second`: False
341
+ - `include_num_input_tokens_seen`: False
342
+ - `neftune_noise_alpha`: None
343
+ - `optim_target_modules`: None
344
+ - `batch_eval_metrics`: False
345
+ - `eval_on_start`: False
346
+ - `use_liger_kernel`: False
347
+ - `eval_use_gather_object`: False
348
+ - `average_tokens_across_devices`: False
349
+ - `prompts`: None
350
+ - `batch_sampler`: no_duplicates
351
+ - `multi_dataset_batch_sampler`: proportional
352
+ - `router_mapping`: {'query': 'query', 'answer': 'document'}
353
+ - `learning_rate_mapping`: {'SparseStaticEmbedding\\.weight': 0.001}
354
+
355
+ </details>
356
+
357
+ ### Training Logs
358
+ | Epoch | Step | Training Loss | Validation Loss |
359
+ |:------:|:----:|:-------------:|:---------------:|
360
+ | 0.0323 | 200 | 1.1587 | - |
361
+ | 0.0646 | 400 | 0.6549 | - |
362
+ | 0.0970 | 600 | 0.5782 | - |
363
+ | 0.1293 | 800 | 0.477 | - |
364
+ | 0.1616 | 1000 | 0.4708 | 0.4608 |
365
+ | 0.1939 | 1200 | 0.4667 | - |
366
+ | 0.2262 | 1400 | 0.4701 | - |
367
+ | 0.2586 | 1600 | 0.448 | - |
368
+ | 0.2909 | 1800 | 0.4574 | - |
369
+ | 0.3232 | 2000 | 0.4382 | 0.4126 |
370
+ | 0.3555 | 2200 | 0.4608 | - |
371
+ | 0.3878 | 2400 | 0.4083 | - |
372
+ | 0.4202 | 2600 | 0.4296 | - |
373
+ | 0.4525 | 2800 | 0.4295 | - |
374
+ | 0.4848 | 3000 | 0.4093 | 0.3794 |
375
+ | 0.5171 | 3200 | 0.4323 | - |
376
+ | 0.5495 | 3400 | 0.3924 | - |
377
+ | 0.5818 | 3600 | 0.3609 | - |
378
+ | 0.6141 | 3800 | 0.3817 | - |
379
+ | 0.6464 | 4000 | 0.377 | 0.3553 |
380
+ | 0.6787 | 4200 | 0.3631 | - |
381
+ | 0.7111 | 4400 | 0.3668 | - |
382
+ | 0.7434 | 4600 | 0.372 | - |
383
+ | 0.7757 | 4800 | 0.3525 | - |
384
+ | 0.8080 | 5000 | 0.3732 | 0.3492 |
385
+ | 0.8403 | 5200 | 0.3669 | - |
386
+ | 0.8727 | 5400 | 0.368 | - |
387
+ | 0.9050 | 5600 | 0.3149 | - |
388
+ | 0.9373 | 5800 | 0.3446 | - |
389
+ | 0.9696 | 6000 | 0.3468 | 0.3380 |
390
+
391
+
392
+ ### Framework Versions
393
+ - Python: 3.10.13
394
+ - Sentence Transformers: 5.0.0
395
+ - Transformers: 4.47.1
396
+ - PyTorch: 2.4.1+cu121
397
+ - Accelerate: 1.2.1
398
+ - Datasets: 2.21.0
399
+ - Tokenizers: 0.21.0
400
+
401
+ ## Citation
402
+
403
+ ### BibTeX
404
+
405
+ #### Sentence Transformers
406
+ ```bibtex
407
+ @inproceedings{reimers-2019-sentence-bert,
408
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
409
+ author = "Reimers, Nils and Gurevych, Iryna",
410
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
411
+ month = "11",
412
+ year = "2019",
413
+ publisher = "Association for Computational Linguistics",
414
+ url = "https://arxiv.org/abs/1908.10084",
415
+ }
416
+ ```
417
+
418
+ #### SpladeLoss
419
+ ```bibtex
420
+ @misc{formal2022distillationhardnegativesampling,
421
+ title={From Distillation to Hard Negative Sampling: Making Sparse Neural IR Models More Effective},
422
+ author={Thibault Formal and Carlos Lassance and Benjamin Piwowarski and Stéphane Clinchant},
423
+ year={2022},
424
+ eprint={2205.04733},
425
+ archivePrefix={arXiv},
426
+ primaryClass={cs.IR},
427
+ url={https://arxiv.org/abs/2205.04733},
428
+ }
429
+ ```
430
+
431
+ #### SparseMultipleNegativesRankingLoss
432
+ ```bibtex
433
+ @misc{henderson2017efficient,
434
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
435
+ author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
436
+ year={2017},
437
+ eprint={1705.00652},
438
+ archivePrefix={arXiv},
439
+ primaryClass={cs.CL}
440
+ }
441
+ ```
442
+
443
+ #### FlopsLoss
444
+ ```bibtex
445
+ @article{paria2020minimizing,
446
+ title={Minimizing flops to learn efficient sparse representations},
447
+ author={Paria, Biswajit and Yeh, Chih-Kuan and Yen, Ian EH and Xu, Ning and Ravikumar, Pradeep and P{'o}czos, Barnab{'a}s},
448
+ journal={arXiv preprint arXiv:2004.05665},
449
+ year={2020}
450
+ }
451
+ ```
452
+
453
+ <!--
454
+ ## Glossary
455
+
456
+ *Clearly define terms in order to be accessible across audiences.*
457
+ -->
458
+
459
+ <!--
460
+ ## Model Card Authors
461
+
462
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
463
+ -->
464
+
465
+ <!--
466
+ ## Model Card Contact
467
+
468
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
469
+ -->
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "SparseEncoder",
3
+ "__version__": {
4
+ "sentence_transformers": "5.0.0",
5
+ "transformers": "4.47.1",
6
+ "pytorch": "2.4.1+cu121"
7
+ },
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "dot"
14
+ }
document_0_MLMTransformer/config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "distilbert/distilbert-base-multilingual-cased",
3
+ "activation": "gelu",
4
+ "architectures": [
5
+ "DistilBertForMaskedLM"
6
+ ],
7
+ "attention_dropout": 0.1,
8
+ "dim": 768,
9
+ "dropout": 0.1,
10
+ "hidden_dim": 3072,
11
+ "initializer_range": 0.02,
12
+ "max_position_embeddings": 512,
13
+ "model_type": "distilbert",
14
+ "n_heads": 12,
15
+ "n_layers": 6,
16
+ "output_past": true,
17
+ "pad_token_id": 0,
18
+ "qa_dropout": 0.1,
19
+ "seq_classif_dropout": 0.2,
20
+ "sinusoidal_pos_embds": false,
21
+ "tie_weights_": true,
22
+ "torch_dtype": "float32",
23
+ "transformers_version": "4.47.1",
24
+ "vocab_size": 119547
25
+ }
document_0_MLMTransformer/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4cffa45c568ed831e0e529f003408b22b5953361e8885846e20c27f1d4a71515
3
+ size 541795684
document_0_MLMTransformer/sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
document_0_MLMTransformer/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
document_0_MLMTransformer/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
document_0_MLMTransformer/tokenizer_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": false,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 512,
50
+ "pad_token": "[PAD]",
51
+ "sep_token": "[SEP]",
52
+ "strip_accents": null,
53
+ "tokenize_chinese_chars": true,
54
+ "tokenizer_class": "DistilBertTokenizer",
55
+ "unk_token": "[UNK]"
56
+ }
document_0_MLMTransformer/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
document_1_SpladePooling/config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "pooling_strategy": "max",
3
+ "activation_function": "relu",
4
+ "word_embedding_dimension": 119547
5
+ }
modules.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Router"
7
+ }
8
+ ]
query_0_SparseStaticEmbedding/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "frozen": false
3
+ }
query_0_SparseStaticEmbedding/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a334363be55615a4f042c4ed75ab849e9a5e831bf57e9403ca65047eca28c5c
3
+ size 478268
query_0_SparseStaticEmbedding/special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
query_0_SparseStaticEmbedding/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
query_0_SparseStaticEmbedding/tokenizer_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": false,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 512,
50
+ "pad_token": "[PAD]",
51
+ "sep_token": "[SEP]",
52
+ "strip_accents": null,
53
+ "tokenize_chinese_chars": true,
54
+ "tokenizer_class": "DistilBertTokenizer",
55
+ "unk_token": "[UNK]"
56
+ }
query_0_SparseStaticEmbedding/vocab.txt ADDED
The diff for this file is too large to render. See raw diff
 
router_config.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "types": {
3
+ "query_0_SparseStaticEmbedding": "sentence_transformers.sparse_encoder.models.SparseStaticEmbedding.SparseStaticEmbedding",
4
+ "document_0_MLMTransformer": "sentence_transformers.sparse_encoder.models.MLMTransformer.MLMTransformer",
5
+ "document_1_SpladePooling": "sentence_transformers.sparse_encoder.models.SpladePooling.SpladePooling"
6
+ },
7
+ "structure": {
8
+ "query": [
9
+ "query_0_SparseStaticEmbedding"
10
+ ],
11
+ "document": [
12
+ "document_0_MLMTransformer",
13
+ "document_1_SpladePooling"
14
+ ]
15
+ },
16
+ "parameters": {
17
+ "default_route": "document",
18
+ "allow_empty_key": true
19
+ }
20
+ }