hheiden commited on
Commit
beeddb7
·
verified ·
1 Parent(s): 941c0b5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -167
README.md CHANGED
@@ -138,170 +138,4 @@ If you use this dataset, please consider citing the original OSRA paper, as the
138
  journal = {Hugging Face repository},
139
  howpublished = {\url{[https://huggingface.co/datasets/hheiden/USPTO_OCSR_benchmark](https://huggingface.co/datasets/hheiden/USPTO_OCSR_benchmark)}}
140
  }
141
- ```
142
-
143
- Of course. Here is a completed dataset card for the USPTO OCSR Benchmark, filled in using the context you provided and information from the previous dataset.
144
-
145
- ---
146
- dataset_info:
147
- features:
148
- - name: id
149
- dtype: string
150
- - name: image
151
- dtype: image
152
- - name: mol
153
- dtype: string
154
- - name: smiles
155
- dtype: string
156
- - name: selfies
157
- dtype: string
158
- - name: inchi
159
- dtype: string
160
- splits:
161
- - name: train
162
- num_bytes: 40758554
163
- num_examples: 5719
164
- download_size: 23312328
165
- dataset_size: 40758554
166
- configs:
167
- - config_name: default
168
- data_files:
169
- - split: train
170
- path: data/train-*
171
- task_categories:
172
- - image-to-text
173
- tags:
174
- - chemistry
175
- - science
176
- - ocr
177
- - ocsr
178
- - structure
179
- pretty_name: USPTO OCSR Benchmark
180
- size_categories:
181
- - 1K<n<10K
182
- ---
183
- # Dataset Card for USPTO OCSR Benchmark
184
-
185
- This dataset is a large validation and benchmark set for Optical Chemical Structure Recognition (OCSR), containing 5,719 chemical structure images. The data was sourced from US Patent Office (USPTO) documents and has been curated to provide accurate ground truth MOL files. This Hugging Face version further enriches the dataset by providing pre-computed SMILES, InChI, and SELFIES strings for each molecule.
186
-
187
- ## Dataset Details
188
-
189
- ### Dataset Description
190
-
191
- The USPTO OCSR Benchmark was created to serve as a high-quality validation set for OCSR software. It consists of images derived from the US Patent Office Complex Work Units, with each image containing a single chemical structure. The dataset was made possible through a collaboration with Dr. Steve Boyer and Dr. John Kinney and was later updated by Aniko Valko and Keymodule Ltd., who corrected the ground truth MOL files and removed invalid images.
192
-
193
- The original distribution included the images, their corresponding MOL files, and a Perl script for benchmarking performance by comparing the standard InChI of predicted structures against the ground truth. This Hugging Face version processes the curated MOL files to generate additional, widely-used chemical representations—canonical SMILES, InChI, and SELFIES—making it immediately useful for training modern deep learning models on image-to-text tasks.
194
-
195
- - **Curated by:** Original set by Dr. Steve Boyer and Dr. John Kinney. Updated by Aniko Valko and Keymodule Ltd. This Hugging Face version prepared by Hunter Heidenreich.
196
- - **License:** Data sourced from the US Patent Office is typically in the public domain. No explicit license was provided with the original dataset.
197
-
198
- ### Dataset Sources
199
-
200
- - **Repository:**
201
- - [Hugging Face Dataset Repo](https://huggingface.co/datasets/hheiden/USPTO_OCSR_benchmark)
202
- - [Original Dataset Source (OSRA Validation page)](https://sourceforge.net/p/osra/wiki/Validation/)
203
- - **Paper:** While there is no dedicated paper for the dataset, it is closely associated with the OSRA tool. Citing the OSRA paper is recommended.
204
- - [Optical structure recognition software to recover chemical information: OSRA, an open source solution](https://doi.org/10.1021/ci8003184)
205
-
206
- ## Uses
207
-
208
- ### Direct Use
209
-
210
- This dataset is ideal for benchmarking, validating, and training OCSR models, particularly those intended to work with chemical diagrams from patent literature. Common use cases include:
211
-
212
- - Image-to-SMILES translation
213
- - Evaluating the accuracy of OCSR tools by comparing generated InChIs
214
- - Fine-tuning vision-language models for the chemistry domain
215
-
216
- ### Out-of-Scope Use
217
-
218
- The dataset consists of segmented, single-structure images. It is not suitable for developing or evaluating the document segmentation stage of an OCSR pipeline, which involves finding and isolating chemical diagrams from a full document page. The drawing styles are also specific to patent documents and may not represent the full diversity of diagrams found in textbooks, journals, or handwritten notes.
219
-
220
- ## Dataset Structure
221
-
222
- The dataset contains a single split ('train') with 5,719 examples. Each example includes the following fields:
223
-
224
- - `id` (string): A unique identifier for the example, which is the original filename without the extension.
225
- - `image` (image): A PIL-encoded image of the chemical structure.
226
- - `mol` (string): The corrected ground truth structure in MOL file format.
227
- - `smiles` (string): The canonical SMILES string for the molecule, generated from the `mol` data using RDKit.
228
- - `selfies` (string): The SELFIES (SELF-referencIng Embedded Strings) representation, generated from the `smiles` string.
229
- - `inchi` (string): The standard InChI string for the molecule, generated from the `mol` data using RDKit.
230
-
231
- ## Dataset Creation
232
-
233
- ### Curation Rationale
234
-
235
- The dataset was created to provide a robust and standardized tool for the OCSR community to benchmark and validate their software against a large set of real-world examples from a significant source (US patents).
236
-
237
- ### Source Data
238
-
239
- #### Data Collection and Processing
240
-
241
- The source data consists of chemical structure images from US Patent Office Complex Work Units. The initial dataset was later refined by Aniko Valko and Keymodule Ltd. by correcting errors in the ground truth MOL files and removing invalid image-molecule pairs to improve its quality as a benchmark.
242
-
243
- For this Hugging Face Hub version, a script was used to process the corrected MOL files. This script utilized the RDKit library to generate canonical SMILES and standard InChI strings, and the `selfies` library to generate SELFIES representations from the SMILES strings. This pre-processing makes the dataset more accessible for machine learning workflows.
244
-
245
- #### Who are the source data producers?
246
-
247
- The underlying chemical structure data originates from documents filed with the US Patent Office. The dataset was curated and released by academic and commercial collaborators.
248
-
249
- ## Bias, Risks, and Limitations
250
-
251
- - **Domain Specificity:** The data is exclusively from US patents. The conventions, resolution, and styles of chemical drawings may differ from those in patents from other regions or in other types of scientific publications.
252
- - **Pre-processed Images:** The images contain only single, segmented structures. This simplifies the recognition task and means models trained on this data will not learn to handle complex pages with multiple diagrams, text, and other figures.
253
- - **Lack of Negative Examples:** The dataset contains only valid chemical structure images. It does not include examples of diagrams that are malformed or non-chemical, which could be important for building a truly robust real-world system.
254
-
255
- ### Recommendations
256
-
257
- Users should consider this dataset a high-quality validation set for the core task of recognizing segmented chemical structures from patents. For creating a more general-purpose OCSR tool, it is advisable to combine this dataset with others that include different drawing styles (e.g., UOB, CLEF) and more complex, unsegmented document images.
258
-
259
- ## Citation
260
-
261
- If you use this dataset, please consider citing the original OSRA paper, as the dataset is a key part of its validation suite. Please also cite this Hugging Face dataset to ensure reproducibility.
262
-
263
- **BibTeX:**
264
-
265
- ```bibtex
266
- @article{filippov2009optical,
267
- title={Optical structure recognition software to recover chemical information: OSRA, an open source solution},
268
- author={Filippov, Igor V and Nicklaus, Marc C},
269
- journal={Journal of chemical information and modeling},
270
- volume={49},
271
- number={3},
272
- pages={740--743},
273
- year={2009},
274
- publisher={ACS Publications}
275
- }
276
-
277
- @article{Rajan2020,
278
- author = {Rajan, Kohulan and Brinkhaus, Henning Otto and Zielesny, Achim and Steinbeck, Christoph},
279
- doi = {10.1186/s13321-020-00465-0},
280
- file = {:Users/kohulanrajan/Downloads/s13321-020-00465-0.pdf:pdf},
281
- issn = {1758-2946},
282
- journal = {Journal of Cheminformatics},
283
- keywords = {Chemical data extraction,Chemical structure,Data mining,Machine learning,Named entity recognition,Open data,Optical chemical structure recognition,chemical data extraction,chemical structure,data mining,machine learning,named entity recognition,open data,optical chemical structure recognition},
284
- pages = {1--13},
285
- publisher = {Springer International Publishing},
286
- title = {{A review of optical chemical structure recognition tools}},
287
- url = {https://doi.org/10.1186/s13321-020-00465-0},
288
- year = {2020}
289
- }
290
-
291
- @misc{huggingface_dataset_USPTO,
292
- author = {Heidenreich, Hunter},
293
- title = {USPTO OCSR Benchmark},
294
- year = {2025},
295
- publisher = {Hugging Face},
296
- journal = {Hugging Face repository},
297
- howpublished = {\url{[https://huggingface.co/datasets/hheiden/USPTO_OCSR_benchmark](https://huggingface.co/datasets/hheiden/USPTO_OCSR_benchmark)}}
298
- }
299
- ```
300
-
301
- ## Dataset Card Authors
302
-
303
- Original dataset curators: Dr. Steve Boyer, Dr. John Kinney
304
-
305
- Updates by: Aniko Valko, Keymodule Ltd.
306
-
307
- Hugging Face version: Hunter Heidenreich, hheiden
 
138
  journal = {Hugging Face repository},
139
  howpublished = {\url{[https://huggingface.co/datasets/hheiden/USPTO_OCSR_benchmark](https://huggingface.co/datasets/hheiden/USPTO_OCSR_benchmark)}}
140
  }
141
+ ```