3.6 Number of stopwords

Normally, solving an NLP problem, the first thing we do is to remove the stopwords. But sometimes calculating the number of stopwords can also give us some extra information which we might have been losing before. we already imported stopwords from NLTK (above).

3.7 Number of special characters

It is most interesting feature of NLP, which we can extract from a comment_text is calculating the number of hashtags or mentions present in it. This also helps in extracting extra information from our text data. (Here, we make use of the ‘startswith’ function because hashtags (or mentions) always appear at the beginning of a word.)