
AI-Powered Document Analysis
EvalCommunity Academy – Practical Tutorial
AI-Powered Document Analysis for M&E
Extract structured indicators from grant proposals, evaluation reports, and program documents at scale. Measure mixed methods use, stakeholder engagement, transparency, gender integration, and more.
The document analysis challenge in M&E
Imagine you are an M&E officer for a large international NGO. Your organization has funded 200 research and evaluation projects over the past decade. Leadership asks:
“Do our funded projects produce stronger evidence than unfunded ones? Do they use mixed methods? Are they transparent? Do they engage stakeholders meaningfully?”
You have the documents: grant proposals, final reports, publications. But the answers are buried inside hundreds of PDFs. Manual coding would take months and be prone to inconsistency. Citation counts alone are too shallow.
This tutorial shows how AI-assisted document extraction can help you process narrative documents at scale — reliably, quickly, and transparently.
Real-world application: 3ie’s research grant evaluation
Organization: International Initiative for Impact Evaluation (3ie)
Source: Making AI work: Practical applications in impact evaluation (3ie blog, 2024)
3ie conducted an impact evaluation comparing hundreds of funded vs. unfunded research proposals (2009–2020) to answer: Do research grants actually improve the creation and quality of evidence?
What they had
Hundreds of full-text proposals and publications. Manual coding would take months.
What they measured
Richer dimensions beyond citations: mixed methods use, transparency practices, stakeholder engagement.
How AI helped
A script calling a large language model extracted variables automatically. Validation against human coding demonstrated substantial agreement for several extracted variables.
Key insight for M&E professionals:
AI enabled 3ie to scale document analysis that would otherwise require months of manual work, while maintaining high reliability. The same method works for any M&E portfolio — grant programs, country office comparisons, or evaluation quality tracking.
What you will learn
Define extractable variables
Translate M&E questions into clear fields with coding rules.
Build effective prompts
Create prompts that return consistent, machine-readable data.
Run at scale
Process hundreds of documents using free tools like Google Colab.
Validate and analyze
Measure AI-human agreement and use extracted variables in analysis.
When should you use this method?
AI-assisted document extraction is particularly valuable for:
Portfolio reviews
Compare quality across funded projects or country offices.
Grant proposal analysis
Extract mixed methods, partnerships, and theory of change elements.
Evaluation quality audits
Systematically assess methodology and limitations reporting.
Donor reporting reviews
Verify outcome claims against source documents.
Gender integration assessments
Measure gender-disaggregated data and analysis across portfolios.
Learning and knowledge management
Extract lessons and recommendations at scale.
Which documents can you process?
This method works on any text-rich document common in international development M&E.
Ethics, privacy, and responsible AI use
- Data privacy: Do not upload sensitive or personally identifiable information to commercial APIs without consent.
- Confidentiality: For confidential proposals involving vulnerable populations, use on-premise models.
- Human oversight: Always review AI outputs, especially for complex or high-stakes variables.
- Transparency: Document that AI was used for extraction and include accuracy metrics.
What AI still cannot do reliably
Methodological honesty matters. AI excels at structured extraction but struggles with these evaluation tasks. Use this matrix to plan your human review strategy.
| Variable type | Extraction difficulty | Why? |
|---|---|---|
| Document ID, date, title | Easy | Explicit text patterns |
| Mixed methods used | Easy to moderate | Keyword presence is reliable |
| Gender integration mentioned | Moderate | “Gender” appears, but depth unclear |
| Stakeholder engagement quality | Hard | Requires judgment: token vs. meaningful |
| Evaluation credibility / rigor | Very hard | Depends on methodology, sampling, limitations |
Recommendation:
For “very hard” variables, do not rely on AI alone. Use AI to flag candidate text passages, then have a human evaluator make the final judgment.
Step-by-step AI-assisted document analysis workflow
1
Define your extraction variables
Example from 3ie’s evaluation:
| Variable | Definition | Values |
|---|---|---|
| mixed_methods_used | Both quantitative AND qualitative methods named | yes/no/partial |
| stakeholder_engagement | Beneficiaries or partners in design/implementation | yes/no/weak |
2
Prepare document inventory
/documents/
proposal_001.pdf
evalreport_001.pdf
document_inventory.csv (ID, type, year, funding_status)
3
Build your extraction prompt
You are an M&E data extraction assistant. Return ONLY valid JSON.
{
"mixed_methods_used": "yes/no/partial",
"stakeholder_engagement": "yes/no/weak",
"transparency_practices": "yes/no"
}
Coding rules:
- mixed_methods: "yes" if BOTH quantitative AND qualitative methods named.
- stakeholder_engagement: "yes" if beneficiaries/partners in design/implementation.
- transparency: "yes" if pre-registration, data sharing, or open materials mentioned.
4
Run extraction at scale
Use Google Colab with the script below. Do not hardcode API keys. Use environment variables or Colab Secrets. Costs vary depending on document length, model choice, and API pricing.
# Google Colab script - OpenAI SDK v1.0+
!pip install openai pandas PyPDF2
from openai import OpenAI
import pandas as pd
import PyPDF2
from google.colab import files, userdata
client = OpenAI(api_key=userdata.get('OPENAI_API_KEY'))
uploaded = files.upload()
def extract_text_from_pdf(pdf_path):
text = ""
with open(pdf_path, 'rb') as f:
for page in PyPDF2.PdfReader(f).pages:
text += page.extract_text() or ""
return text[:10000]
results = []
for filename in uploaded.keys():
doc_text = extract_text_from_pdf(filename)
# Use a suitable model available in your OpenAI account
# Refer to OpenAI documentation for current recommended models
response = client.chat.completions.create(
model="REPLACE_WITH_YOUR_MODEL", # e.g., gpt-4o, gpt-4-turbo, or gpt-3.5-turbo
messages=[{"role": "user", "content": f"Extract JSON: mixed_methods (yes/no/partial), stakeholder_engagement (yes/no/weak), transparency (yes/no)\n\n{doc_text[:5000]}"}],
temperature=0.1,
response_format={"type": "json_object"}
)
results.append({"document": filename, "extraction": response.choices[0].message.content})
pd.DataFrame(results).to_csv("extracted_variables.csv", index=False)
print("Done! Download extracted_variables.csv")
Model selection: Use a model available in your OpenAI account. Check OpenAI’s current documentation for recommended models. Replace REPLACE_WITH_YOUR_MODEL with your chosen model name.
5
Validate against human coding
Randomly sample 10-15% of documents for human review. Calculate agreement rates.
| Variable | Illustrative agreement |
|---|---|
| Document ID, date | Near 100% |
| Mixed methods | 90-95% |
| Stakeholder engagement | 80-90% |
Note: These ranges are illustrative. Actual agreement depends on document quality, coding rules, model choice, and validation design. Always test on your own documents.
6
Use extracted variables in analysis
Funded vs. unfunded comparison
Do funded proposals show higher rates of mixed methods use?
Transparency trends over time
Has reporting of data sharing increased over the past decade?
M&E variable extraction matrix
Prompt examples for M&E extraction
Grant proposal extraction
Extract: theory_of_change_present (yes/no/implied), mixed_methods_planned (yes/no/partial).
Evaluation report quality
Extract: methodology_described (yes/no), limitations_acknowledged (yes/no).
Gender integration assessment
Extract: gender_disaggregated_data (yes/no), gender_analysis_performed (yes/no).
Frequently asked questions
Can AI replace human coding for M&E document review?
No. AI accelerates structured extraction, but human review of 10-15% of outputs is essential.
How many documents can AI process?
Hundreds or thousands. Costs vary depending on document length, model choice, and API pricing.
What accuracy should I expect?
Simple variables: near-perfect. Complex judgment variables: typically 80-90% agreement with human coders. Always test on your own documents.
Which document types work best?
Well-structured text documents like proposals, evaluation reports, and baseline studies.
Implementation checklist
From manual coding to strategic insights
AI-assisted document extraction does not replace M&E judgment. It scales it — freeing you to focus on interpretation.
Reviewed by EvalCommunity Academy — Monitoring, Evaluation, Research and AI Learning Platform
Source: Adapted from 3ie blog “Making AI work: Practical applications in impact evaluation”
