hynky commited on
Commit
90ddef2
·
verified ·
1 Parent(s): 37c4c5a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +37 -39
README.md CHANGED
@@ -4,17 +4,18 @@ language:
4
  - en
5
  license: apache-2.0
6
  datasets:
7
- - HuggingFaceFW/finepdfs_fw_edu_labeled
8
  ---
9
 
10
- # FinePDFs-Edu classifier (English)
11
 
12
  ## Model summary
13
- This is a classifier for judging the educational value of web pages. It was developed to filter and curate educational content from web datasets and was trained on 0 [annotations](https://huggingface.co/datasets/HuggingFaceFW/finepdfs_fw_edu_labeled) generated by [Qwen3-235B-A22B-Instruct-2507](https://huggingface.co/Qwen/Qwen3-235B-A22B-Instruct-2507) for web samples from [FinePDFs](https://huggingface.co/datasets/HuggingFaceFW/finepdfs) dataset.
 
 
14
 
15
- We used this classifier to build [FinePDFs-Edu](https://huggingface.co/datasets/HuggingFaceFW/finepdfs-edu) dataset.
16
  ### How to use in transformers
17
- To load the FinePDFs-Edu classifier, use the following code:
18
 
19
  ```python
20
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
@@ -22,8 +23,8 @@ import re
22
  CHUNK_SIZE = 2048 - 2
23
  MAX_CHARS = 10_000
24
 
25
- tokenizer = AutoTokenizer.from_pretrained("HuggingFaceFW/finepdfs_edu_classifier_English")
26
- model = AutoModelForSequenceClassification.from_pretrained("HuggingFaceFW/finepdfs_edu_classifier_English")
27
  regex_whitespace = re.compile(r'\s')
28
 
29
  def create_text_chunks(text: str, tokenizer):
@@ -87,35 +88,32 @@ The classifier was trained on 13824480 pairs of web samples and their scores fro
87
 
88
  Below is the prompt used for Qwen3-235B-A22B-Instruct-2507 annotations:
89
  ```
90
- Below is an extract from a PDF file. Evaluate whether the extract has a high educational
91
- value and could be useful in an educational setting for teaching from primary school to
92
- grade school levels using the additive 5-point scoring system described below. Points are
93
- accumulated based on the satisfaction of each criterion:
94
- - Add 1 point if the extract provides some basic information relevant to educational topics, even if it includes some irrelevant or non-academic content like advertisements and
95
- promotional material.
96
- - Add another point if the extract addresses certain elements pertinent to education but
97
- does not align closely with educational standards. It might mix educational content with
98
- non-educational material, offering a superficial overview of potentially useful topics, or
99
- presenting information in a disorganized manner and incoherent writing style.
100
- - Award a third point if the extract is appropriate for educational use and introduces key
101
- concepts relevant to school curricula. It is coherent though it may not be comprehensive
102
- or could include some extraneous information. It may resemble an introductory section of
103
- a textbook or a basic tutorial that is suitable for learning but has notable limitations like
104
- treating concepts that are too complex for grade school students.
105
- - Grant a fourth point if the extract highly relevant and beneficial for educational purposes
106
- for a level not higher than grade school, exhibiting a clear and consistent writing style. It
107
- could be similar to a chapter from a textbook or a tutorial, offering substantial educational
108
- content, including exercises and solutions, with minimal irrelevant information, and the
109
- concepts aren’t too advanced for grade school students. The content is coherent, focused,
110
- and valuable for structured learning.
111
- - Bestow a fifth point if the extract is outstanding in its educational value, perfectly suited for
112
- teaching either at primary school or grade school. It follows detailed reasoning, the writing
113
- style is easy to follow and offers profound and thorough insights into the subject matter,
114
- devoid of any non-educational or complex content.
115
- The extract: {example}.
116
  After examining the extract:
117
- - Briefly justify your total score, up to 100 words.
118
- - Conclude with the score using the format: "Educational score: <total points>"\
119
  ```
120
 
121
  We added a classification head with a single regression output to answerdotai/ModernBERT-large, unroze the last 4 layers and trained the model for 5000 steps with a learning rate of 3e-4.
@@ -131,7 +129,7 @@ We added a classification head with a single regression output to answerdotai/Mo
131
 
132
  **Classification report**
133
 
134
- We treat the regression model's predictions as discrete classes to calculate the metrics on a hold-out set of 0 Qwen3-235B-A22B-Instruct-2507-annotated samples.
135
  ```
136
  Validation Report:
137
  | class | precision | recall | f1-score | support |
@@ -161,10 +159,10 @@ Confusion Matrix:
161
 
162
 
163
  ## Limitations
164
- While the FinePDFs-Edu classifier performs well in distinguishing high-quality educational content for FinePDFs dataset, there are some limitations:
165
 
166
- - Scope: The model's performance might change for other datasets, in particular for out of distribution samples. It is also focused on educational content relevant to primary and grade school levels and may not perform as well on content intended for higher education or specialized domains.
167
- - Bias: The model's performance is dependent on the quality and representativeness of the training data and the LLM used for the annotation. Biases in both can affect the classifier's judgments. It might overfit to academic looking content for the higher scores and we recommend using int_score >= 1.35 (top 10% for english) as a threshold for data curation.
168
  - Context: The classifier evaluates individual web pages or extracts without considering broader context, which might impact its effectiveness in certain scenarios.
169
 
170
  The training and inference code is available on GitHub
 
4
  - en
5
  license: apache-2.0
6
  datasets:
7
+ - HuggingFaceFW/finepdfs_eng_Latn_labeled
8
  ---
9
 
10
+ # FinePDFs-Edu v2 classifier (English)
11
 
12
  ## Model summary
13
+ This is a classifier for judging the educational value of web pages. It was developed to filter and curate educational content from web datasets and was trained on 1304547 [annotations](https://huggingface.co/datasets/HuggingFaceFW/finepdfs_eng_Latn_labeled) generated by [Qwen3-235B-A22B-Instruct-2507](https://huggingface.co/Qwen/Qwen3-235B-A22B-Instruct-2507) for web samples from [FinePDFs](https://huggingface.co/datasets/HuggingFaceFW/finepdfs) dataset.
14
+
15
+ **Unlike in original FW-EDU, we are not filtering for undergraduate content, which results in high inclusion of papers!**
16
 
 
17
  ### How to use in transformers
18
+ To load the FinePDFs-Edu-v2 classifier, use the following code:
19
 
20
  ```python
21
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
 
23
  CHUNK_SIZE = 2048 - 2
24
  MAX_CHARS = 10_000
25
 
26
+ tokenizer = AutoTokenizer.from_pretrained("HuggingFaceFW/finepdfs_edu_classifier_v2_eng_Latn")
27
+ model = AutoModelForSequenceClassification.from_pretrained("HHuggingFaceFW/finepdfs_edu_classifier_v2_eng_Latn")
28
  regex_whitespace = re.compile(r'\s')
29
 
30
  def create_text_chunks(text: str, tokenizer):
 
88
 
89
  Below is the prompt used for Qwen3-235B-A22B-Instruct-2507 annotations:
90
  ```
91
+ Below is an extract from a PDF file. Evaluate whether the extract exhibits properties suitable for educational training data using the 6-point scoring system described below. Select the single score that best represents the extract's educational quality level:
92
+
93
+ **Score 0: No Educational Value**
94
+ - Award 0 points for content with zero educational merit including spam, promotional material, garbled text, random sequences, severely corrupted formatting, or content that provides no learning opportunities whatsoever.
95
+
96
+ **Score 1: Minimal Educational Content**
97
+ - Award 1 point for content with very limited educational value such as basic data listings, simple contact information, minimal factual statements without context, brief announcements, or content that presents isolated facts without meaningful educational framework.
98
+
99
+ **Score 2: Basic Informational Content**
100
+ - Award 2 points for content that provides basic information but lacks depth, context, or clear educational structure. This includes simple news items, basic product descriptions, brief summaries, casual observations, or informational content that states facts without explanation or educational development.
101
+
102
+ **Score 3: Moderate Educational Value**
103
+ - Award 3 points for content that offers solid educational information with some context and explanation. This includes informative articles with background information, basic explanatory content, introductory-level material, general knowledge content, or well-written informational pieces that provide context and some depth.
104
+
105
+ **Score 4: Strong Educational Content**
106
+ - Award 4 points for content with clear educational merit featuring detailed explanations, multiple perspectives, analytical depth, or comprehensive coverage of topics. This includes academic articles, detailed tutorials, in-depth analyses, research-based content, or material that demonstrates critical thinking and provides substantial learning value.
107
+
108
+ **Score 5: Exceptional Educational Value**
109
+ - Award 5 points for content with outstanding educational merit that demonstrates expert-level knowledge, sophisticated analysis, comprehensive understanding, and significant pedagogical value. This includes advanced academic research, expert commentary with deep insights, comprehensive educational material with multiple learning dimensions, or content that advances understanding through original thinking and thorough exploration.
110
+
111
+ ## Evaluation Process
112
+ The extract: {example}
113
+
 
 
 
114
  After examining the extract:
115
+ - Briefly justify your total score, focusing on the educational depth, context provided, and learning potential, up to 100 words.
116
+ - Conclude with the score using the format: "Educational value score: <total points>"\
117
  ```
118
 
119
  We added a classification head with a single regression output to answerdotai/ModernBERT-large, unroze the last 4 layers and trained the model for 5000 steps with a learning rate of 3e-4.
 
129
 
130
  **Classification report**
131
 
132
+ We treat the regression model's predictions as discrete classes to calculate the metrics on a hold-out set of 10000 Qwen3-235B-A22B-Instruct-2507-annotated samples.
133
  ```
134
  Validation Report:
135
  | class | precision | recall | f1-score | support |
 
159
 
160
 
161
  ## Limitations
162
+ While the FinePDFs-Edu-v2 classifier performs well in distinguishing high-quality educational content for FinePDFs dataset, there are some limitations:
163
 
164
+ - Scope: The model's performance might change for other datasets, in particular for out of distribution samples. Unlike original fw-edu It is NOT focused on educational content relevant to primary and grade school levels and may not perform as well on content intended for undergraduate school levels or specialized domains.
165
+ - Bias: The model's performance is dependent on the quality and representativeness of the training data and the LLM used for the annotation. Biases in both can affect the classifier's judgments. It might overfit to academic looking content for the higher scores, but we haven't found the classifier to improve the scores.
166
  - Context: The classifier evaluates individual web pages or extracts without considering broader context, which might impact its effectiveness in certain scenarios.
167
 
168
  The training and inference code is available on GitHub