Can Machine learning algorithms solve the input dataset of jumbled words and form the correct words from them?

  • $\begingroup$ do you want to correct jumbled words or jumbled sentences or both? $\endgroup$ – Madhur Yadav Sep 14 '20 at 16:05
  • $\begingroup$ Thanks Madhur. Only Jumbled words. Example : Input Jumbled Word : OXB. Output : BOX $\endgroup$ – Prashant Akerkar Sep 14 '20 at 16:20
from itertools import permutations 
import string 
permutation_list = [] 
s = "BOX"
a = string.ascii_letters 
p = permutations(s) 
# Create a dictionary 
d = [] 
for i in list(p): 
    # Print only if not in dictionary 
    if (i not in d): 

import nltk

from nltk.corpus import words
for word in permutation_list:
    print(word.lower() in words.words())

output - 
BOX True
BXO False
OBX False
OXB False
XBO False
XOB False
  • $\begingroup$ you can add custom words in a file,read it and extend the words.words (list type) to get a match of custom words. $\endgroup$ – Madhur Yadav Sep 14 '20 at 17:05
  • $\begingroup$ Thanks Madhur. One Jumbled word can have multiple meaningful words. Can the algorithm work for the same given below? Jumbled word example : LOWF Correct words : FLOW, WOLF, FOWL. Also Can the algorithm work for a long word (many many characters) ? $\endgroup$ – Prashant Akerkar Sep 14 '20 at 18:43
  • 1
    $\begingroup$ if you ask a person that what is the correct word for LOWF, even the person would guess it wrong. It's difficult to solve ambiguity. You could check the part of speech, noun, verb, etc and select the desired output. This code would work fine for words with multiple words and repeated characters. $\endgroup$ – Madhur Yadav Sep 14 '20 at 18:49
  • $\begingroup$ Thanks Madhur. Can there be any limitations to these code after rigorous testing of inputting english words where the word string length is long? google.com/… Note : The word is in the english dictionary, but is long in string length. $\endgroup$ – Prashant Akerkar Sep 14 '20 at 18:53
  • 1
    $\begingroup$ you can use generators instead of lists for faster execution, you can use specific models if you are looking for a specific genre of words, eg - scispacy nlp model for scientific words. also you can hit some apis of anagram webapps and get the output anagrammer.com/anagrams-of/nlp $\endgroup$ – Madhur Yadav Sep 14 '20 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.