Questions tagged «n-gram»

15
python中的n克,四克,五克,六克?
我正在寻找一种将文本拆分为n-gram的方法。通常我会做类似的事情: import nltk from nltk import bigrams string = "I really like python, it's pretty awesome." string_bigrams = bigrams(string) print string_bigrams 我知道nltk仅提供二元组和三元组,但是有没有办法将我的文本分为四克,五克甚至一百克? 谢谢!
137 python  string  nltk  n-gram 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.