Skip to content

Adding items to lookup_structs doesn't work #152

@dinga92

Description

@dinga92

Hi, I would like to add additional names and addresses to redact. Following the tutorial, the examples do not work. I am not sure if the API changed and the tutorial is not up to date, or if there is bug somewhere. I have deduce==3.0.4 and docdeid==1.0.1

from deduce import Deduce

deduce = Deduce()

# sets
deduce.lookup_structs['first_names'].add_items_from_iterable(["naam", "andere_naam"])
deduce.lookup_structs['whitelist'].add_items_from_iterable(["woord", "ander_woord"])

# tries
deduce.lookup_structs['residences'].add_items(["kleine", "plaats", "in", "de", "regio"])
deduce.lookup_structs['institutions'].add_items_from_iterable(["verzorgingstehuis", "hier", "om", "de", "hoek"])
>>> deduce.lookup_structs['first_names'].add_items_from_iterable(["naam", "andere_naam"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'first_names'
>>> deduce.lookup_structs['whitelist'].add_items_from_iterable(["woord", "ander_woord"])
>>> # tries
>>> deduce.lookup_structs['residences'].add_items(["kleine", "plaats", "in", "de", "regio"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'residences'
>>> deduce.lookup_structs['institutions'].add_items_from_iterable(["verzorgingstehuis", "hier", "om", "de", "hoek"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'institutions'
>>>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions