DDI Corpus 2013 – Drug-Drug Interaction Query Skill
SkillProductivityThe DDI Corpus 2013 is the standard benchmark for drug-drug interaction (DDI) extraction from biomedical text. Each XML file contains sentences with annotated drug entities and pairwise DDI labels.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the DDI Corpus 2013 skill
About this skill
🦀 Agentic RAG for drug intelligence · 57 skills · 15 task categories · DTI · ADR · DDI · PGx · Repurposing · Powered by LangGraph
What this skill tells your AI
The instructions your AI receives, as published by qsong-github/drugclaw in skills/drug_nlp/ddi_corpus/SKILL.md and read by ahel’s review.
Overview
| Field | Value |
|---|---|
| Resource | DDI Corpus 2013 |
| Category | Drug-centric / Drug NLP & Text Mining |
| Source | GitHub |
| Paper | Herrero-Zazo et al., 2013 |
| Corpus Size | ~2,740 unique entities, ~5,000 annotated DDI pairs |
| Sources | DrugBank descriptions + MEDLINE abstracts |
The DDI Corpus 2013 is the standard benchmark for drug-drug interaction (DDI) extraction from biomedical text. Each XML file contains sentences with annotated drug entities and pairwise DDI labels.
DDI Types:
mechanism– pharmacokinetic mechanism described (e.g., altered absorption/metabolism)effect– clinical effect of the interaction (e.g., increased bleeding risk)advise– recommendation or warning about co-administrationint– stated interaction without further detail
Entity Types: drug, group, brand, drug_n (active substance not approved for human use)
Setup
1. Download & extract (one-time):
git clone https://github.com/isegura/DDICorpus.git
cd DDICorpus
unzip DDICorpus-2013.zip
2. Set the corpus path in 30_DDI_Corpus_2013.py:
CORPUS_ROOT = "/path/to/DDICorpus-master" # contains DDICorpus/Train/ and DDICorpus/Test/
Or pass --root at runtime or set env var DDI_CORPUS_ROOT.
Usage
Python API
from 30_DDI_Corpus_2013 import query_entities, list_all_entities, corpus_stats
# Query a single drug
result = query_entities("aspirin")
# Query multiple drugs at once
result = query_entities(["warfarin", "metformin", "digoxin"])
# List all entity names in the corpus
names = list_all_entities()
# Get corpus-level statistics
stats = corpus_stats()
CLI (直接运行)
python 30_DDI_Corpus_2013.py
直接运行即输出 demo 结果(corpus 统计 → 单实体查询 → 批量查询 → 未找到示例)。
修改 __main__ 块中的实体名即可自定义查询。
Output Format
query_entities returns a JSON string. Each element:
{
"query": "aspirin",
"found": true,
"canonical_names": ["ASPIRIN", "Aspirin", "aspirin"],
"entity_types": ["brand", "drug"],
"total_interactions": 65,
"interactions": [
{
"partner": "ketoprofen",
"ddi_type": "mechanism",
"sentence": "concurrent administration of aspirin decreased ketoprofen protein binding...",
"source": "Train/DrugBank"
}
],
"example_sentences": ["..."]
}
If an entity is not found: {"query": "xyz", "found": false}.
Parameters
| Parameter | Default | Description |
|---|---|---|
entities | (required) | str or list[str] — drug names to look up (case-insensitive) |
corpus_root | CORPUS_ROOT | Path to the extracted DDICorpus-master directory |
max_interactions | 20 | Maximum interaction records returned per entity |
max_sentences | 5 | Maximum example sentences returned per entity |
Dependencies
Python 3.10+ standard library only (xml.etree.ElementTree, json, os, collections). No third-party packages required.
Signals
- GitHub stars
- 116
- Forks
- 3
- Last commit
- Aug 2026
Advanced
- Item type
- skill
- Key
ddi-corpus- Source
- github.com/qsong-github/drugclaw
github.com/qsong-github/drugclaw
Related picks
Skill · wshobson
The pick for Pythonpython-pro
Skill · jeffallan
The pick for Pythonsocial
Skill · coreyhaines31
More in Productivitygws-calendar
Skill · googleworkspace
More in Productivitylark-minutes
Skill · larksuite
More in Productivitylark-workflow-standup-report
Skill · larksuite
More in Productivity