How to classify words with similar patterns on one unique word using Python?

Viewed 35

I would like to ask about a way to create a dictionary or classify (both solutions are good for me) similar words into the same word.

For giving you a example, let's say we have in a list the following values:

['table','tabla', 'tablon','tablera','tablet']

The words tabla, tablon and tablera are just table but in other languages, so I would like to automatically create a dictionary that would classify this words to the english word 'table', of course tablet shoud be excluded (i write it down in the list since it was too similar to the words I was analyzing)

I was thinking about a NLP word embbeding approachment, but my knowledge in the field is too shallow, I don´t know if there are better ways to do this.

Any solutions is welcomed!!

Thanks a lot in advance

1 Answers

Translate each word from every language into English.

# word: [from-spanish,from-esperanto,from-portuguese,from-English]
word_dict{'table': [None,None,None,'table'],
 'tabla': ['table',None,None,'tabla'],
 'tablon': [None, 'table', None, None],
 'tablera': [None, None, 'table', None],
 'tablet': [None, None, None, 'tablet'],
}

Note how some words have different meanings in some languages; for instance, "tabla" means "table" in Spanish, but it is also the name of a musical instrument in English.

Then, group together words which have at least one translation in common; or perform clustering, using the length of the set intersection of the possible meanings as a similarity measure between words.

Related