This Python script reads USCIS AAO decision PDFs, extracts the main reasons for denial (for the 3 NIW prongs), and compares each case side-by-side with your own EB2-NIW petition strengths.
You can automatically compare your case against 7,800+ real AAO decisions!
git clone https://github.com/JP2670/eb2NIW.git
cd eb2NIW
pip install -r requirements.txt
This script uses OpenAI GPT-4o model.
You need an OpenAI API key to use it.
openai.api_key = "your-api-key-here"
⚡ Important: You will need to add a small amount of balance ($5–$10) to your OpenAI account to run this full project.
Cost estimate: - Around $30–$40 to process ~7,700 PDFs using GPT-4o-mini model (April 2025 prices).
Before running the script, you need to tell the program what your own EB2-NIW petition looks like.
You do this by editing the following part of process_eb2niw_prongs_compare.py:
In the beginning of the script, you will find this block:
my_case = {
"Prong1": "Summarize why your National Importance is strong",
"Prong2": "Summarize why you are Well Positioned",
"Prong3": "Summarize why Labor Waiver is justified for you"
}
You need to replace the example texts with short 1–2 sentence summaries based on your real EB2-NIW petition.
my_case = {
"Prong1": "Strong: working on cutting-edge technology aligned with U.S. innovation goals.",
"Prong2": "5+ years professional experience in major U.S. organizations, demonstrated leadership roles.",
"Prong3": "Immediate contribution to national innovation efforts; delay would harm competitiveness."
}
my_case = {
"Prong1": "Strong: Research directly improves U.S. healthcare outcomes using AI for early disease detection.",
"Prong2": "4+ years leading projects at a top U.S. university hospital and multiple published papers.",
"Prong3": "Immediate healthcare application; delay would risk public health improvements."
}
my_case = {
"Prong1": "Strong: Directly advising U.S. state governments on economic policy initiatives.",
"Prong2": "8 years of leadership roles in U.S. think tanks, direct policy impact proven.",
"Prong3": "Delay would harm ongoing critical public sector projects; immediate national impact needed."
}
✅ This will make your script work correctly for your unique situation!
The script will generate a file called summary_prongs_comparison.csv with the following columns:
| Column | Description |
|---|---|
| PDF Link | Link to original AAO decision |
| Prong 1 Reason | Why Prong 1 failed for that case |
| Prong 2 Reason | Why Prong 2 failed |
| Prong 3 Reason | Why Prong 3 failed |
| Prong 1 Verdict | Your case stronger / Mixed |
| Prong 2 Verdict | Your case stronger / Mixed |
| Prong 3 Verdict | Your case stronger / Mixed |
| Final Verdict | Overall assessment: Stronger / Mixed |
Pull requests, improvements, and feature ideas are welcome!
Open-source for personal and educational use.
$ claude mcp add eb2NIW \
-- python -m otcore.mcp_server <graph>