-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
In this short example, we will be looking at cleaning a body of text mined from an API, to prepare your text for further processing and feature engineering like Sentiment Analysis etc. With cleantweet, it is easy to clean a body of text with just a few lines of code:
!pip install cleantweet
import cleantweet as clt
data = clt.CleanTweet('mini corpus for testing')
data = data.clean()
print(data)
You can use the DiagramTweet class to create different diagrams for NLP tasks. To create a Wordcloud using cleantweet, takes two lines of code:
figures = clt.DiagramTweet('mini corpus for testing.txt')
figures.word_cloud()
The first line creates an instance of the DiagramTweet class and the second line calls the word_cloud() method. To know more about the different [parameters of the word_cloud() method, you can see it's full definition in the API docs