Skip to content

Commit fff384a

Browse files
VITTOZ Simonsvittoz
authored andcommitted
rename eds.measurements pipe to eds.quantities
1 parent 4659bd5 commit fff384a

File tree

16 files changed

+228
-227
lines changed

16 files changed

+228
-227
lines changed

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Numbers are now only detected without trying to remove the pollution in between digits, ie `55 @ 77777` could be detected as a full number before, but not anymore.
88

9+
### Changed
10+
11+
- Rename `eds.measurements` to `eds.quantities`
12+
913
## v0.13.0
1014

1115
### Added

demo/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"Drugs": "drugs",
6969
"CIM10": "cim10",
7070
"Dates": "dates",
71-
"Measurements": "measurements",
71+
"Quantities": "quantities",
7272
"Charlson": "charlson",
7373
"SOFA": "sofa",
7474
"Elston & Ellis": "elston_ellis",
@@ -220,7 +220,7 @@ def load_model(custom_regex: str, **enabled):
220220

221221
doc = nlp(text)
222222
doc.ents = filter_spans(
223-
(*doc.ents, *doc.spans.get("dates", []), *doc.spans.get("measurements", []))
223+
(*doc.ents, *doc.spans.get("dates", []), *doc.spans.get("quantities", []))
224224
)
225225

226226
st.header("Visualisation")

docs/pipes/misc/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For instance, the date detection and normalisation pipeline falls in this catego
1212
|--------------------------|---------------------------------------------|
1313
| `eds.dates` | Date extraction and normalisation |
1414
| `eds.consultation_dates` | Identify consultation dates |
15-
| `eds.measurements` | Measure extraction and normalisation |
15+
| `eds.quantities` | Quantity extraction and normalisation |
1616
| `eds.sections` | Section detection |
1717
| `eds.reason` | Rule-based hospitalisation reason detection |
1818
| `eds.tables` | Tables detection |

docs/pipes/misc/measurements.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/pipes/misc/quantities.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Quantities {: #edsnlp.pipes.misc.quantities.factory.create_component }
2+
3+
::: edsnlp.pipes.misc.quantities.factory.create_component
4+
options:
5+
heading_level: 2
6+
show_bases: false
7+
show_source: false
8+
only_class_level: true

docs/pipes/ner/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
We provide several Named Entity Recognition (NER) components.
44
Named Entity Recognition is the task of identifying short relevant spans of text, named entities, and classifying them into pre-defined categories.
5-
In the case of clinical documents, these entities can be scores, disorders, behaviors, codes, dates, measurements, etc.
5+
In the case of clinical documents, these entities can be scores, disorders, behaviors, codes, dates, quantities, etc.
66

77
## Span setters: where are stored extracted entities ? {: #edsnlp.pipes.base.SpanSetterArg }
88

edsnlp/pipes/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from .core.terminology.factory import create_component as terminology
2121
from .misc.consultation_dates.factory import create_component as consultation_dates
2222
from .misc.dates.factory import create_component as dates
23-
from .misc.measurements.factory import create_component as measurements
23+
from .misc.quantities.factory import create_component as quantities
2424
from .misc.reason.factory import create_component as reason
2525
from .misc.sections.factory import create_component as sections
2626
from .misc.tables.factory import create_component as tables

edsnlp/pipes/misc/measurements/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from edsnlp.pipes.misc.quantities.quantities import QuantitiesMatcher
2+
from edsnlp.pipes.misc.quantities.patterns import *
3+
4+
from . import factory

edsnlp/pipes/misc/measurements/factory.py renamed to edsnlp/pipes/misc/quantities/factory.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from edsnlp.core import registry
22

33
from . import patterns
4-
from .measurements import MeasurementsMatcher
4+
from .quantities import QuantitiesMatcher
55

66
DEFAULT_CONFIG = dict(
7-
measurements=list(patterns.common_measurements.keys()), # noqa: E501
7+
quantities=list(patterns.common_quantities.keys()), # noqa: E501
88
units_config=patterns.units_config,
99
number_terms=patterns.number_terms,
1010
number_regex=patterns.number_regex,
@@ -24,7 +24,7 @@
2424
)
2525

2626
create_component = registry.factory.register(
27-
"eds.measurements",
27+
"eds.quantities",
2828
assigns=["doc.spans", "doc.ents"],
29-
deprecated=["eds.measures"],
30-
)(MeasurementsMatcher)
29+
deprecated=["eds.measures", "eds.measurements"],
30+
)(QuantitiesMatcher)

0 commit comments

Comments
 (0)