Lit2Vec-dataset / README.md
Mahmoudamiri's picture
Update README.md
7b7ef0c verified
# πŸ§ͺ Lit2Vec Dataset
**Lit2Vec** is a large-scale, openly licensed dataset of **582,724 chemistry-specific research articles** derived from the Semantic Scholar Open Research Corpus (S2ORC), curated to support semantic search, retrieval-augmented generation (RAG), and scientific NLP tasks in the chemistry domain.
Each article is distributed as a **standalone JSON file** containing:
* Clean full text
* Paragraph-level embeddings (1024-D vectors)
* TL;DR summaries
* Subfield classification scores
* Structured metadata
* Licensing information from Unpaywall, Crossref, and OpenAlex
---
## πŸ“ Repository Structure
```
Lit2Vec-dataset/
β”œβ”€β”€ data/ # Full dataset split into multiple tar.gz archives (~4–5 GB each)
β”‚ β”œβ”€β”€ data_part_000.tar.gz
β”‚ β”œβ”€β”€ ...
β”‚
β”œβ”€β”€ sample/ # Small sample subset (~500MB) for quick testing
β”‚ └── data_part_000.tar.gz
β”‚
β”œβ”€β”€ validation/ # Lightweight validation set (~15–18 MB shards)
β”‚ β”œβ”€β”€ data_part_000.tar.gz
β”‚ β”œβ”€β”€ ...
β”‚
β”œβ”€β”€ .gitattributes
└── .gitignore
```
Each `.tar.gz` archive contains thousands of individual JSON files, named by their S2ORC `corpus_id`, for example:
```
12345678.json
12345679.json
...
```
---
## πŸ“„ Data Record Format
Each JSON file contains a single research article, structured according to the Lit2Vec v1.0 schema.
### πŸ”‘ Top-Level Fields
| Field | Type | Description |
| -------------------- | --------------------- | ------------------------------------------------------------ |
| `schema_version` | string | Schema version (`"1.0"`) |
| `corpus_id` | integer | S2ORC Corpus ID (used as filename) |
| `metadata` | object | Title, authors, year, venue, identifiers |
| `abstract` | string | Abstract text |
| `fulltext` | string | Full article text |
| `paragraphs` | array\[string] | Paragraph-level text units |
| `embeddings` | array\[array\[float]] | 1024-D float32 paragraph vectors (aligned with `paragraphs`) |
| `abstract_embedding` | array\[float] | 1024-D float32 vector for abstract |
| `predicted_subfield` | object | Map of subfield label β†’ confidence score |
| `tldr` | string | Machine-generated two-sentence summary |
| `unpaywall_license` | object \| null | License data from Unpaywall |
| `crossref_license` | object \| null | License data from Crossref |
| `openalex_license` | object \| null | License data from OpenAlex |
### πŸ“¦ Minimal Example
```json
{
"schema_version": "1.0",
"corpus_id": 37254803,
"metadata": {
"title": "Protective effect of EGCG...",
"year": 2016,
"externalids": { "DOI": "10.xxxx/xxxxx" },
"url": "https://..."
},
"abstract": "Epigallocatechin gallate ...",
"fulltext": "# Protective effect of ...",
"paragraphs": ["37254803P0: passage: ...", "..."],
"embeddings": [[0.0123, -0.0456, ...], ...],
"abstract_embedding": [0.0345, -0.0789, ...],
"predicted_subfield": {
"Biochemistry": 0.997,
"Medicinal Chemistry": 0.759
},
"tldr": "EGCG reduces lipid peroxidation ...",
"unpaywall_license": {
"best_oa_location": {
"license": "cc-by"
}
},
"crossref_license": {
"license": "http://creativecommons.org/licenses/by/4.0/"
},
"openalex_license": null
}
```
---
## 🧠 Use Cases
Lit2Vec is optimized for:
* **Semantic search** β€” FAISS-style dense retrieval with paragraph embeddings
* **Retrieval-Augmented Generation (RAG)** β€” grounding LLMs on full-text chemistry papers
* **Summarization** β€” pre-generated TL;DRs for training and evaluation
* **Multi-label classification** β€” 18 chemistry subfields per article with confidence scores
* **Citation & licensing analysis** β€” metadata from Unpaywall, Crossref, OpenAlex
* **Knowledge graph construction** β€” integrate with PubChem, ChEMBL, patents, etc.
---
## πŸš€ Quickstart
### Python (manual extraction)
```python
from datasets import load_dataset
dataset = load_dataset(
"Bocklitz-Lab/Lit2Vec-dataset",
data_files={"train": "data/*.tar.gz"},
trust_remote_code=True,)
# Peek at one example
sample = dataset["train"][0]
print(sample["metadata"]) # Raw JSON string with title, authors, etc.
print(sample["predicted_subfield"]) # List of {label, score}
# Extract title from metadata
import json
metadata = json.loads(sample["metadata"])
print("Title:", metadata.get("title"))
# Display subfield predictions
print("Predicted subfields:")
for sub in sample["predicted_subfield"]:
print(f" {sub['label']}: {sub['score']:.3f}")
```
---
## βœ… Validation Subset
The `/validation/` folder contains `.tar.gz` archives to:
* Test schema compliance
* Integrate with pipelines
* Validate embeddings and metadata formats
---
## πŸͺͺ Licensing
Lit2Vec is **fully open-access**, curated under FAIR principles. All included articles passed license validation via:
* βœ… **Unpaywall**
* βœ… **Crossref**
* βœ… **OpenAlex**
Permissible licenses include:
* **CC-BY**
* **CC-BY-SA**
* **CC-BY-NC**
* **CC-BY-NC-SA**
* **Public Domain**
---
## πŸ“– Citation
Please cite the following if you use this dataset:
```bibtex
@article{amiri2025lit2vec,
title={Lit2Vec: A Large-Scale, Derivative-Permissive Chemistry Corpus for Retrieval-Augmented Generation and Semantic Search},
author={Amiri, Mahmoud and Bocklitz, Thomas},
journal={Preprint},
year={2025},
note={\url{https://huggingface.co/datasets/Bocklitz-Lab/Lit2Vec-dataset}}
}
```
---
## 🀝 Contributing
We welcome community contributions for:
* Dataset converters (e.g., Hugging Face `datasets` format)
* Example notebooks and pipelines
* Benchmarking scripts
Open a pull request or contact us!
---
**Lit2Vec** is developed at the **Leibniz Institute of Photonic Technology** and the **Institute of Physical Chemistry, Friedrich Schiller University Jena** to accelerate open science in chemistry and AI.