Text classification

Hello everyone, sorry if I ask trivial questions but I am taking my first steps with KNIME.

I need to classify each row of an excel sheet according to whether they contain one or more keywords.

My dictionary is like that.

type keywords-to-match
oriental foods, miso,tofu,ukicha,amasake,tahin,sitan,tempeh
fruits, apple,banana,pear,orange
vegetables, garlic,asparagus,beetroot,basil

My input looks like this

Text-to-classify
My family makes it kind of like a beverage?? Maybe like amasake?
How To Make Banana Bread? About garlic?
i’m a big fan of back hugs, tight hugs and forehead kisses

The desired output is like this:

Classified-text Type1 Type2 ….
My family makes it kind of like a beverage?? Maybe like amasake? oriental foods
How To Make Banana Bread? About garlic? fruits vegetables
i’m a big fan of back hugs, tight hugs and forehead kisses

Any suggestions are welcome. Thanks

forum question_text classification.knwf (14.1 KB)

Is this helpful?

1 Like

It works and I thank you for it.

I have to try it on a large table. I think the “Cross Joiner” node can take a long time to run. I keep looking for a solution with nodes like “Dictionary Tagger” or similar.

Thanks again

You’re welcome.
Will explore “Dictionary tagger”.
How about this?
forum question_text classification_v2.knwf (36.7 KB)

2 Likes

Unfortunately something is missing in my environment

Could not start Python executable at the given location (no_conda_environment_selected/bin/python): Cannot run program “no_conda_environment_selected/bin/python”: error=2, No such file or directory
Please refer to the log file for more details.

Yes, you will have to install Anaconda/Python to run this as it uses few libraries in the new node.

2 Likes

ok thanks. does it work!

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