Text Ranking
mbrack commited on
Commit
0eb58d1
·
verified ·
1 Parent(s): a4dc17a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +275 -273
README.md CHANGED
@@ -1,273 +1,275 @@
1
- ---
2
- license: apache-2.0
3
- language:
4
- # slavic
5
- - bg
6
- - cs
7
- - hr
8
- - mk
9
- - pl
10
- - sk
11
- - sl
12
- - sr
13
- - uk
14
-
15
- # germanic
16
- - da
17
- - de
18
- - is
19
- - nl
20
- - no
21
- - sv
22
-
23
- # romance
24
- - ca
25
- - es
26
- - fr
27
- - gl
28
- - it
29
- - pt
30
- - ro
31
-
32
- # uralic
33
- - et
34
- - fi
35
- - hu
36
-
37
- # baltic
38
- - lt
39
- - lv
40
-
41
- # singleton
42
- - el
43
- - ga
44
- - eu
45
- - mt
46
- - tr
47
- - sq
48
- - hy
49
-
50
-
51
- base_model:
52
- - Snowflake/snowflake-arctic-embed-m-v2.0
53
- pipeline_tag: text-ranking
54
- ---
55
- ## Summary
56
-
57
- A regression head that scores texts based on their educational value.
58
-
59
- <!-- This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1). -->
60
-
61
- ## Model Details
62
-
63
- ### Model Description
64
-
65
- This model is a regression head built on top of the `Snowflake/snowflake-arctic-embed-m-v2.0` embedding model. It assigns a score to text documents, representing their educational value on a scale from 0 (lowest) to 5 (highest). Since the underlying embedding model provides language-aligned embeddings, the regression head can be used for multiple languages.
66
-
67
- We provide checkpoints for three different training sets. These training sets were generated by letting a large language model (LLM) annotate 500k text documents. The following LLMs were used for annotation: Llama3.3-70B-it, Gemma-3-27B-it, and Mistral Small 3.1-24B-it. For each LLM, we also created training sets with balanced and unbalanced distributions of educational value scores. Checkpoints trained on balanced datasets are denoted with "balanced"; otherwise, they are denoted as "unbalanced".
68
-
69
-
70
-
71
-
72
- - **Developed by:** A collaboration between HessianAI, DFKI, Fraunhofer IAIS, Lamarr Institute, and TU Darmstadt.
73
- <!-- - **Funded by [optional]:** [More Information Needed] -->
74
- <!-- - **Shared by [optional]:** [More Information Needed] -->
75
- - **Model type:** Regression Head
76
- - **Language(s) (NLP):** Bulgarian, Czech, Croatian, Macedonian, Polish, Slovak, Slovenian, Serbian, Ukrainian, Danish, German, Icelandic, Dutch, Norwegian, Swedish, Catalan, Spanish, French, Galician, Italian, Portuguese, Romanian, Estonian, Finnish, Hungarian, Lithuanian, Latvian, Greek, Irish, Basque, Maltese, Turkish, Albanian, and Armenian.
77
- - **License:** [More Information Needed]
78
- <!-- - **Finetuned from model [optional]:** [More Information Needed] -->
79
-
80
- ### Model Sources [optional]
81
-
82
- <!-- Provide the basic links for the model. -->
83
-
84
- - **Repository:** [https://github.com/JQL-AI](https://github.com/JQL-AI)
85
- - **Paper:** [arXiv]()
86
- <!-- - **Demo:** [More Information Needed] -->
87
-
88
- <!-- ## Uses -->
89
-
90
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
91
-
92
- ### Direct Use
93
-
94
- The model is designed to quickly and efficiently assess the educational value of texts—significantly faster than querying a large language model (LLM) directly. This makes it particularly useful for building large, high-quality text datasets.
95
-
96
- ### Downstream Use
97
-
98
- In a downstream experiment, we demonstrate that training with high-quality texts selected by this model is faster and more effective than training with texts filtered only by heuristic methods. Details of our experiments can be found in the accompanying paper.
99
-
100
- <!-- ### Out-of-Scope Use -->
101
-
102
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
103
-
104
- <!-- [More Information Needed] -->
105
-
106
- <!-- ## Bias, Risks, and Limitations -->
107
-
108
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
109
-
110
- <!-- [More Information Needed] -->
111
-
112
- <!-- ### Recommendations -->
113
-
114
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
115
-
116
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
117
-
118
- ## How to Get Started with the Model
119
-
120
- Use the code below to get started with the model.
121
-
122
- ```python
123
- from utils.regression_head import RegressionHead
124
- from transformers.utils.hub import cached_file
125
- from utils.embedder import get_embedder_instance
126
- import torch
127
-
128
- # load embedder
129
- device = 'cuda'
130
- embedder = get_embedder_instance('Snowflake/snowflake-arctic-embed-m-v2.0', device, torch.bfloat16)
131
- # load JQL Edu annotation heads
132
- regression_head_checkpoints = {
133
- 'Edu-JQL-Gemma-SF': cached_file('Jackal-AI/JQL-Edu-Heads', 'checkpoints/edu-gemma-snowflake-balanced.ckpt'),
134
- 'Edu-JQL-Mistral-SF': cached_file('Jackal-AI/JQL-Edu-Heads', 'checkpoints/edu-mistral-snowflake-balanced.ckpt'),
135
- 'Edu-JQL-Llama-SF': cached_file('Jackal-AI/JQL-Edu-Heads', 'checkpoints/edu-llama-snowflake-balanced.ckpt'),
136
- }
137
- regression_heads = {}
138
- for name, path in regression_head_checkpoints.items():
139
- regression_heads[name] = RegressionHead.load_from_checkpoint(path, map_location=device).to(torch.bfloat16)
140
-
141
- # Given a single document
142
- doc = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'
143
- embeddings = embedder.embed([doc])
144
- scores = {}
145
- with torch.no_grad():
146
- for name, regression_head in regression_heads.items():
147
- scores[f'score_{name}'] = regression_head(embeddings).cpu().squeeze(1)
148
- ```
149
- <!--
150
- ## Training Details
151
-
152
- ### Training Data
153
-
154
- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering.
155
-
156
- [More Information Needed]
157
-
158
- ### Training Procedure
159
-
160
- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure.
161
-
162
- #### Preprocessing [optional]
163
-
164
- [More Information Needed]
165
-
166
-
167
- #### Training Hyperparameters
168
-
169
- - **Training regime:** [More Information Needed] fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision
170
-
171
- #### Speeds, Sizes, Times [optional]
172
-
173
- This section provides information about throughput, start/end time, checkpoint size if relevant, etc.
174
-
175
- [More Information Needed]
176
-
177
- ## Evaluation
178
-
179
- This section describes the evaluation protocols and provides the results.
180
-
181
- ### Testing Data, Factors & Metrics
182
-
183
- #### Testing Data
184
-
185
- This should link to a Dataset Card if possible.
186
-
187
- [More Information Needed]
188
-
189
- #### Factors
190
-
191
- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains.
192
-
193
- [More Information Needed]
194
-
195
- #### Metrics
196
-
197
- These are the evaluation metrics being used, ideally with a description of why.
198
-
199
- [More Information Needed]
200
-
201
- ### Results
202
-
203
- [More Information Needed]
204
-
205
- #### Summary
206
- -->
207
-
208
-
209
- <!-- ## Model Examination [optional] -->
210
-
211
- <!-- Relevant interpretability work for the model goes here -->
212
- <!--
213
- [More Information Needed]
214
-
215
- ## Environmental Impact -->
216
-
217
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
218
- <!--
219
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
220
-
221
- - **Hardware Type:** [More Information Needed]
222
- - **Hours used:** [More Information Needed]
223
- - **Cloud Provider:** [More Information Needed]
224
- - **Compute Region:** [More Information Needed]
225
- - **Carbon Emitted:** [More Information Needed] -->
226
-
227
- ## Technical Specifications
228
-
229
- ### Model Architecture and Objective
230
-
231
- The regression head consists of two linear layers with a ReLU activation function in between. The input dimension is 768, the hidden dimension is 1000, and the model uses bfloat16 precision.
232
-
233
- <!-- ### Compute Infrastructure
234
-
235
- [More Information Needed]
236
-
237
- #### Hardware
238
-
239
- [More Information Needed]
240
-
241
- #### Software
242
-
243
- [More Information Needed]
244
-
245
- ## Citation [optional] -->
246
-
247
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
248
-
249
- <!-- **BibTeX:**
250
-
251
- [More Information Needed]
252
-
253
- **APA:**
254
-
255
- [More Information Needed]
256
-
257
- ## Glossary [optional] -->
258
-
259
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
260
-
261
- <!-- [More Information Needed]
262
-
263
- ## More Information [optional]
264
-
265
- [More Information Needed]
266
-
267
- ## Model Card Authors [optional]
268
-
269
- [More Information Needed]
270
-
271
- ## Model Card Contact
272
-
273
- [More Information Needed] -->
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ # slavic
5
+ - bg
6
+ - cs
7
+ - hr
8
+ - mk
9
+ - pl
10
+ - sk
11
+ - sl
12
+ - sr
13
+ - uk
14
+
15
+ # germanic
16
+ - da
17
+ - de
18
+ - is
19
+ - nl
20
+ - no
21
+ - sv
22
+
23
+ # romance
24
+ - ca
25
+ - es
26
+ - fr
27
+ - gl
28
+ - it
29
+ - pt
30
+ - ro
31
+
32
+ # uralic
33
+ - et
34
+ - fi
35
+ - hu
36
+
37
+ # baltic
38
+ - lt
39
+ - lv
40
+
41
+ # singleton
42
+ - el
43
+ - ga
44
+ - eu
45
+ - mt
46
+ - tr
47
+ - sq
48
+ - hy
49
+
50
+
51
+ base_model:
52
+ - Snowflake/snowflake-arctic-embed-m-v2.0
53
+ pipeline_tag: text-ranking
54
+ ---
55
+ ## Summary
56
+
57
+ Multilingual JQL regression head that scores texts based on their educational value as described in our [paper](https://arxiv.org/abs/2505.22232).
58
+
59
+ <!-- This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1). -->
60
+
61
+ ## Model Details
62
+
63
+ ### Model Description
64
+
65
+ This model is a regression head built on top of the `Snowflake/snowflake-arctic-embed-m-v2.0` embedding model. It assigns a score to text documents, representing their educational value on a scale from 0 (lowest) to 5 (highest). Since the underlying embedding model provides language-aligned embeddings, the regression head can be used for multiple languages.
66
+
67
+ We provide checkpoints for three different training sets. These training sets were generated by letting a large language model (LLM) annotate 500k text documents. We provide trained heads based on annotations from: Llama3.3-70B-it, Gemma-3-27B-it, and Mistral Small 3.1-24B-it. For each LLM, we also created training sets with balanced and unbalanced distributions of educational value scores. Checkpoints trained on balanced datasets are denoted with "balanced"; otherwise, they are denoted as "unbalanced".
68
+
69
+ - **Developed by:** A collaboration between HessianAI, DFKI, Fraunhofer IAIS, Lamarr Institute, and TU Darmstadt.
70
+ <!-- - **Funded by [optional]:** [More Information Needed] -->
71
+ <!-- - **Shared by [optional]:** [More Information Needed] -->
72
+ - **Model type:** Regression Head
73
+ - **Language(s) (NLP):** Bulgarian, Czech, Croatian, Macedonian, Polish, Slovak, Slovenian, Serbian, Ukrainian, Danish, German, Icelandic, Dutch, Norwegian, Swedish, Catalan, Spanish, French, Galician, Italian, Portuguese, Romanian, Estonian, Finnish, Hungarian, Lithuanian, Latvian, Greek, Irish, Basque, Maltese, Turkish, Albanian, and Armenian.
74
+ - **License:** Apache-2.0
75
+ <!-- - **Finetuned from model [optional]:** [More Information Needed] -->
76
+
77
+ As evaluated in the paper the trained regression heads generalize to any language of the backbone embedding model beyond those used in our training.
78
+ ### Model Sources [optional]
79
+
80
+ <!-- Provide the basic links for the model. -->
81
+
82
+ - **Repository:** [github.com/JQL-AI/JQL-Annotation-Pipeline](https://github.com/JQL-AI/JQL-Annotation-Pipeline)
83
+ - **Paper:** [arXiv](https://arxiv.org/abs/2505.22232)
84
+ - **Project Page:** [https://huggingface.co/spaces/Jackal-AI/JQL]
85
+ <!-- - **Demo:** [More Information Needed] -->
86
+
87
+ <!-- ## Uses -->
88
+
89
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
90
+
91
+ ### Direct Use
92
+
93
+ The model is designed to quickly and efficiently assess the educational value of texts—significantly faster than querying a large language model (LLM) directly. This makes it particularly useful for building large, high-quality text datasets.
94
+
95
+ ### Downstream Use
96
+
97
+ In a downstream experiment, we demonstrate that training with high-quality texts selected by this model is faster and more effective than training with texts filtered only by heuristic methods. Details of our experiments can be found in the accompanying paper.
98
+
99
+ <!-- ### Out-of-Scope Use -->
100
+
101
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
102
+
103
+ <!-- [More Information Needed] -->
104
+
105
+ <!-- ## Bias, Risks, and Limitations -->
106
+
107
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
108
+
109
+ <!-- [More Information Needed] -->
110
+
111
+ <!-- ### Recommendations -->
112
+
113
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
114
+
115
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
116
+
117
+ ## How to Get Started with the Model
118
+
119
+ Usage is described in the accompanying [GitHub](https://github.com/JQL-AI/JQL-Annotation-Pipeline)
120
+ <!--
121
+ ## Training Details
122
+
123
+ ### Training Data
124
+
125
+ This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering.
126
+
127
+ [More Information Needed]
128
+
129
+ ### Training Procedure
130
+
131
+ This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure.
132
+
133
+ #### Preprocessing [optional]
134
+
135
+ [More Information Needed]
136
+
137
+
138
+ #### Training Hyperparameters
139
+
140
+ - **Training regime:** [More Information Needed] fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision
141
+
142
+ #### Speeds, Sizes, Times [optional]
143
+
144
+ This section provides information about throughput, start/end time, checkpoint size if relevant, etc.
145
+
146
+ [More Information Needed]
147
+
148
+ ## Evaluation
149
+
150
+ This section describes the evaluation protocols and provides the results.
151
+
152
+ ### Testing Data, Factors & Metrics
153
+
154
+ #### Testing Data
155
+
156
+ This should link to a Dataset Card if possible.
157
+
158
+ [More Information Needed]
159
+
160
+ #### Factors
161
+
162
+ These are the things the evaluation is disaggregating by, e.g., subpopulations or domains.
163
+
164
+ [More Information Needed]
165
+
166
+ #### Metrics
167
+
168
+ These are the evaluation metrics being used, ideally with a description of why.
169
+
170
+ [More Information Needed]
171
+
172
+ ### Results
173
+
174
+ [More Information Needed]
175
+
176
+ #### Summary
177
+ -->
178
+
179
+
180
+ <!-- ## Model Examination [optional] -->
181
+
182
+ <!-- Relevant interpretability work for the model goes here -->
183
+ <!--
184
+ [More Information Needed]
185
+
186
+ ## Environmental Impact -->
187
+
188
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
189
+ <!--
190
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
191
+
192
+ - **Hardware Type:** [More Information Needed]
193
+ - **Hours used:** [More Information Needed]
194
+ - **Cloud Provider:** [More Information Needed]
195
+ - **Compute Region:** [More Information Needed]
196
+ - **Carbon Emitted:** [More Information Needed] -->
197
+
198
+ ## Technical Specifications
199
+
200
+ ### Model Architecture and Objective
201
+
202
+ The regression head consists of two linear layers with a ReLU activation function in between. The input dimension is 768, the hidden dimension is 1000, and the model uses bfloat16 precision.
203
+
204
+ <!-- ### Compute Infrastructure
205
+
206
+ [More Information Needed]
207
+
208
+ #### Hardware
209
+
210
+ [More Information Needed]
211
+
212
+ #### Software
213
+
214
+ [More Information Needed]
215
+
216
+ ## Citation [optional] -->
217
+
218
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
219
+
220
+ <!-- **BibTeX:**
221
+
222
+ [More Information Needed]
223
+
224
+ **APA:**
225
+
226
+ [More Information Needed]
227
+
228
+ ## Glossary [optional] -->
229
+
230
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
231
+
232
+ <!-- [More Information Needed]
233
+
234
+ ## More Information [optional]
235
+
236
+ [More Information Needed]
237
+
238
+ ## Model Card Authors [optional]
239
+
240
+ [More Information Needed]
241
+
242
+ ## Model Card Contact
243
+
244
+ [More Information Needed] -->
245
+
246
+ ## 📖 Citation
247
+
248
+ ```bibtex
249
+ @article{ali2025judging,
250
+ title = {Judging Quality Across Languages: A Multilingual Approach to Pretraining Data Filtering with Language Models},
251
+ author = {
252
+ Mehdi Ali,
253
+ Manuel Brack,
254
+ Max Lübbering,
255
+ Elias Wendt,
256
+ Abbas Goher Khan,
257
+ Richard Rutmann,
258
+ Alex Jude,
259
+ Maurice Kraus,
260
+ Alexander Arno Weber,
261
+ Felix Stollenwerk,
262
+ David Kaczér,
263
+ Florian Mai,
264
+ Lucie Flek,
265
+ Rafet Sifa,
266
+ Nicolas Flores-Herr,
267
+ Joachim Köhler,
268
+ Patrick Schramowski,
269
+ Michael Fromm,
270
+ Kristian Kersting
271
+ },
272
+ year = {2025},
273
+ journal = {arXiv preprint arXiv:2505:22232}
274
+ }
275
+ ```