Is there a way to convert nltk featuresets into a scipy.sparse array?

Not that I know of, but note that scikit-learn can do n gram frequency counting itself. Assuming word-level n grams.

Not that I know of, but note that scikit-learn can do n-gram frequency counting itself. Assuming word-level n-grams: from sklearn. Feature_extraction.

Text import CountVectorizer, WordNGramAnalyzer v = CountVectorizer(analyzer=WordNGramAnalyzer(min_n=1, max_n=2)) X = v. Fit_transform(files) where files is a list of strings or file-like objects. After this, X is a scipy.

Sparse matrix of raw frequency counts.

Jacob Perkins did a a bridge for training NLTK classifiers using scikit-learn classifiers that does exactly that here is the source: https://github. Com/japerk/nltk-trainer/blob/master/nltk_trainer/classification/sci. Py The package import lines should be updated if you are using version 0.9+.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions