我在微博上做情绪分析。大多数tweet都包含短单词,我想将它们替换为原始/完整单词。在
假设tweet是:
I was wid Ali.
我想转换:
^{pr2}$同样
wud -> would
u -> you
r -> are
我有6000条微博,里面有很多短句。 我怎样才能替换它们?python中是否有可用于此任务的库?或者网上有什么短词词典?在
我读了Replace appostrophe/short words in python问题的答案,但它只提供了一个近似字典。在
目前我正在使用NLTK,但是这个任务不可能与NLTK一起使用。在
以下网站似乎有必要的字典: https://www.noslang.com/search 您可以发送来自python代码的请求并返回翻译。在
工作代码如下:
相关问题 更多 >
编程相关推荐