如果你可以与python,我会说
nltk将是完美的你.
例如:
>>> import nltk
>>> s = "This is some sample data. Nltk will use the words in this string to make ngrams. I hope that this is useful.".split()
>>> model = nltk.NgramModel(2, s)
>>> model._ngrams
set([('to', 'make'), ('sample', 'data.'), ('the', 'words'), ('will', 'use'), ('some', 'sample'), ('', 'This'), ('use', 'the'), ('make', 'ngrams.'), ('ngrams.', 'I'), ('hope', 'that'
), ('is', 'some'), ('is', 'useful.'), ('I', 'hope'), ('this', 'string'), ('Nltk', 'will'), ('words', 'in'), ('this', 'is'), ('data.', 'Nltk'), ('that', 'this'), ('string', 'to'), ('
in', 'this'), ('This', 'is')])
你甚至有一个方法nltk.NaiveBayesClassifier
本文介绍如何使用Python中的自然语言工具包(NLTK)进行文本处理,包括创建n-grams模型并展示其基本用法。通过实例演示了如何利用N-grams分析文本数据。
1808

被折叠的 条评论
为什么被折叠?



