Mahmoud Amiri commited on
Commit
a137ded
·
1 Parent(s): 308a1ac

update readme file

Browse files
Files changed (2) hide show
  1. README.md +133 -230
  2. lit2vec_subfield_classifier.py +9 -5
README.md CHANGED
@@ -1,230 +1,133 @@
1
- ---
2
- dataset_name: lit2vec-subfield-classifier-dataset
3
- pretty_name: Lit2Vec Subfield Classifier Dataset
4
- tags:
5
- - scientific-papers
6
- - classification
7
- - embeddings
8
- - semantic-scholar
9
- - scientific-literature
10
- license: cc-by-4.0
11
- task_categories:
12
- - text-classification
13
- language:
14
- - en
15
- size_categories:
16
- - 10K<n<100K
17
- ---
18
-
19
- # Lit2Vec Subfield Classifier Dataset
20
-
21
- ## Summary
22
-
23
- The **Lit2Vec Subfield Classifier Dataset** is a curated and preprocessed collection of scientific research metadata designed for **text classification** and **embedding-based machine learning** tasks.
24
- It includes over 39,900 chemistry abstract and tldr text annotated with **domain subfields**, **dense text embeddings**, and **structured metadata**, making it suitable for:
25
-
26
- * Scientific **document classification**
27
- * **Subfield prediction** and semantic tagging
28
- * **Embedding-based retrieval and similarity search**
29
- * **Representation learning** and transfer learning on scholarly text
30
-
31
- All records are sourced from **CC-BY licensed** publications in the Semantic Scholar corpus.
32
-
33
- ---
34
-
35
- ## Dataset Structure
36
-
37
- ### Splits
38
-
39
- * **Train**: \~80% of records
40
- * **Validation**: \~10% of records
41
- * **Test**: \~10% of records
42
-
43
- Each entry is a flat JSON object (1 per line) in `.jsonl` format.
44
-
45
- ### Example Record
46
-
47
- ```json
48
- {
49
- "corpus_id": 105403827,
50
- "doi": "10.31031/PPS.2018.02.000549",
51
- "title": "Modeling of Chemical Reacting Transport Phenomena in a PEM Fuel Cell using Finite Volume Method",
52
- "authors": ["Mohammed Jourdani", "H. Mounir", "A. Marjani"],
53
- "author_ids": [null, "31345194", "30962775"],
54
- "venue": "Progress in Petrochemical Science",
55
- "year": 2018,
56
- "fields_of_study": ["Engineering", "Chemistry", "Environmental Science", "Materials Science"],
57
- "publication_date": "2018-09-19",
58
- "journal_name": "Progress in Petrochemical Science",
59
- "license_publisher": "Crimson Publishers",
60
- "license": "cc-by",
61
- "oa_url": "http://crimsonpublishers.com/pps/pdf/PPS.000549.pdf",
62
- "text": "A two-dimensional transient model using finite volume method enhances PEMFC design by simulating gas flow and solving movement and energy equations.",
63
- "field_classification": ["Energy Chemistry", "Chemical Engineering"],
64
- "text_type": "summary",
65
- "embedding": [-0.0148, -0.0213, 0.0076 , -0.0111, 0.0357, 0.0141],
66
- "label": [9, 11]
67
- }
68
- ````
69
-
70
- ---
71
-
72
- ## Features
73
-
74
- | Field Name | Type | Description |
75
- | ---------------------- | -------------- | --------------------------------------------------- |
76
- | `corpus_id` | `int` | Semantic Scholar ID |
77
- | `doi` | `string` | DOI identifier |
78
- | `title` | `string` | Title of the publication |
79
- | `authors` | `list[string]` | Author names |
80
- | `author_ids` | `list[string]` | Semantic Scholar author IDs |
81
- | `venue` | `string` | Journal or conference name |
82
- | `year` | `int` | Year of publication |
83
- | `fields_of_study` | `list[string]` | Top-level categories (e.g., Engineering, Chemistry) |
84
- | `publication_date` | `string` | ISO 8601 date |
85
- | `journal_name` | `string` | Full journal name |
86
- | `license_publisher` | `string` | OA license publisher |
87
- | `license` | `string` | License type (e.g., cc-by) |
88
- | `oa_url` | `string` | Open access link to full text |
89
- | `text` | `string` | Abstract or summary |
90
- | `text_type` | `string` | Indicates type of `text` field (e.g., summary) |
91
- | `field_classification` | `list[string]` | Expert-curated subfield labels |
92
- | `embedding` | `list[float]` | Dense vector embedding of the text |
93
- | `label` | `list[int]` | Numeric labels for classification |
94
-
95
- ---
96
-
97
- ## Label Mapping
98
-
99
- The dataset includes a consistent mapping between **subfield names** and **numeric labels**:
100
-
101
- | Subfield | Label |
102
- | ---------------------------------- | ----- |
103
- | Catalysis | 0 |
104
- | Organic Chemistry | 1 |
105
- | Polymer Chemistry | 2 |
106
- | Inorganic Chemistry | 3 |
107
- | Materials Science | 4 |
108
- | Analytical Chemistry | 5 |
109
- | Physical Chemistry | 6 |
110
- | Biochemistry | 7 |
111
- | Environmental Chemistry | 8 |
112
- | Energy Chemistry | 9 |
113
- | Medicinal Chemistry | 10 |
114
- | Chemical Engineering | 11 |
115
- | Supramolecular Chemistry | 12 |
116
- | Radiochemistry & Nuclear Chemistry | 13 |
117
- | Forensic & Legal Chemistry | 14 |
118
- | Food Chemistry | 15 |
119
- | Chemical Education | 16 |
120
- | Others | 17 |
121
-
122
- For convenience, here is the `label_to_index` mapping in JSON format:
123
-
124
- ```json
125
- {
126
- "label_to_index": {
127
- "Catalysis": 0,
128
- "Organic Chemistry": 1,
129
- "Polymer Chemistry": 2,
130
- "Inorganic Chemistry": 3,
131
- "Materials Science": 4,
132
- "Analytical Chemistry": 5,
133
- "Physical Chemistry": 6,
134
- "Biochemistry": 7,
135
- "Environmental Chemistry": 8,
136
- "Energy Chemistry": 9,
137
- "Medicinal Chemistry": 10,
138
- "Chemical Engineering": 11,
139
- "Supramolecular Chemistry": 12,
140
- "Radiochemistry & Nuclear Chemistry": 13,
141
- "Forensic & Legal Chemistry": 14,
142
- "Food Chemistry": 15,
143
- "Chemical Education": 16,
144
- "Others": 17
145
- },
146
- "index_to_label": {
147
- "0": "Catalysis",
148
- "1": "Organic Chemistry",
149
- "2": "Polymer Chemistry",
150
- "3": "Inorganic Chemistry",
151
- "4": "Materials Science",
152
- "5": "Analytical Chemistry",
153
- "6": "Physical Chemistry",
154
- "7": "Biochemistry",
155
- "8": "Environmental Chemistry",
156
- "9": "Energy Chemistry",
157
- "10": "Medicinal Chemistry",
158
- "11": "Chemical Engineering",
159
- "12": "Supramolecular Chemistry",
160
- "13": "Radiochemistry & Nuclear Chemistry",
161
- "14": "Forensic & Legal Chemistry",
162
- "15": "Food Chemistry",
163
- "16": "Chemical Education",
164
- "17": "Others"
165
- }
166
- }
167
- ```
168
-
169
- ---
170
-
171
- ## Usage
172
-
173
- ```python
174
- from datasets import load_dataset
175
-
176
- dataset = load_dataset("Bocklitz-Lab/lit2vec-subfield-classifier-dataset")
177
-
178
- print(dataset["train"][0]["title"])
179
- print(dataset["train"][0]["field_classification"])
180
- ```
181
-
182
- Each entry includes:
183
-
184
- * A machine-readable **embedding**
185
- * A list of **labels (IDs)**
186
- * The **original text**, metadata, and license info
187
-
188
- ---
189
-
190
- ## Applications
191
-
192
- * 🧠 **Text classification** using BERT, RoBERTa, etc.
193
- * 🔍 **Semantic search** with sentence-transformer or FAISS
194
- * 🧬 **Domain adaptation** for scientific NLP tasks
195
- * 🧭 **Clustering** and unsupervised topic modeling
196
- * 📈 **Benchmarking** embedding models on scientific literature
197
-
198
- ---
199
-
200
- ## Licensing
201
-
202
- * All entries are sourced from **CC BY 4.0** licensed publications.
203
- * Each entry includes original attribution via `license_publisher`, `oa_url`, and `doi`.
204
- * You are free to reuse, modify, and distribute the dataset under the terms of **Creative Commons Attribution 4.0 International License**.
205
-
206
- ---
207
-
208
- ## Citation
209
-
210
- If you use this dataset in your research, please cite:
211
-
212
- ```bibtex
213
- @dataset{lit2vec_classifier_2025,
214
- author = {Mahmoud Amiri, Thomas Bocklitz},
215
- title = {Lit2Vec Subfield Classifier Dataset},
216
- year = {2025},
217
- publisher = {Hugging Face},
218
- howpublished = {\url{https://huggingface.co/datasets/Bocklitz-Lab/lit2vec-subfield-classifier-dataset}},
219
- note = {Submitted to Nature Scientific Data}
220
- }
221
- ```
222
-
223
- ---
224
-
225
- ## Acknowledgements
226
-
227
- * Built on top of **Semantic Scholar Open Research Corpus (S2ORC)**
228
- * Flattened and cleaned using custom preprocessing by the **Bocklitz Lab**
229
- * Embeddings generated from proprietary or publicly available models (details forthcoming in accompanying paper)
230
-
 
1
+ ---
2
+ dataset_name: lit2vec-subfield-classifier-dataset
3
+ pretty_name: Lit2Vec Subfield Classifier Dataset
4
+ tags:
5
+ - scientific-papers
6
+ - classification
7
+ - embeddings
8
+ - semantic-scholar
9
+ - scientific-literature
10
+ license: cc-by-4.0
11
+ task_categories:
12
+ - text-classification
13
+ language:
14
+ - en
15
+ size_categories:
16
+ - 10K<n<100K
17
+ ---
18
+
19
+ # Lit2Vec Subfield Classifier Dataset
20
+
21
+ This dataset contains 39,900 short chemistry texts with e5-large-v2 embeddings and multi-label subfield annotations. It is the training data of the [subfield classifier](https://huggingface.co/Bocklitz-Lab/lit2vec-subfield-classifier-model) of the Lit2Vec workflow ([paper](https://arxiv.org/abs/2604.12498), [code](https://github.com/Bocklitz-Lab/lit2vec-subfield-classifier)).
22
+
23
+ The texts come from 19,992 papers whose license metadata indicates CC BY. They are the same papers as in the [TL;DR dataset](https://huggingface.co/datasets/Bocklitz-Lab/lit2vec-tldr-bart-dataset), and the texts are identical to its abstracts and summaries. Each paper contributes two records: its abstract (19,992 records) and its GPT-4o summary (19,908 records, because 84 papers have no summary). Both records of a paper carry the same labels.
24
+
25
+ The subfield labels were generated by GPT-4o from a controlled vocabulary of 17 chemistry subfields plus "Others". They were not curated by experts. Two domain experts reviewed a random sample of 45 annotated abstracts and found them generally reasonable (see the paper).
26
+
27
+ ## Splits
28
+
29
+ | Split | Records |
30
+ |---|---:|
31
+ | train | 31,920 |
32
+ | validation | 3,990 |
33
+ | test | 3,990 |
34
+
35
+
36
+ ## Fields
37
+
38
+ Each record is one line of a JSON Lines file under `data/`.
39
+
40
+ | Field | Type | Description |
41
+ |---|---|---|
42
+ | `corpus_id` | int | Semantic Scholar corpus ID. Two records share it (abstract and summary). |
43
+ | `doi` | string | DOI. |
44
+ | `url` | string | Semantic Scholar page of the paper. |
45
+ | `title` | string | Title. |
46
+ | `authors` | list of strings | Author names. Empty for 70 records. |
47
+ | `author_ids` | list of strings | Semantic Scholar author IDs, aligned with `authors`; an empty string where the ID is unknown. |
48
+ | `venue` | string | Venue. Empty for 7,263 records. |
49
+ | `year` | int | Publication year (1967 to 2024). |
50
+ | `fields_of_study` | list of strings | Field labels from Semantic Scholar. |
51
+ | `publication_date` | string | ISO date. Empty for 1,458 records. |
52
+ | `journal_name` | string | Journal name. Empty for 1,918 records. |
53
+ | `license_publisher` | string | Publisher of the open-access version. |
54
+ | `license` | string | License category from the screening. It is `cc-by` for every record. |
55
+ | `oa_url` | string | Link to the open-access full text. |
56
+ | `text` | string | The abstract or the summary, see `text_type`. |
57
+ | `text_type` | string | `abstract` or `summary`. |
58
+ | `field_classification` | list of strings | Subfield names as produced by GPT-4o. |
59
+ | `label` | list of ints | IDs of the names in `field_classification` that belong to the 18-class vocabulary. |
60
+ | `embedding` | list of 1,024 floats | e5-large-v2 embedding of `text` (see below). |
61
+
62
+ ### Embeddings
63
+
64
+ `embedding` is the L2-normalised output of `intfloat/e5-large-v2` for the string `abstract: <text>` when `text_type` is `abstract` and `summary: <text>` when it is `summary`. We checked this by re-encoding records: the stored vectors and the re-computed ones have a cosine similarity of 1.00000. To classify new text with the [model](https://huggingface.co/Bocklitz-Lab/lit2vec-subfield-classifier-model), use the same prefixes.
65
+
66
+ ### Labels
67
+
68
+ | ID | Subfield | Papers | | ID | Subfield | Papers |
69
+ |---:|---|---:|---|---:|---|---:|
70
+ | 0 | Catalysis | 997 | | 9 | Energy Chemistry | 754 |
71
+ | 1 | Organic Chemistry | 1,247 | | 10 | Medicinal Chemistry | 6,326 |
72
+ | 2 | Polymer Chemistry | 569 | | 11 | Chemical Engineering | 2,019 |
73
+ | 3 | Inorganic Chemistry | 1,053 | | 12 | Supramolecular Chemistry | 207 |
74
+ | 4 | Materials Science | 4,664 | | 13 | Radiochemistry & Nuclear Chemistry | 93 |
75
+ | 5 | Analytical Chemistry | 3,208 | | 14 | Forensic & Legal Chemistry | 61 |
76
+ | 6 | Physical Chemistry | 1,157 | | 15 | Food Chemistry | 1,502 |
77
+ | 7 | Biochemistry | 10,514 | | 16 | Chemical Education | 91 |
78
+ | 8 | Environmental Chemistry | 2,664 | | 17 | Others | 125 |
79
+
80
+ The last column counts papers (out of 19,992). A paper has 1.86 labels on average, and the distribution is strongly skewed towards Biochemistry and Medicinal Chemistry.
81
+
82
+ ## Example
83
+
84
+ A paper with its two records (embeddings and long fields shortened):
85
+
86
+ ```json
87
+ {"corpus_id": 105403827, "text_type": "abstract",
88
+ "title": "Modeling of Chemical Reacting Transport Phenomena in a PEM Fuel Cell using Finite Volume Method",
89
+ "doi": "10.31031/PPS.2018.02.000549", "year": 2018, "license": "cc-by",
90
+ "text": "Modeling the transport phenomena in a fuel cell system is important to the development of fuel cells. ...",
91
+ "field_classification": ["Energy Chemistry", "Chemical Engineering"], "label": [9, 11],
92
+ "embedding": [-0.0153, -0.0243, 0.0022, "... 1,024 values"]}
93
+
94
+ {"corpus_id": 105403827, "text_type": "summary",
95
+ "text": "A two-dimensional transient model using finite volume method enhances PEMFC design by simulating gas flow and solving movement and energy equations.",
96
+ "field_classification": ["Energy Chemistry", "Chemical Engineering"], "label": [9, 11],
97
+ "embedding": [-0.0149, -0.0214, 0.0076, "... 1,024 values"]}
98
+ ```
99
+
100
+ ## Usage
101
+
102
+ ```python
103
+ from datasets import load_dataset
104
+
105
+ ds = load_dataset("Bocklitz-Lab/lit2vec-subfield-classifier-dataset")
106
+ print(ds["train"][0]["title"])
107
+ print(ds["train"][0]["label"])
108
+ ```
109
+
110
+
111
+ ## Licensing and attribution
112
+
113
+ The texts are the work of the original authors and were published under CC BY, which requires attribution. Each record carries the DOI, the publisher and a link to the open-access full text. The summaries and the labels are machine-generated, were produced with OpenAI's GPT-4o, and are released under CC BY 4.0 together with the abstracts. Check OpenAI's terms of use if you plan to use them to train other models. The license metadata was resolved from Unpaywall, OpenAlex and Crossref as described in the paper. This is a metadata-based screen and not legal clearance.
114
+
115
+ ## Citation
116
+
117
+ Please cite the Lit2Vec paper:
118
+
119
+ ```bibtex
120
+ @misc{amiri2026lit2vec,
121
+ title = {Lit2Vec: A Reproducible Workflow for Building a Legally Screened Chemistry Corpus from S2ORC for Downstream Retrieval and Text Mining},
122
+ author = {Amiri, Mahmoud and Jafari, Jamile Mohammad and Mostafapour, Sara and Bocklitz, Thomas},
123
+ year = {2026},
124
+ eprint = {2604.12498},
125
+ archivePrefix = {arXiv},
126
+ doi = {10.48550/arXiv.2604.12498},
127
+ url = {https://arxiv.org/abs/2604.12498}
128
+ }
129
+ ```
130
+
131
+ ## Acknowledgements
132
+
133
+ The texts come from S2ORC, provided by the Allen Institute for AI and the Semantic Scholar team. The embeddings were computed with `intfloat/e5-large-v2`. The work was developed in the Bocklitz Lab at the Leibniz Institute of Photonic Technology (Leibniz IPHT) and Friedrich Schiller University Jena and was funded by the BMFTR within the programme Photonics Research Germany (13N15466, 13N15710, 13N15715). Questions: mahmoud.amiri@uni-jena.de.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lit2vec_subfield_classifier.py CHANGED
@@ -16,7 +16,7 @@ def safe_sequence(val, default_type=int):
16
  class lit2vec_subfield_classifier(GeneratorBasedBuilder):
17
  def _info(self):
18
  return DatasetInfo(
19
- description="Lit2Vec Subfield Classifier: Flattened dataset of scientific abstracts and metadata, including field classification labels and embeddings.",
20
  features=Features({
21
  "corpus_id": Value("int64"),
22
  "doi": Value("string"),
@@ -35,13 +35,17 @@ class lit2vec_subfield_classifier(GeneratorBasedBuilder):
35
  "text": Value("string"),
36
  "field_classification": Sequence(Value("string")),
37
  "text_type": Value("string"),
38
- "embedding": Sequence(Value("float32")), # optional: specify `length=768`
39
  "label": Sequence(Value("int32"))
40
  }),
41
  supervised_keys=None,
42
- license="cc-by",
43
- homepage="https://huggingface.co/datasets/your-username/lit2vec_subfield_classifier",
44
- citation="""@misc{yourcitation2025,title={Lit2Vec Subfield Classifier},author={Your Name}}"""
 
 
 
 
45
  )
46
 
47
  def _split_generators(self, dl_manager):
 
16
  class lit2vec_subfield_classifier(GeneratorBasedBuilder):
17
  def _info(self):
18
  return DatasetInfo(
19
+ description="Lit2Vec Subfield Classifier: chemistry abstracts and GPT-4o summaries with e5-large-v2 embeddings and multi-label subfield annotations.",
20
  features=Features({
21
  "corpus_id": Value("int64"),
22
  "doi": Value("string"),
 
35
  "text": Value("string"),
36
  "field_classification": Sequence(Value("string")),
37
  "text_type": Value("string"),
38
+ "embedding": Sequence(Value("float32")), # 1,024 values (intfloat/e5-large-v2)
39
  "label": Sequence(Value("int32"))
40
  }),
41
  supervised_keys=None,
42
+ license="cc-by-4.0",
43
+ homepage="https://huggingface.co/datasets/Bocklitz-Lab/lit2vec-subfield-classifier-dataset",
44
+ citation="""@misc{amiri2026lit2vec,
45
+ title={Lit2Vec: A Reproducible Workflow for Building a Legally Screened Chemistry Corpus from S2ORC for Downstream Retrieval and Text Mining},
46
+ author={Amiri, Mahmoud and Jafari, Jamile Mohammad and Mostafapour, Sara and Bocklitz, Thomas},
47
+ year={2026}, eprint={2604.12498}, archivePrefix={arXiv}, doi={10.48550/arXiv.2604.12498}
48
+ }"""
49
  )
50
 
51
  def _split_generators(self, dl_manager):