Text classification is an application of classification algorithms. However, the text is a combination of words in a specific order. Hence, you can observe that a text document with a class variable is not similar to the dataset that we presented in the table in the Classification algorithms section.
A text dataset can be represented as shown in the following table:
Table 2: Example of a Twitter dataset
Tweet | Account |
The simplest way to protect Americans from gun violence is to actually talk about common-sense gun laws. | Democrats |
This cannot be who we are as a country. We need to find out what happened and ensure it never happens again (https://t.co/RiY7sjMfJK)) |
Democrats |
Over the weekend, President Trump visited Arlington National Cemetery to honor fallen soldiers. | Republicans |
This President has made it clear that he will secure... |