Training ML model using Knime


How do I convert Strings to Vectors (Numerical Representation) and apply TF-IDF Vectorizer
Later Using RandomForeset Classifier Need to Train Model with the data in order to Classify the String weather it is True Positive or False Positive.
is there any possibility that it can be done in Knime

below is the Snip for reference (Code in Python)

Thanks & Regards,
Nune Ashok

Please have a look at the following workflow: Text Mining Course: Classification – KNIME Community Hub. It does approximately what you need.
Kind regards,

Hi @AlexanderFillbrunn thank you for the workflow
i am getting error as Execute failed: Cannot invoke “” because “fileUrl” is null while converting String to Document
i checked the string to Document node i don’t see fileurl
also uninstalled Knime & re installed Knime
still same issue

@Ashok121 I think the links shows you the exercise - you might want to take a look at the solution. Maybe you also want to take the text mining course “[L4-TP] Introduction to Text Processing” or take a look at the slides.

Text Mining Course: Classification (solution)

Course Slides: KNIME Course Material Download Page | KNIME

for Text Mining:

@mlauber71 Thank you for the information
but I do see some bug in String to Document Node while I am converting String to Document, I am getting error as Cannot invoke “” because “file URL.

@Ashok121 you might have to download the data or maybe the whole Workflow Group

Downloaded Entire Workflow still i am getting same Error as ERROR Strings To Document 3:119 Execute failed: Cannot invoke “” because “fileUrl” is null

i dont see file url option in string to document

Hello @laaaarsi below is the Error info for String to document
2023-07-01 19:22:06,012 : ERROR : KNIME-Worker-49-Strings To Document 3:119 : : Node : Strings To Document : 3:119 : Execute failed: Cannot invoke “” because “fileUrl” is null
java.lang.NullPointerException: Cannot invoke “” because “fileUrl” is null
at org.knime.ext.textprocessing.TextprocessingCorePlugin.resolvePath(
at org.knime.ext.textprocessing.util.OpenNlpModelPaths.getEnTokenizerModelFile(
at org.knime.ext.textprocessing.nodes.tokenization.tokenizer.word.OpenNlpEnglishWordTokenizer.(
at org.knime.ext.textprocessing.nodes.tokenization.tokenizer.word.OpenNlpEnglishWordTokenizerFactory.getTokenizer(
at org.knime.ext.textprocessing.nodes.tokenization.TokenizerPool.(
at org.knime.ext.textprocessing.nodes.tokenization.DefaultTokenization.createTokenizerPool(
at org.knime.ext.textprocessing.nodes.tokenization.DefaultTokenization.lambda$1(
at java.base/java.util.HashMap.computeIfAbsent(Unknown Source)
at org.knime.ext.textprocessing.nodes.tokenization.DefaultTokenization.getWordTokenizer(
at org.knime.ext.textprocessing.nodes.transformation.stringstodocument.StringsToDocumentCellFactory2.getCells(
at org.knime.core.util.MultiThreadWorker$ComputationTask$
at java.base/ Source)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(
at org.knime.core.util.ThreadUtils$
at java.base/java.util.concurrent.Executors$ Source)
at java.base/ Source)
at org.knime.core.util.ThreadPool$
at org.knime.core.util.ThreadPool$

Hey @Ashok121

thanks for posting the KNIME Log! Could you try to uninstall the KNIME Text processing Extension and reinstall it or use a fresh installation of KNIME?

Best regards

Hi @laaaarsi
I uninstalled Knime twice still showing same issue.
is there any way apart from uninstalling

Could you check if this file exist in your KNIME installation?


Version number of the plugin can differ

1 Like

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