Text classification is the task of choosing the correct class label for a given text input. In basic text classification tasks, each input is considered in isolation from all other inputs, and the set of class labels is defined in advance.
Text classification is a two-stage process:
- Train the model:
Preprocess the text data and produce tokens.
Use natural language processing (NLP) functionality such as tokenization, stemming, and stop words.
From the tokens, use statistical measures to select a subset.
Generate the feature for each word in the subset.
Use machine learning algorithms to train a classifier.
- Classify the text.