Structured information extraction from complex scientific text with fine-tuned large language models

Alexander Dunn, John Dagdelen, Nicholas Walker, Sang‐Hoon Lee, Andrew Rosen, Gerbrand Ceder, Kristin A. Persson, Anubhav Jain · DOI

Abstract

Intelligently extracting and linking complex scientific information from unstructured text is a challenging endeavor particularly for those inexperienced with natural language processing. Here, we present a simple sequence-to-sequence approach to joint named entity recognition and relation extraction for complex hierarchical information in scientific text. The approach leverages a pre-trained large language model (LLM), GPT-3, that is fine-tuned on approximately 500 pairs of prompts (inputs) and completions (outputs). Information is extracted either from single sentences or across sentences in abstracts/passages, and the output can be returned as simple English sentences or a more structured format, such as a list of JSON objects. We demonstrate that LLMs trained in this way are capable of accurately extracting useful records of complex scientific knowledge for three representative tasks in materials chemistry: linking dopants with their host materials, cataloging metal-organic frameworks, and general chemistry/phase/morphology/application information extraction. This approach represents a simple, accessible, and highly-flexible route to obtaining large databases of structured knowledge extracted from unstructured text.

Introduction

The vast majority of scientific knowledge remains "trapped" within the prose of millions of academic publications. Manually searching for specific data, such as dopants for semiconductors or properties of metal-organic frameworks (MOFs), is labor-intensive and often results in incomplete datasets. Automating this process using Natural Language Processing (NLP) has traditionally relied on multi-stage "pipelines" involving separate models for Named Entity Recognition (NER), coreference resolution, and Relation Extraction (RE).

Traditional NLP pipelines are brittle and require multiple discrete steps, leading to error propagation.

These pipelines are often brittle—errors in early stages propagate through the system—and struggle to capture the complex, hierarchical relationships common in scientific literature. Standard models often require enumerating every possible binary relationship, which is inefficient for the nested data structures found in chemistry and materials science.

Methodology

This work introduces a streamlined sequence-to-sequence (seq2seq) approach using fine-tuned Large Language Models (LLMs), specifically GPT-3. Instead of a multi-stage pipeline, the model is trained to perform joint NER and RE in a single pass, converting raw text prompts directly into structured JSON completions.

The proposed method extracts hierarchical entity relationships directly into a structured JSON format without explicit enumeration.

Key methodological innovations include:

  • Structured Hierarchical Output: By training the model to output JSON, complex nested relationships (e.g., a material, its morphology, and its specific application) are captured naturally without the need to enumerate every possible binary relationship.
  • Implicit Normalization: The LLM can normalize chemical formulas (e.g., "Li Co O2" to "LiCoO2") and correct typos during extraction, a task that requires separate post-processing in traditional systems.
  • Human-in-the-Loop Annotation: To minimize the burden of creating training data, a partially trained model suggested extractions that human experts then verified or corrected. This reduced annotation time by approximately 60%, from 100 seconds to 40 seconds per abstract.

Datasets and Evaluation

The approach was validated on three materials science datasets derived from a corpus of over 5 million abstracts:

  1. Doping: Host materials and their associated dopants (413 sentences).
  2. MOFs: Constituents and applications of Metal-Organic Frameworks (507 abstracts).
  3. General Materials: Broad extraction of chemistry, phase, morphology, and application data (634 abstracts).

Performance was compared against specialized models like MatBERT (a BERT model specialized for materials science) and existing seq2rel frameworks.

Key Results

The fine-tuned LLM demonstrated state-of-the-art performance across all tasks. In the host-dopant linking task, it achieved an F1 score of 0.849, significantly outperforming MatBERT (0.545) and seq2rel (0.60).

A notable finding was that performance plateaued with relatively few training examples (100–500), making the method highly accessible for niche scientific domains. Furthermore, the model benefited from "multi-task" learning; including additional context like "modifiers" or "results" in the extraction schema improved accuracy on the primary entities by providing the model with a better understanding of the sentence structure.

Conclusion and Future Work

Fine-tuned LLMs offer a flexible, high-performance route for extracting structured knowledge from unstructured scientific text. The ability to define custom JSON schemas allows researchers without deep NLP expertise to build specialized databases. Future directions include extending this capability to extract data from tables and figures and exploring open-source LLM alternatives to mitigate reliance on proprietary APIs. An online demo of this approach is available at http://www.matscholar.com/info-extraction.

Summary updated

BibTeX
@misc{dunn2022structured,
  author = {Alexander Dunn and John Dagdelen and Nicholas Walker and Sang‐Hoon Lee and Andrew Rosen and Gerbrand Ceder and Kristin A. Persson and Anubhav Jain},
  title = {{Structured information extraction from complex scientific text with fine-tuned large language models}},
  year = {2022},
  eprint = {2212.05238},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.05238},
}
Figure