All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- A cache_path option, to define the path for saving/loading the lookup structure cache. You should use this if your install directory is not writable.
- the
config_file
keyword, now replaced byconfig
which accepts both filenames and dicts - old lookup list names, e.g.
prefixes
now replaced byprefix
- annotator types
custom
,regexp
,token_pattern
,dd_token_pattern
andannotation_context
, all replaced by setting class directly asannotator_type
- everything in
deduce.pattern
, patient patterns now replaced byPatientNameAnnotator
- recognize 4+ spaces as a token, blocking annotations
- a bug with packaging
base_config.json
- speed optimizations, ~250%
- pseudo-annotating eponymous diseases (e.g. Creutzfeldt-Jakob)
PatientNameAnnotator
, which replacesdeduce.pattern
- a structured way for loading and building lookup structures (lists and tries), including caching
pre_match_words
for some regexp annotators, speeding up the annotating- option to present a user config as dict (using
config
keyword)
- speedup for
TokenPatternAnnotator
- some internals of
ContextPatternAnnotator
- initials now detected by lookup list, rather than pattern
- redactor open and close chars from
<
>
to[
]
, as previous chars caused issues in html (so deidentified text now shows[PATIENT]
,[LOCATIE]
, etc.) - names of lookup structures to singular (
prefix
, rather thanprefixes
) INSTELLING
tag toZIEKENHUIS
andZORGINSTELLING
- refactored and simplified annotator loading, specifically the
annotator_type
config keyword now accepts references to classes (e.gdeduce.annotator.TokenPatternAnnotator
) - renamed
interfix_with_capital
annotator tointerfix_with_name
- the
config_file
keyword, now replaced byconfig
which accepts both filenames and dicts - old lookup list names, e.g.
prefixes
now replaced byprefix
- annotator types
custom
,regexp
,token_pattern
,dd_token_pattern
andannotation_context
, all replaced by setting class directly asannotator_type
- everything in
deduce.pattern
, patient patterns now replaced byPatientNameAnnotator
- automated coverage reporting on coveralls.io
- options
lowercase_lookup
,lowercase_neg_lookup
for token patterns utils.any_in_text
- some small additions/removals for specific lookup lists
- smaller bugs related to overlapping matches
- the
RegexpPseudoAnnotator
component for filtering regexp matches based on preceding/following words - a
prefix_with_interfix
pattern for names, detecting e.g.Dr. van Loon
- the age detection component, with improved logic and pseudo patterns
- annotations are no longer counted adjacent when separated by a comma
- streets are prioritized over names when merging overlapping annotations
- removed some false positives for postal codes ending in
gr
orie
- extended the postbus pattern for
xx.xxx
format (old notation) - some smaller optimizations and exceptions for institution, hospital, placename, residence, medical term, first name, and last name lookup lists
- a bug with
BsnAnnotator
with non-digit characters in regexp
- multi-token lookup for first- and last names, so multi token names are now detected
- some small lookup list additions
- extended list of medical terms
- name lookup list contents, extending names and adding more exceptions
- detection of initials
Ch.
,Chr.
,Ph.
andTh.
- logic for detecting hospitals, with added whitelist and separate annotator
- logic for detecting (non-hospital) institutions, with extended lookup list
- the separate Altrecht annotator, now included in the lookup list
- include data files recursively in package
- lookup lists (and logic) for Dutch provinces, regions, municipalities and streets
- name of
residences
annotator toplacenames
, now includes provinces, regions and municipalities - lookup lists (and logic) for residences
- logic for streets, housenumber and housenumber letters
- tokenizer logic:
- a token is now a sequence of alphanumeric characters, a single newline, or a single special character.
- whitespaces are no longer considered tokens
- moved token pattern logic to config, using a new
TokenPatternAnnotator
- moved context pattern logic to config, using a new
ContextAnnotator
- many updates to name detection logic
- lookup list optimizations
- added, removed and simplified patterns
- a component for deidentifying BSN-nummers
- updated dependencies
- by default, deduce now recognizes and tags bsn nummers
- by default, deduce now recognizes all other 7+ digit numbers as identifiers
- improved regular expressions for e-mail address and url matching, with separate tags
- logic for detecting phone numbers (improvements for hyphens, whitespaces, false positive identifiers)
- improved regular expression for age matching
- date detection logic:
- now only recognizes combinations of day, month and year (day/month combinations caused many false positives)
- detects year-month-day format in addition to (day-month-year)
- loading a custom config now only replaces the config options that are explicitly set, using defaults for those not included in the custom config
- backwards compatibility, which was temporary added to transition from v1 to v2
- a separate patient identifier tag, now superseded by a generic tag
- detection of day/month combinations for dates, as this caused many false positives (e.g. lab values, numeric scores)
- annotations can no longer be counted as adjacent when separated by newline or tab (and will thus not be merged)
- removed 'decibutus' from list of institutions as it caused many false positives
- upgraded dependencies, including
markdown-it-py
which had a vulnerability
- upgraded dependencies
- introduced new interface for deidentification, using
Deduce()
class - a separate documentation page, with tutorial and migration guide
- support for python 3.10 and 3.11
- major refactor that touches pretty much every line of code
- use
docdeid
package for logic - speedups: now 973% faster
- use lookup sets instead of lookup lists
- refactor tokenizer
- refactor annotators into separate classes, using structured annotations
- guidelines for contributing
- the
annotate_text
anddeidentify_annotations
functions - all in-text annotation (under the hood) and associated functions
- support for given names. given names can be added as another first name in the
Person
class. - support for python 3.7 and 3.8
<
and>
are no longer replaced by(
and)
respectively- deduce does not strip text (whitespaces, tabs at beginning/end of text) anymore
- warn if there are any structured annotations whose annotated text does not match the original text in the span denoted by the structured annotation
- various modifications related to adding or subtracting spaces in annotated texts
- remove the lowercasing of institutions' names
- therefore, all structured annotations have texts matching the original text in the same span
- Internal code formatting improvements
- Contributing guidelines
- Bug with multiple 4-digit mg dosages in one text
- Minor bug where tag flattening had no effect
- Changelog
- Additional unit tests for whitespace/punctuation
- Various whitespace/punctuation bugs
- Bug with nested tags not related to person names
- Bug with adjacent tags not being merged
- Structured annotations
- Some unit tests
- Error with outdated unicode package
- Bug with context
Release to PyPI
Small bugfix for None as input
Initial version