Text processing to write a sentence from a document with starting keyword

How to create a sentence from the document with keywords. I mean if I write The, knime will search for the most following word coming after The for example apple, and then search for the most following word after apple for example is etc. And write a sentence like the apple is flying over skies.

Hi @ozcan1978, and welcome to the KNIME forum.

This sounded like a fun experiment and a good opportunity to use some of the KNIME text processing extension without diving into any complicated Machine Learning. So, I decided to play with the idea a bit this afternoon.

I’d like to say this strategy doesn’t generate the most coherent sentences as it only references the previous word when choosing the next. Using an LSTM network would be a more robust method of attacking this problem. As Rosaria Silipo did here.

Having said that, here’s a workflow that does what you described! Play around with it a bit and see what you can make it do.
You’ll need to direct the Tika Parser node at the beginning of the workflow to a folder with some reference document(s) but after that it should be good to go.


Cheers and have a good weekend!
Corey.


p.s. if anyone is curious what an output looks like but doesn’t want to run it, here’s an example from when I ran it on some docs I had lying around:

“the knime can also have access beyond the model to be a large number a large dataset of a single document is the same as well but also have been”

4 Likes

Thank you Corey it works.

1 Like

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