Skip to content
Discussion options

You must be logged in to vote

Hi @SjoerdBraaksma, two issues with this:

  1. Patterns specified for LOWER: should be in lowercase. I'm surprised that "Lepelaar" is recognized for you, because it doesn't work for when running your code (and I wouldn't expect it to).
  2. As you already noticed, the problem is related to "van Walderveen" being more than one token. This has to be specified differently.

If you make the following adjustments, this will work:

    ...
    with nlp.select_pipes(enable="ner"):
        ruler_names.add_patterns(
            [
                {"label": "ACHTERNAAM", "pattern": [{"LOWER": "lepelaar"}]},
                {"label": "ACHTERNAAM", "pattern": [{"LOWER": "van"}, {"LOWER": "walderveen"}]}
       …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by svlandeg
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage General spaCy usage feat / spanruler Feature: Entity and span ruler
2 participants
Converted from issue

This discussion was converted from issue #12270 on February 10, 2023 14:27.