@pharmatools/opengate 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ Scorers never talk to a system directly — they go through an adapter, injected
|
|
|
124
124
|
OPENGATE_ADAPTER=./adapters/my-system.mjs npm run eval:online
|
|
125
125
|
```
|
|
126
126
|
|
|
127
|
-
An adapter is one file
|
|
127
|
+
An adapter is one file: two base exports — `onlineAvailable()`, `onlineConfigHint()` — plus at least one complete **capability**: `qa` (`splitClaims` + `analyzeBatch`) or `redaction` (`redact`). Scorers check `adapter.capabilities` and skip cleanly across the boundary. Optional timing/token/model-label hooks unlock latency and cost columns in the scorecard. Adapters are validated at load: a malformed one fails fast with a message naming every missing export and incomplete capability.
|
|
128
128
|
|
|
129
129
|
For REST-backed systems there's a no-code path: the bundled **generic HTTP adapter** (`src/adapters/http.mjs`) reads endpoint paths and headers from `opengate.http.json` (see `opengate.http.example.json`), with `${ENV}` interpolation and built-in latency/token capture.
|
|
130
130
|
|
|
@@ -137,7 +137,7 @@ Full contract, minimal skeleton, and verdict-mapping notes: **[ADAPTERS.md](ADAP
|
|
|
137
137
|
Use OpenGATE as a drop-in regression gate in any repository. Keep your gold set and committed `baseline.json` in your own tree; any metric that drops fails the build:
|
|
138
138
|
|
|
139
139
|
```yaml
|
|
140
|
-
- uses: nickjlamb/opengate@
|
|
140
|
+
- uses: nickjlamb/opengate@v0
|
|
141
141
|
with:
|
|
142
142
|
datasets: ./evals/datasets # your cases/ + fixtures/
|
|
143
143
|
results: ./evals/results # where baseline.json lives
|
|
@@ -169,7 +169,7 @@ npm install --no-save @pharmatools/redacta
|
|
|
169
169
|
node src/runner.mjs --online --adapter ./src/adapters/redacta.mjs
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
On its first run against the new gold set, the eval found two real engine bugs —
|
|
172
|
+
On its first run against the new gold set, the eval found two real engine bugs — relation phrases like "Next of kin:" swallowed nested name matches, and apostrophe surnames (O'Brien) were dropped from name capture. Both were fixed in `@pharmatools/redacta` 1.2.1 and confirmed by the eval (`knownGap_closed: 2`), then promoted to gold. Street-line address detection followed in 1.3.0, closing the last tracked gap. Current scorecard: **100% recall on 25 gold identifiers, 0 leaks, no open gaps**.
|
|
173
173
|
|
|
174
174
|
## Layout
|
|
175
175
|
|
|
@@ -191,7 +191,7 @@ opengate/
|
|
|
191
191
|
|
|
192
192
|
## Roadmap
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
|
|
195
195
|
- **Third adapter** — Patiently AI (faithfulness evaluation for patient-language simplification)
|
|
196
196
|
- **Author-year in RefCheckr production** — `detectAuthorYear()` now lands "Smith 2020"-style keys in the reference implementation; adopting them in RefCheckr's numeric-keyed citation mapping is tracked separately
|
|
197
197
|
- **Number-adjacent superscript** — `week 24.1` is genuinely ambiguous with decimals; remains a tracked known gap
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "redact-cardio-clinic",
|
|
3
3
|
"kind": "redaction",
|
|
4
|
-
"description": "Cardiology clinic letter — titled patient name, NHS number, DOB, phone, email, postcode. SYNTHETIC: all identifiers are test-range values; no real persons.",
|
|
4
|
+
"description": "Cardiology clinic letter — titled patient name, NHS number, DOB, phone, email, postcode. SYNTHETIC: all identifiers are test-range values; no real persons. The street address was a tracked engine gap; street-line detection landed in @pharmatools/redacta 1.3.0 and the entity was promoted to gold.",
|
|
5
5
|
"text": "Mr John Smith (NHS 999 000 0018, DOB 12/03/1958) attended cardiology clinic today. He was seen by Dr Patel for review of atrial fibrillation. Blood pressure was 132/84 mmHg and apixaban was continued at 5 mg BD. Contact him on 07700 900123 or john.smith58@example.com. Address on file: 42 Maple Road, Oxford OX2 6JX. Follow-up in 12 weeks.",
|
|
6
6
|
"goldEntities": [
|
|
7
7
|
{
|
|
@@ -27,12 +27,11 @@
|
|
|
27
27
|
{
|
|
28
28
|
"type": "POSTCODE",
|
|
29
29
|
"value": "OX2 6JX"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"knownGapEntities": [
|
|
30
|
+
},
|
|
33
31
|
{
|
|
34
32
|
"type": "STREET_ADDRESS",
|
|
35
33
|
"value": "42 Maple Road"
|
|
36
34
|
}
|
|
37
|
-
]
|
|
38
|
-
|
|
35
|
+
],
|
|
36
|
+
"knownGapEntities": []
|
|
37
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "redact-discharge-summary",
|
|
3
3
|
"kind": "redaction",
|
|
4
|
-
"description": "Discharge summary with a relative as next of kin. SYNTHETIC.",
|
|
4
|
+
"description": "Discharge summary with a relative as next of kin. SYNTHETIC. The relative name was a tracked engine gap (a 'Next of kin:' phrase swallowed the inner 'daughter Anita' match — not the parenthesis, as first suspected); fixed in @pharmatools/redacta >1.2.0 and promoted to gold.",
|
|
5
5
|
"text": "Discharge summary for Mrs Priya Sharma, NHS 999 000 0026, DOB 04/11/1947. Admitted with community-acquired pneumonia; completed 5 days of co-amoxiclav and improved steadily. Next of kin: her daughter Anita (07700 900456) was updated by phone. Discharged to home address, postcode LS8 2QT, with district nurse follow-up.",
|
|
6
6
|
"goldEntities": [
|
|
7
7
|
{
|
|
@@ -23,13 +23,11 @@
|
|
|
23
23
|
{
|
|
24
24
|
"type": "POSTCODE",
|
|
25
25
|
"value": "LS8 2QT"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"knownGapEntities": [
|
|
26
|
+
},
|
|
29
27
|
{
|
|
30
28
|
"type": "RELATIVE_NAME",
|
|
31
|
-
"value": "Anita"
|
|
32
|
-
"comment": "Engine bug (tracked): a relative name directly followed by an opening parenthesis escapes the relative-name pattern — 'her daughter Anita (07700...' leaks, while 'her daughter Anita was' is caught. The phone match also consumes the opening paren, leaving an orphan ')'."
|
|
29
|
+
"value": "Anita"
|
|
33
30
|
}
|
|
34
|
-
]
|
|
31
|
+
],
|
|
32
|
+
"knownGapEntities": []
|
|
35
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "redact-ward-round",
|
|
3
3
|
"kind": "redaction",
|
|
4
|
-
"description": "Ward round entry — apostrophe surname, NHS number without spaces, carer mention. SYNTHETIC.",
|
|
4
|
+
"description": "Ward round entry — apostrophe surname, NHS number without spaces, carer mention. SYNTHETIC. The apostrophe surname was a tracked engine gap (NAME pattern required a lowercase letter after the initial capital); fixed in @pharmatools/redacta >1.2.0.",
|
|
5
5
|
"text": "Ward round: Mrs Eileen O'Brien, NHS 9990000034, remains stable post hip hemiarthroplasty. Mobilising with frame. Her son Daniel visited and raised concerns about home support; referred to social work. Plan: continue enoxaparin, orthogeriatric review tomorrow. Contact for family updates: 07700 900321.",
|
|
6
6
|
"goldEntities": [
|
|
7
7
|
{
|
|
@@ -21,11 +21,5 @@
|
|
|
21
21
|
"value": "07700 900321"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"knownGapEntities": [
|
|
25
|
-
{
|
|
26
|
-
"type": "PATIENT_SURNAME",
|
|
27
|
-
"value": "O'Brien",
|
|
28
|
-
"comment": "Engine bug (tracked): apostrophe surnames are dropped from titled-name capture — 'Mrs Eileen O'Brien' tokenises as 'Mrs Eileen' only, leaving the surname in the text."
|
|
29
|
-
}
|
|
30
|
-
]
|
|
24
|
+
"knownGapEntities": []
|
|
31
25
|
}
|
package/package.json
CHANGED