Spark ML, Spark NLP, Other ML or NLP Libraries - Getting the Root Keyword from Synonyms <p>I have used Word2Vec to get the synonyms for a root keyword, but am now on the lookout for the reverse. That is, given a string (however large or small) that contains a bunch of synonyms for multiple root keywords, how do I gather the root keywords and their synonyms from the string, after discarding words that don't relate to any root keyword?</p> <p>Example: A string containing these words (and many more) ...</p> <pre><code>pupstar puppystar bitchstar curstar doggystar houndstar mongrelstar muttstar poochstar straystar tykestar bowwowstar fidostar flea bagstar man's best friendstar tail-wagger bobcatstar cheetahstar cougarstar jaguarstar kittenstar kittystar leopardstar lionstar lynxstar mouserstar ocelotstar pantherstar pumastar pussstar pussystar tabbystar tigerstar tomstar tomcatstar grimalkinstar malkin </code></pre> <p>should give me ...</p> <pre><code>dog: (...,...,...) cat: (...,...,...) </code></pre> <p>Thanks in advance for your response.</p> <p>Naga Vijayapuram</p>