GROBID Documentation

repository·master·Indexed 26 days ago

https://github.com/grobidorg/grobid

A machine learning-based library for the automated extraction and structuring of bibliographic data from scientific PDF documents into XML/TEI format. It supports both CRF (Conditional Random Fields) and Deep Learning models, offering specialized modules for recognizing software mentions, datasets, physical quantities, and more. The library provides multi-threaded clients for Python, Java, Node.js, and Go to enable parallel batch processing of large PDF sets.

Tokens
52.1K
Snippets
86
Records
299
Agent score
87%

What's inside GROBID

  1. Overview of GROBID functionalities

    master

    GROBID (GeneRation Of BIbliographic Data) is a machine learning library designed to extract, parse, and restructure raw documents (primarily PDFs) into structured XML/TEI encoded documents. It is specifically optimized for technical and scientific publications.

    Key capabilities include:

    • Header Extraction: Parses bibliographical info like title, abstract, authors, affiliations, and keywords.
    • References Extraction: Parses references from PDFs with high F1-scores, covering metadata like DOI and PMID.
    • Citation Contexts: Recognizes and resolves citation callouts and associates them with full bibliographical references.
    • Full Text Structuring: Segments documents into paragraphs, section titles, figures, tables, and footnotes.
    • Metadata Parsing: Fine-grained parsing of names (person titles, forenames, etc.), affiliations, addresses, and ISO-normalized dates.
    • PDF Coordinates: Provides bounding boxes for extracted information to enable interactive PDF augmentation.
    • Consolidation: Resolves extracted references using services like biblio-glutton or the Crossref REST API.
    • Specialized Extraction: Supports patent/non-patent references and funder/funding information extraction.
  2. Explore GROBID extension modules

    master

    Several specialized modules extend GROBID's PDF processing and sequence labeling capabilities for structure-aware text mining:

    • software-mention: Recognizes software mentions and attributes.
    • datastet: Identifies dataset sections, names, and attributes.
    • grobid-quantities: Recognizes and normalizes physical quantities/measurements.
    • grobid-superconductors: Recognizes superconductor materials and properties.
    • entity-fishing: Extracts Wikidata entities and can annotate PDFs with interactive layouts.
    • grobid-ner: Named Entity Recognition.
    • grobid-astro: Recognizes astronomical entities.
    • grobid-bio: Bio-entity tagger.
    • grobid-dictionaries: Structures dictionaries from raw PDF format.
  3. GROBID technical architecture and performance

    master

    GROBID is a high-performance Java-based library designed for scalability and robustness.

    Core Technical Details:

    • Language & Integration: Written in Java. Uses JNI for native CRF (Conditional Random Fields) libraries (defaulting to a fork of Wapiti) and a Python JNI bridge (via JEP) for Deep Learning models (e.g., DeLFT, ELMo, BERT-CRF).
    • Performance: Capable of processing thousands of PDFs per minute on multi-core Linux machines. Full processing speeds can reach ~10.6 PDF per second on high-spec hardware.
    • Memory Management: Supports optional lazy loading of models. Memory usage varies by task: ~2GB for header extraction, ~3GB for citations, and ~4GB for full document structuring.
    • PDF Processing: Uses pdfalto (based on xpdf) for robust PDF parsing.
    • Output Format: Results are fully encoded in TEI (Text Encoding Initiative) XML.
    • Language Support: Includes support for CJK and Arabic languages via customized Lucene analyzers.

    Deployment Note: GROBID runs 'out of the box' on 64-bit Linux and macOS (both Intel and ARM).

  4. Understand GROBID extraction evaluation metrics

    master

    GROBID evaluation results are categorized into three main metadata groups: Header metadata, Citation metadata, and Fulltext structures. For each group, performance is measured using different matching strategies to account for variations in text extraction:

    • Strict Matching: Requires exact character-for-character matches.
    • Soft Matching: Ignores differences in punctuation, case, and whitespace.
    • Levenshtein Matching: Uses a minimum Levenshtein distance (e.g., 0.8 similarity).
    • Ratcliff/Obershelp Matching: Uses a minimum Ratcliff/Obershelp similarity (e.g., 0.95 similarity).

    Metrics are reported at both the Field-level (precision, recall, f1, support for specific labels like abstract or authors) and the Instance-level (overall correctness of extracted entities).

  5. Use Deep Learning models instead of default CRF

    master

    GROBID allows replacing default Wapiti CRF models with Deep Learning sequence labelling models trained with DeLFT. This integration uses Java Embedded Python (JEP) via CPython JNI, which is faster than the Tensorflow Java API and RPC serving.

    Key Considerations:

    • Performance: Neural models can be up to 50x slower than CRF, though batch processing (e.g., for citations) mitigates this.
    • Accuracy: Deep Learning models generally provide higher accuracy for specific tasks like citation, affiliation-address, and reference-segmenter.
    • Layout Features: For models involving layout (author, dates, etc.), use architectures with an additional feature channel (e.g., BidLSTM_CRF_FEATURES) for better results.
  6. Use Layout Tokens for robust document parsing

    master

    Unlike many parsers that operate on raw text, GROBID operates on Layout Tokens. This allows the models to exploit visual and structural information to improve recognition accuracy and robustness against layout variations.

    A Layout Token contains:

    • The Unicode text token.
    • Rich text information: font size, font name, and style attributes (bold, italic, superscript/subscript).
    • Bounding boxes: the precise location in the PDF.

    These tokens are used to derive additional layout features such as indentation, relative spacing, character density, and relative page positions. This approach enables GROBID to synchronize labeling with bounding boxes, allowing you to render extracted structures (like equations or figures) directly onto the original PDF source for visualization.

  7. Understand GROBID 0.9.0 bioRxiv Benchmarking Results

    master

    This benchmark evaluates GROBID version 0.9.0 against the bioRxiv test set (biorxiv-10k-test-2000). It provides performance metrics for header metadata extraction, including authors, affiliations, titles, and abstracts.

    Model Configurations Used:

    • Header model: BidLSTM_ChainCRF_FEATURES (sequence labeling)
    • Reference-segmenter model: BidLSTM_ChainCRF_FEATURES (sequence labeling)
    • Citation model: BidLSTM-CRF-FEATURES (sequence labeling)
    • Affiliation-address model: BidLSTM_CRF_FEATURES (sequence labeling)
    • Other models: CRF Wapiti (sequence labelling engine)

    Performance Notes:

    • Consolidation: Header extractions are consolidated using the biblio-glutton service by default.
    • Deep Learning Models: Newer master snapshots using Deep Learning models may offer higher accuracy but require more CPU/GPU resources and have slower runtimes compared to the CRF-only models used in this benchmark.
    • Runtime Example: Processing 2000 PDFs took 1713 seconds (0.85s per PDF) on a system with 16 CPUs and a GeForce GTX 1080 Ti GPU. Using CRF-only models can reduce this to approximately 0.31s per PDF on 4 CPUs.
  8. Understand GROBID 0.9.0 eLife Benchmarking Results

    master

    GROBID version 0.9.0 was benchmarked against the eLife test set (984 PDF preprints). This benchmark evaluates the performance of various sequence labeling models used for header, citation, reference-segmenter, and affiliation-address extraction.

    Model Configurations Used:

    • Header model: BidLSTM_ChainCRF_FEATURES
    • Reference-segmenter model: BidLSTM_ChainCRF_FEATURES
    • Citation model: BidLSTM-CRF-FEATURES
    • Affiliation-address model: BidLSTM_CRF_FEATURES
    • Other models: CRF Wapiti as the sequence labelling engine.

    Performance Characteristics:

    • Deep Learning Models: Provide higher accuracy but require more CPU/GPU resources and have slower runtimes.
    • CRF-only Models: Significantly faster (approx. 0.50 seconds per PDF on 4 CPU/8 threads) compared to Deep Learning models (approx. 1.15 seconds per PDF on 16 CPU/32 threads + GPU).
    • Header Consolidation: By default, header extractions are consolidated using the biblio-glutton service. Using the CrossRef REST API as a consolidation service is an alternative but is much slower.
  9. Use CRF++ CRF library

    master
    CRF++ is the historical CRF library used by GROBID. Note that CRF++ is deprecated and has not been supported since GROBID version 0.4. Wapiti is preferred as it is significantly faster and uses much less memory. If you must use CRF++, you will need to manually copy libcrfpp.so and its linked libraries to GROBID-ROOT-DIRECTORY/grobid-home/lib/lin-<nb bits of the OS> and update the dependency version in build.gradle.
  10. Understand GROBID evaluation metrics and matching modes

    master

    GROBID evaluation results are categorized by the type of matching used to compare extracted data against ground truth. When interpreting performance (precision, recall, F1), consider the following modes:

    • Strict Matching: Requires exact matches of the text.
    • Soft Matching: Ignores mismatches in punctuation, case, and whitespace.
    • Levenshtein Matching: Uses Levenshtein distance (e.g., a minimum distance threshold of 0.8).
    • Ratcliff/Obershelp Matching: Uses the Ratcliff/Obershelp similarity algorithm (e.g., a minimum similarity threshold of 0.95).

    Results are typically reported at both the Field-level (performance on specific labels like abstract, authors, title) and the Instance-level (performance on the entire document or citation entry).

  11. Understand GROBID 0.9.0 Benchmarking Configuration

    master

    GROBID 0.9.0 uses a combination of Deep Learning and CRF models for different extraction tasks. When evaluating performance against datasets like PubMed Central (PMC), the following model configurations are used:

    • Header model: BidLSTM_ChainCRF_FEATURES (sequence labeling)
    • Reference-segmenter model: BidLSTM_ChainCRF_FEATURES (sequence labeling)
    • Citation model: BidLSTM-CRF-FEATURES (sequence labeling)
    • Affiliation-address model: BidLSTM_CRF_FEATURES (sequence labeling)
    • Other models: CRF Wapiti (sequence labelling engine)

    Note on Performance vs. Accuracy: Deep Learning models (available in newer master snapshots) typically provide higher accuracy but require more CPU/GPU resources and have slower runtimes compared to CRF-only models. For example, in PMC benchmarking, CRF-only models processed PDFs at ~0.24s/PDF, while the full DL-enabled stack processed them at ~0.75s/PDF.

  12. Understand GROBID eLife Benchmark Metrics

    master

    GROBID's performance is evaluated using several matching strategies to account for variations in text extraction. When interpreting benchmark results (such as the eLife dataset), note the following matching types:

    • Strict Matching: Requires exact matches of the extracted text.
    • Soft Matching: Ignores mismatches in punctuation, case, and whitespace.
    • Levenshtein Matching: Uses a minimum Levenshtein distance (e.g., 0.8) to allow for minor character differences.
    • Ratcliff/Obershelp Matching: Uses a minimum similarity threshold (e.g., 0.95).

    Benchmarks are typically reported using Precision, Recall, and F1-score at both the field level and the instance level.