Using CNNs for sentence classification

Though CNNs have mostly been used for computer vision tasks, nothing stops them from being used in NLP applications. One such application for which CNNs have been used effectively is sentence classification.

In sentence classification, a given sentence should be classified to a class. We will use a question database, where each question is labeled by what the question is about. For example, the question "Who was Abraham Lincoln?" will be a question and its label will be Person. For this we will use a sentence classification dataset available at http://cogcomp.org/Data/QA/QC/; here you will find 1,000 training sentences and their respective labels and 500 testing sentences.

We will use the CNN network introduced ...

Get Natural Language Processing with TensorFlow now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.