4 Sentence classification

This chapter covers

  • Handling variable-length input with recurrent neural networks (RNN)
  • Working with RNNs and their variants (LSTMs and GRUs)
  • Using common evaluation metrics for classification problems
  • Developing and configuring a training pipeline using AllenNLP
  • Building a language detector as a sentence classification task

In this chapter, we are going to study the task of sentence classification, where an NLP model receives a sentence and assigns some label to it. A spam filter is an application of sentence classification. It receives an email message and assigns whether or not it is spam. If you want to classify news articles into different topics (business, politics, sports, and so on), it’s also a sentence-classification ...

Get Real-World Natural Language Processing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.