This function extends a given list of keywords by finding related terms through two complementary strategies. First, it queries WordNet to retrieve synonyms, hypernyms (broader concepts), and hyponyms (narrower concepts) for each input word. Second, it uses pre-trained embedding models to search a pre-indexed vocabulary of WordNet terms and surface semantically similar words that the graph traversal might miss. For example, given the word "car", the function may return "automobile" (synonym), "vehicle" (hypernym), "SUV" (hyponym), and "dealer" or "motorway" (semantically near terms), depending on the selected parameters. This function is typically useful for defining brand clusters or expanding query vocabularies for search and classification tasks.
List of words to extend: this is the original lexicon that is to be extended. Please use lowercase, only letters, and white spaces. Do not use quotation marks. Separate words with a comma. E.g.: "home,climate change,sun".language. Please note that some language models provide better results than others. By default, all synsets of a word will be considered, leaving the user the final task of dropping unnecessary words.Add hypernyms and hyponyms: if selected, the software will extend each of the provided words with their direct hypernyms and hyponyms.Max number of related words to extract: is the maximum number of related words generated by a pre-trained language model for each input word.Skip related words: if selected, the function will skip the search for related words that is carried out using word embeddings.A CSV file containing the list of input words and related words - classified as words belonging to synonyms, hypernyms, hyponyms, or words that are close in the embedding space (near).