自动更正列表中拼写错误的单词-python

自动更正列表中拼写错误的单词-python,python,multithreading,nlp,nltk,text-mining,Python,Multithreading,Nlp,Nltk,Text Mining,我有一个包含单词/标记的列表 Eg:- [[u'note', u'subject', u'mussage', u'aar', u'install'],[ u'accomplishment', u'survice', u'hte', u'skinn', u'damaged', u'location', u'shown'] 需要一个python脚本来自动更正拼写错误的单词,并提供如下结果 Eg:- [[u'note', u'subject', u'message', u'air', u'inst

我有一个包含单词/标记的列表

Eg:- [[u'note', u'subject', u'mussage', u'aar', u'install'],[ u'accomplishment', u'survice', u'hte', u'skinn', u'damaged', u'location', u'shown'] 
需要一个python脚本来自动更正拼写错误的单词,并提供如下结果

Eg:- [[u'note', u'subject', u'message', u'air', u'install'],[ u'accomplishment', u'service', u'the', u'skin', u'damaged', u'location', u'shown']
我有大约200万个列表,每个列表都有超过5000个单词/标记。如何在很短的时间内完成任务的脚本

您可以使用库来完成任务

from autocorrect import spell

k = [[u'note', u'subject', u'mussage', u'aar', u'install'],[ u'accomplishment', u'survice', u'hte', u'skinn', u'damaged', u'location', u'shown']]

res = [map(spell, l) for l in k]
print res
结果:

[[u'note', u'subject', u'message', u'Aar', u'install'], [u'accomplishment', u'service', u'the', u'skin', u'damaged', u'location', u'shown']]

你曾尝试过什么来达到你想要的结果?关于你的问题,你的研究表明了什么?你能提供你尝试的代码吗,这可能有助于改进您的问题。这并不意味着什么,如果你需要在一定时间内完成一些事情,你必须清楚。对于某些人来说,这可能是10毫秒,但其他人可能只需要10秒就可以了。很抱歉造成混淆,我实际上使用了一个传统的“For循环”来解决这个问题,执行耗时超过48小时,并且仍在运行。因此,我们要求提供一种可以在几个小时内运行的解决方案。很多人感谢这个解决方案,它在功能上工作得非常好,但需要花费太多的时间。你能帮我写一个比这个快得多的脚本吗?再次感谢你现在必须使用Speller。而不是拼写。“从自动更正导入拼写器”