Tag filter: how can I match a single tag exclusively?

I'm running into some difficulties with the Tag Filter node. I am using it to exclude proper nouns (NNP and NNPS) which have been tagged by the POS tagger. This much works ok, but there are some proper nouns that I don't want to exclude.

I thought I might be able to achieve this by using the Dictionary Tagger to tag those terms as something else (a named entity for example), and then discriminate between these and other proper nouns in the Tag Filter settings. I figured I could do this by filtering out terms that are tagged only as NNP, leaving those with an additional tag untouched. But the Tag Filter seems unable to do this. If I use strict filtering but select only one tag, the node does not remove any terms at all, not even those terms that are tagged only as NNP. This seems to be an unfortunate bug/limitation of the Tag Filter.

I also tried tagging the terms I want to keep as unmodifiable, but the Tag Filter removes them anyhow.

Is there any way I can achieve what I am trying to do?

(Btw, I am still using KNIME 3.2.1. Will upgrade soon.)

 

Ok, so I just realised the obvious solution to my problem: namely, replace the terms I want to keep with lowercase versions so they do not look like proper nouns.

But nonetheless, it would be useful to be able to filter out terms that are tagged only with one specific tag.

1 Like