sentiment analysis joint list
<p>im doing the sentiment analysis with scikit-learn python, now I'm using the nltk to do the words lemmatization in order to increase processing speed, for example:</p>

<p>I get the following arrays after nltk processing:</p>

<pre><code>array([ ['Really', 'a', 'terrible', 'course', u'lecture', u'be', 'so', 'boring', 'i', u'contemplate', 'suicide', 'on', 'numerous', u'occasion', 'and', 'the', 'tutes', u'go', 'for', 'two', u'hour', 'and', u'be', 'completely'], ['Management', 'accounting', u'require', 'sufficient', 'practice', 'to', 'get', 'a', 'hang', 'of', 'Made', 'easier', 'with', 'a', 'great', 'lecturer']], dtype=object)
</code></pre>

<p>but the scklearn require the array is </p>

<pre><code>array([ 'Really a terrible course  lectures were so boring i contemplated suicide on numerous occasions and the tutes went for two hours and were completely ', 'Management accounting requires sufficient practice to get a hang of  Made easier with a great lecturer '],dtype=object)
</code></pre>

<p>so what is the best way to convert this array into the right form? I try to use <a href="http://i.stack.imgur.com/h9g4z.png" rel="nofollow">joint list</a> but the result is strange</p>

<p>You would do:</p>

<pre><code>second_array = [' '.join(each) for each in first_array]
</code></pre>

<p>Alternatively you can tell <code>sklearn.CountVectorizer</code> to just use your tokens:</p>

<pre><code>vect = CountVectorizer(preprocessor=lambda x: x, tokenizer=lambda x: x)
X = vect.fit_transform(first_array)
</code></pre>

python arrays scikit-learn