One of Machine Learning’s most successful paradigm is supervised learning which lets you build a generalization model by learning from a lot of training examples. Supervised learning is extensively used in Natural Language Processing to build multi-class or multi-label text classifier for solving a variety of use-cases like spam detection, sentiment analysis, emotion analysis, customer intent analysis, etc.. Anyone familiar with the process of building a text classification model would know that it involves three steps listed below:
Prepare training data: Training Data, also known as labeled data is a corpus of domain-specific cases which are manually annotated with labels that the classifier is expected to classify.
Training the text classification model: A suitable machine learning algorithm is then selected to train a model on the labeled dataset. We have covered some of the techniques in our previous blog for building a sentiment analysis model.
Testing and Validation: A portion of the labeled dataset is set aside for testing and validating the trained model to assess its generalization ability.
The traditional supervised learning paradigm breaks down when we do not have sufficient labeled data for our task to train a reliable model. Text Classification projects in the real world often face the biggest hurdle of getting access to a sizeable amount of data and manually annotating them. As a result, most of the real-world projects get stuck in the first step itself. Those that do cross the first hurdle often find their data to be either insufficient or skewed towards certain classes leading to biases in the resulting AI models.
What is Custom Classifier?
A lot of research in deep learning is directed towards learning better representations from less data, and one such exciting field is Zero-Shot learning. Quoting Ian Goodfellow from his Quora answer – “Zero-shot learning is being able to solve a task despite not having received any training examples of that task.” In other words, imagine predicting the emotion of a tweet without providing any training examples of tweets with that emotion label.
ParallelDots’ in-house research team came up with their own paradigm of Zero-shot learning for Text Classification and released a research paper on the same aptly titled as “Train Once, Test Anywhere: Zero-shot Learning For Text Classification”. You can read the paper here.
Additionally, living up to our commitment for bringing AI at your fingertips, we decided to move this exciting piece of research into a commercial application and therefore, launched a new API that lets you utilize the full power of zero-shot learning for your text classification use-cases. We are calling it Custom Classifier since it lets you build your text classifier on your defined, custom categories. This is a revolutionary step in our pursuit of developing cutting-edge AI solutions to let users develop and integrate a custom text classification model without the need of building any training data.
Learning by Example – Building A Sample Text classification model
Since no training data is required, it also brings down the cost and time it takes to build a text classification model. With all the background knowledge in place, let’s try to see the custom classifier in action.
In the below screenshot taken from the Custom Classifier demo page on our website, we took a sports headline and defined five categories that we want to classify this headline into – World Politics, Sports, Religion, Entertainment, Business.
As you can see from the results, sports category has the highest probability score of all, and therefore the most likely category of our input text. Please be mindful of the fact that we defined the categories at the time of testing, and the underlying AI model was not explicitly trained on them.
Next, we try to further break down the sports category into different categories like soccer, golf, etc. and see if our classifier can understand them.
Again, we see that the classifier accurately identifies the sports categories without being explicitly trained on them. I hope that by now you would have started to understand the potential of this technology.
As the last step let’s try to further break down our soccer category into different types of leagues that are played around the globe and see if our classifier can correctly predict the same.
Magical indeed! Our classifier correctly picked up the league as well.
In summary, Custom Classifier gives you a glimpse into the future of text classification where very few or no training examples will be required to classify a piece of text into custom defined categories reliably. Such an ability will open up endless possibilities and give a new life to numerous dormant text analytics project that could never see the day of light due to lack of training data or training resources.
Setting Up A Custom Classifier
Setting up a custom classifier is very easy and can be done in three easy steps mentioned below:
- Sign up for free ParallelDots API account and log in to your dashboard.
- Navigate to the custom classifier section in your dashboard, provide a sample text and define some categories to analyze your text. By default, you will be in test mode which lets you tweak your category list as many times as you want for no cost.
- Once you are satisfied with the classification accuracy, click on Publish to deploy your classifier for production use and get classifier id. Once published, you will be able to access your custom classifier via the API endpoints.
API documentation for the custom classifier is available here. An Excel add-in function will be available soon to use it from MS Excel.
In this blog post, we introduced a new paradigm in Text Classification, and we hope that our users would benefit from it tremendously. We are already seeing some exciting use-cases being solved by custom classifier by our users like classifying job postings, categorizing news articles, processing open-ended survey feedback, etc. Often, the very first step to analyze raw data is to categorize it into categories that you care and monitor the trends over time to gain actionable insights.
Advantages of Custom Classification over Standard Text Classification
Standard text classification models like sentiment analysis are not always sufficient to get the holistic view when analyzing unstructured data like voice of the customer. Custom classifier, on the other hand can give you the ability to categorize such data into more nuanced categories that we care. For, eg, using custom classifier, a fast food chain owner can categorize the feedback received from her customers via social media into categories like price, ambiance, staff behavior, food quality, etc. to gain better insights into what aspects of her business she needs to improve. Using a simple sentiment analysis, she may know how her business is doing overall but could potentially miss some critical trends such as how staff behavior and the footfall rate correlate. The potential of Custom Classifier is to classify text beyond sentiment labels (positive, negative or neutral) so you not only know how many negative feedback you got on your product but also what users talked about in those negative statements.
We believe custom classifier can empower users with no background in data science to build and deploy their own classifiers and gain an edge over their competitors. It will also help enterprises to radically transform themselves into data-driven organizations and will ultimately accelerate the industrialization of Artificial Intelligence and Machine Learning. You can also explore more text classification blogs here.