DEV Community

Ken Deng
Ken Deng

Posted on

Automating Systematic Reviews: How GROBID and spaCy Can Save You Months of Manual Screening

You’ve spent weeks reading 2,000 titles and abstracts, only to realize the real pain begins with full-text PDFs. Extracting sample sizes, study designs, and effect sizes from hundreds of heterogeneous articles is the bottleneck that turns systematic reviews into year-long projects. But with the right open-source tools, you can automate the grunt work while keeping your methodological rigor intact.

The Principle: Structured Extraction via TEI XML

The key to reliable automation is converting messy PDFs into structured, machine-readable data. GROBID (GeneRation Of Bibliographic Data) transforms PDFs into TEI XML—a complete, hierarchical document model that preserves sections, headings, paragraphs, figures, tables, headers (title, authors, affiliations, abstract), and references. Once your PDFs are in TEI XML, you can apply spaCy for rule-based and NER-based extraction without wrestling with PDF layouts or OCR artifacts.

Mini-Scenario in Action

You run 50 PDFs through GROBID and get clean TEI XML outputs. Your spaCy rule for “N=” captures 80% of sample sizes—but misses 15% because they appear in table footnotes. You refine the rule to also scan <table> and <note> elements, then re-run. Your recall jumps to 95% in under an hour.

Implementation: Three High-Level Steps

Step 1: Environment and Corpus Setup

Set up a local Python environment (you’ll need significant CPU/RAM for batch processing—cloud credits help for thousands of PDFs). Install GROBID via Docker or the Python client (grobid-client-python). Prepare a small test corpus of 10–20 PDFs to validate your pipeline.

Step 2: Batch Conversion with Validation

Run GROBID on your test set to generate TEI XML. Create a validation checklist for each output: Did the header extract all authors? Are references parsed? Are tables preserved? Use this feedback to tweak GROBID’s configuration (e.g., language models) before scaling to your full corpus.

Step 3: Rule-Based and NER Extraction with spaCy

Load the TEI XML text into spaCy. Write rule-based matchers for target variables (e.g., sample size patterns like “N=123” or “n=45”). For study design, use a heuristic approach: train a simple NER model to flag sentences with “randomized,” “cohort,” or “qualitative,” then validate against your research question. Iterate on a small sample—this “teaching loop” catches mislabeling (e.g., “a previous randomized trial” misidentified as the current study’s design) and false positives from table footnotes.

Conclusion

GROBID gives you structured, reliable PDF text, and spaCy lets you extract what matters with rules and lightweight NER. The automation isn’t perfect—you’ll still validate and refine—but it turns months of manual extraction into days of focused, transparent work.

Top comments (0)