Open-source software from the Eviction Research Network
extract-text reads eviction court documents into a table.
Many courts keep eviction filings only as page images, and a filing cannot be counted or mapped until it is in a table. extract-text reads e-filed PDFs, scanned PDFs, and TIFF images and returns one row per document, with the plaintiffs, the defendants, the address where the defendants were served, the plaintiff’s attorney, and the case number.
Free and open source. It runs on your own computer, from R or Python, on Mac, Windows, and Linux.
Two engines
Rules, a local AI model, or both
You choose the engine on each run.
No AI of any kind
The rules engine
It reads with written rules and the layout of the page. A scanned page is first turned into text by OCR (optical character recognition). The same document always gives the same output, so the code and the manual call it the deterministic engine. Every value records the rule that found it and where on the page it was found. It uses no AI and no network connection, so agencies whose policies do not permit AI tools can use it alone.
Optional
The local AI engine
A language model reads the page images. It runs on your own computer through Ollama, a free program that runs AI models locally, and it sends nothing to any cloud service. It reads what rules and OCR cannot, handwriting above all.
When you run both, the package compares the two addresses on every document and flags each disagreement for a person to review. Either engine also flags a value it is unsure of. Neither guesses a value to keep a row looking complete.
Video
extract-text in one minute
Read what the video says
- extract-text reads eviction court documents into a table of the case number, plaintiff, defendant, address, and attorney.
- Many courts keep eviction filings only as page images. The names, addresses, and case numbers are printed on the page. Filings cannot be counted or mapped until they are in a table.
- extract-text reads a document in one of three ways. The rules engine uses written rules and no AI. The same document always gives the same answer, and agencies that cannot use AI tools can use it. The local AI engine is a language model that reads the page image, handwriting included. It runs on your own computer and sends nothing to a cloud service. Run both and the two answers are compared, with every disagreement flagged for a person to review.
- Documents stay on your computer. With the default engines, tenants' names and addresses never leave it. Once installed, extract-text runs with the network unplugged.
- A little grading shows what to trust. Grade a random 50 of your documents on the review page. The score says how accurate each field is on your documents. The boxes you draw teach the engine where your court's form prints each field. No model is trained, and a person approves what the engine learns.
- extract-text was designed to work on other court documents that follow American conventions. Grade a sample first. Accuracy has been measured only on Washington State eviction filings. Future versions are planned to read the text of a filing, such as the reason for the eviction.
- extract-text is free and open source, at github.com/evictionresearch/extract-text. Its authors are Cheng Ren, Tim Thomas, and Aaron Culich.
Privacy
Your documents stay on your computer
Court filings carry tenants' names and addresses. With the default engines, the documents, the page images, and the extracted values never leave your computer. The package sends no usage data, and once installed it runs with the network unplugged. Every example and test document in the code repository is made up.
Accuracy
Grade a random 50 before you trust a run
The Eviction Research Network wrote and measured the rules on Washington State filings. Another court's forms, scan quality, or decade can make them misread a field without raising a flag, and accuracy differs by field. On a random 50 King County summonses from 2017, the rules engine read the street right on about 85 percent and the plaintiff on about 40 percent (October 2026).
So the first run is a random 50 of your own documents. You grade them on a review page that shows each document beside what the engine read. The package scores the engine against your answers. You scan the whole folder only when the fields you need are accurate enough.
What grading is for
Grading happens on your own computer, and it does three things for your own run.
1
It measures the engine
The score counts, field by field, how often the engine was right on your documents. You decide from it which fields are accurate enough to use.
2
It corrects your table
Every document you grade carries your answer in the final table, in place of the engine's.
3
It teaches the engine your form
The boxes you draw show where your court's form prints each field. The package learns a template from them and uses it only after you approve it.
How the rules improve
Grading does not change the rules that read the text. A person changes them, in one of two ways. You can change them on your own copy of the package, and Changing the rules shows how. Or the Eviction Research Network can write rule improvements from your corrections and release them in the package, where every user gets them. Corrections hold tenants' names and addresses, so that takes a data agreement between your organization and UC Berkeley before anything is sent. Write to evictions@berkeley.edu to ask.
First steps
Getting started, in outline
The Get started page has seven steps, each a few lines of R to copy and run. They fall into three stages.
1
Steps 1 and 2
Install
Install four free programs that open PDFs, read scanned pages, and run the engine (poppler, tesseract, Python, and git), then extract-text itself. A checkup looks at your computer and names anything missing.
2
Steps 3 to 5
Test on a sample
Read a made-up summons, scan a random 50 of your own documents, grade them on the review page, and score the engine.
3
Steps 6 and 7
Run the whole folder
Scan every document, grade a second random 50, and build the final table of cases.
Uses
Who extract-text is for
The Eviction Research Network built extract-text for work that describes or reduces displacement. That work includes research, legal services, journalism, policy analysis, court administration, and tenant defense.
Running extract-text takes someone who works in R, Python, or a terminal. If that is not you, send this page to an analyst on your staff or at a partner organization, or write to evictions@berkeley.edu.
An eviction filing is not a finding of wrongdoing. The project does not support tenant screening, landlord blacklists, debt collection, or the use of these records to locate people for enforcement.
Publications
The research behind it
Cityscape, 2024
Toward a National Eviction Data Collection Strategy Using Natural Language Processing
Thomas, Ramiller, Ren, and Toomet describe the method this package grew from and apply it to more than 110,000 Washington eviction filings from 2004 to 2017.
Dissertation, UC Berkeley, 2024
Not All Eviction Cases are Alike
Cheng Ren read 772,629 court files from 56,070 Pierce County cases, 2004 to 2022, and followed each case past the filing to dismissal, judgment, and the sheriff.
People
Cheng Ren, Tim Thomas, and Aaron Culich
The authors work at the University at Albany, SUNY, and the University of California, Berkeley.
Under development
Development timeline
extract-text is being built in three stages. The first is released, and the other two are open. Until all three are done, command options and output columns can still change between releases.
-
Stage 1 · Done
The rules engine
The engine reads the parties, the address, the attorney, and the case number with written rules and no AI. It is released, along with the review page for grading and form templates. Its rules keep improving as graded documents come in.
-
Stage 2 · Open
Local AI integration and improvements
The local AI engine runs today as an option. The work that remains is to measure it against hand-graded documents, improve what it reads, and make it easier to set up.
-
Stage 3 · Open
Large text evaluation
Future versions are planned to read the body of a filing, such as the reason for the eviction.