Text classification is one of the most useful Natural Language Processing (NLP) tasks as it can solve a wide range of business problems. Many of these problems usually involve structuring business information like emails, chat conversations, social media, support tickets, documents, and the like. Instead of spending precious time manually sorting through the data, you can use text classification to speed up your work and get more done in less time.
In this post, we take a look at some text classification examples for inspiration in different areas. You’ll also be able to try out and have fun experimenting with text classifiers trained for particular tasks with MonkeyLearn.
Let's get the ball rolling!
Examples of Text Classification
Some text classification examples are:
- Perform sentiment analysis to do social media monitoring, market research and improve customer service.
- Automatically detect the language of an email, website, article or tweet with language detection.
- Detect and control that all your conversations are free of profanity and abuse.
Let's explore them in more detail:
One of the most popular text classification applications is sentiment analysis, a type of classifier used for understanding if a given text is talking positively or negatively about a given subject.
From marketing, sales, and customer service, sentiment analysis can be used for diverse tasks including the following:
- Social media monitoring: analyze tweets and/or Facebook comments and detect if they are talking positively or negatively about a brand.
- Customer service: analyze support tickets to quickly detect angry and frustrated customers.
- Customer feedback: analyze NPS comments or survey responses to find if customers like or dislike particular aspects of a product or service.
- Market research: analyze product reviews of a brand and its competition to do competitive analysis.
The following is a sentiment analysis classifier that you can try with texts in English. Experiment with different expressions to see how this classifier makes predictions on the sentiment of the text. If you get a strange result, it could be because the classifier hasn’t learned to classify a particular expression (yet):
Another example of text classification used for a wide variety of tasks is language detection. Given some text from an email, website, news article, or social mention, these classifiers can detect whatever language it is written in. This is useful for sorting information automatically for different purposes:
- Routing customer support tickets to the correct team.
- Sort through documents according to their languages.
- Filtering incoming messages in undesired languages.
It’s also often used as a first step of a text analysis workflow; as text classifiers are trained to work on a particular language, language classifiers are used as a router for forwarding a text to the correct model. For example, a workflow for analyzing customer feedback would look something like:
- Detect language of a given response,
- If the response is in English, use a sentiment analysis model trained for identifying sentiment in texts in English.
- If it’s in Spanish, use a sentiment analysis model trained for analyzing text in Spanish.
- If it’s in another language, discard the message.
The following is a language classifier trained on MonkeyLearn to detect a total of 49 different languages in text:
Profanity & Abuse Detection
Detecting profanity and abuse is also an example of text classification. These classifiers are used for keeping communications safe from insults and for detecting bullying on social networks and online communities.
You can try out this profanity classifier and see how it can detect if a text is clean or has some profanity:
Text Classifiers for Customer Feedback
Sorting through product reviews, NPS comments, and survey responses in order to detect trends and themes is a very manual and time-consuming process. But fortunately, this is something a machine is really good at. You can use aspect-based sentiment analysis to automatically classify feedback from your company and save you and your team some precious time.
Feedback Aspect Classifier
The following is an example of an aspect classifier for customer feedback. This model was trained for classifying NPS responses for SaaS products into categories such as Ease of Use, Features, Pricing, and Support:
Text Classifiers for Customer Support
Support teams spend hours every month processing support tickets to tag common questions, keep track of unresolved bugs, or understand what customers are most confused about. Text classification enables support teams to save hours of manual data processing.
It also increases their efficiency by allowing them to work on the priority cases first, automatically route messages to appropriate teammates, and trigger auto responses based on classifications such as topic, urgency, and sentiment.
E-commerce Support Ticket Classifier
This ticket classifier is an example of text classification applied for customer support. It classifies support tickets for e-commerce into categories such as Fraud, Missing Item, Shipping Problem:
This urgency classifier is another example of how text classification can help in customer support. It categorizes incoming pieces of text as urgent or not urgent based on if there is a request for immediate attention, such as "right away, as soon as possible, etc."
Creating a Custom Classifier
These pre-trained examples are great for getting started right away with text classification. But, sometimes it's useful to train a classifier tailored to your needs for getting specific results. This way you can ensure that the classifier learns from your domain and data and uses your own criteria for classifying your documents.
1. Create a Model and choose Classifier:
2. Import the text data you want to you want to use for training your classifier:
3. Define the tags for your classifier:
4. Tag your data with the appropriate categories and start training the model. This way you’ll be teaching the machine learning model that for a particular text, you expect some particular tag or tags:
Once you have finished tagging data, you will be able to use the model to make new classifications on unseen data either by:
- Using the API with your favorite programming language,
- Using one of the integrations to connect MonkeyLearn with third-party applications with zero lines of code; or,
- Uploading a CSV or Excel file to classify data in a batch.
By using text classification, you’re not just saving time normally spent on data processing, you’re opening up a new set of possibilities. Projects that would have previously been impossible due to immediacy or the amount of manpower needed, now are easily implemented by using the power of machines and text classification. If you don't want the hassle of learning about machine learning, MonkeyLearn can help you to quickly put text classifiers to work and get the most out of your data.