Filter for a specific set of terms/words

Hi together,

Is it possible to feed in a list of terms/words so that only these defined terms will be kept and the rest will be filtered out?


Hi @cpauly93 -

Give the Dictionary Filter node a try.

1 Like

Thanks for the advice.

However, every time I try to apply the Dictionary Filter I’m receiving the following error report:

What am I doing wrong?

This is my current work flow:

It looks like you have your input ports to the Dictionary Filter node switched - documents go into the top port, and the string dictionary into the bottom port. You can check the node description for details on the various input and output ports of any node (though you may have to scroll down a bit).

1 Like

That worked, thank you!

What the Dictionary Filter does is that it filters out all words that I added to the Table Creator. However, my aim is to have it the exact other way around. I want to get rid of all the words EXCEPT for the words I included in the Table Creator.

Can someone help me with this?

In that case, maybe try this approach (which I admit is a little bit hacky).

Use a Dictionary Tagger node to apply some unused/unrelated tag to the words you’re interested in. Maybe Sentiment = Positive. Then, use a subsequent Tag Filter node to keep only those tagged words.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.