$npx -y skills add QSong-github/DrugClaw --skill ade_corpusADE Corpus V2 — Adverse Drug Event relation extraction dataset from annotated PubMed case reports.
| 1 | # 32_ADE_Corpus |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | **ADE Corpus V2** — Adverse Drug Event relation extraction dataset from annotated PubMed case reports. |
| 6 | |
| 7 | | Field | Value | |
| 8 | |-------|-------| |
| 9 | | Category | Drug-centric | |
| 10 | | Subcategory | Drug NLP / Text Mining | |
| 11 | | Source | [GitHub](https://github.com/trunghlt/AdverseDrugReaction/tree/master/ADE-Corpus-V2) | |
| 12 | | Paper | [ACL 2016](https://aclanthology.org/C16-1084/) | |
| 13 | | Local Path | `resources_metadata/drug_nlp/ADECorpus/ADE-Corpus-V2` | |
| 14 | |
| 15 | ## Data Files |
| 16 | |
| 17 | | File | Content | |
| 18 | |------|---------| |
| 19 | | `DRUG-AE.rel` | Drug ↔ Adverse Event relation pairs with source sentences | |
| 20 | | `DRUG-DOSE.rel` | Drug ↔ Dose relation pairs with source sentences | |
| 21 | | `ADE-NEG.txt` | Negative examples (sentences without adverse events) | |
| 22 | |
| 23 | ## Quick Start |
| 24 | |
| 25 | ```python |
| 26 | from 32_ADE_Corpus import ADECorpus # or rename to ade_corpus |
| 27 | |
| 28 | corpus = ADECorpus() |
| 29 | |
| 30 | # Single entity |
| 31 | print(corpus.query("aspirin")) |
| 32 | |
| 33 | # Multiple entities |
| 34 | print(corpus.query(["lithium", "hepatotoxicity"])) |
| 35 | |
| 36 | # Corpus statistics |
| 37 | print(corpus.stats()) |
| 38 | ``` |
| 39 | |
| 40 | ## Query Input / Output |
| 41 | |
| 42 | ### Input |
| 43 | |
| 44 | `corpus.query(entities)` — accepts `str` or `list[str]`. |
| 45 | Each entity is matched case-insensitively against both drug names and adverse event names. |
| 46 | |
| 47 | ### Output (JSON) |
| 48 | |
| 49 | ```json |
| 50 | { |
| 51 | "aspirin": { |
| 52 | "entity": "aspirin", |
| 53 | "matched_as_drug": true, |
| 54 | "matched_as_adverse_event": false, |
| 55 | "total_mentions": 42, |
| 56 | "adverse_events": ["bleeding", "tinnitus", "..."], |
| 57 | "doses": ["100mg", "..."], |
| 58 | "related_drugs": null, |
| 59 | "pubmed_ids": ["12345678", "..."], |
| 60 | "sample_sentences": ["A 65-year-old patient developed ..."] |
| 61 | } |
| 62 | } |
| 63 | ``` |
| 64 | |
| 65 | | Field | Description | |
| 66 | |-------|-------------| |
| 67 | | `matched_as_drug` | Entity found as a drug name | |
| 68 | | `matched_as_adverse_event` | Entity found as an adverse event name | |
| 69 | | `total_mentions` | Total matching records | |
| 70 | | `adverse_events` | List of associated adverse events (when matched as drug) | |
| 71 | | `doses` | List of associated doses (when matched as drug) | |
| 72 | | `related_drugs` | List of drugs causing this event (when matched as AE) | |
| 73 | | `pubmed_ids` | Up to 10 source PubMed IDs | |
| 74 | | `sample_sentences` | Up to 3 example sentences | |
| 75 | |
| 76 | ## Notes |
| 77 | |
| 78 | - All matching is **case-insensitive**. |
| 79 | - `query()` returns a **JSON string** directly consumable by LLMs. |
| 80 | - `stats()` returns corpus-level counts (total relations, unique drugs/AEs). |
| 81 | - No external dependencies — stdlib only (`os`, `json`, `collections`). |