What is Text Analysis?
Text is a group of words or sentences.Text analysis is analyzing the text and then extracting information with the help of text.Text data is one of the biggest factor that can make a company big or small.For example
- On E-Commerce website people buy things .With Text Analysis the E-Commerce website can know what it’s costumer likes and it through this data it can make it’s productivity higher.
- Using Text analysis and some Machine Learning Algorithm our Alexa Google Home mini works. These two are based on Natural Language Processing.
- Using Text Analysis we can decide whether a E-mail is a Spam or a Non Spam.
Text analysis can be done using text mining.As the text “data” can be structured as well as unstructured.The text mining technique will help us in differentiating between them.
Now let’s do some text analysis using Turicreate.We will build a model that classifies that a message is a spam or ham for text analysis.Link for the dataset=https://www.kaggle.com/team-ai/spam-text-message-classification
Step 1: Import the Turicreate Library
Step 2:Load the data set.
Step 3: We will explore the data first.
Step 4:Now adding the word count in the data set.
This is because data has two things category and message. Adding the word count will help in model feature selection.
Step 5: To split the data into train and test set.
Step 6: Now we will make a model for classifying the spam and ham.
Step 7: Now we will check accuracy of our model.
The accuracy is 0.975 that means 97.5%.Step 8: We can predict manually by checking from our test data that it is giving right answer or not.
Step 9: Predicting the test data.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course