What Tasks Can I Solve with NLP Today?

Semantic search, sentiment analysis, recommender systems, question answering, knowledge graphs, etc.

Fabio Chiusano
NLPlanet
6 min readSep 27, 2022

--

NLP tasks. Image by the author.

Let’s go into detail and see a comprehensive list of tasks that NLP can solve today. Keep in mind that many of them can easily be solved by fine-tuning open-source models for most use cases.

Text Classification

Text classification is the task of automatically assigning a text document to one or more pre-defined categories (a.k.a. classes), based on its content.

Some examples are:

  • Sentiment Analysis: Understanding whether a text has a positive sentiment (e.g. “the dinner was nice”) or a negative sentiment (e.g. “the dinner was awful”).
Sentiment analysis examples. Image by the author.
Sentiment analysis examples. Image by the author.
  • Spam Detection: Moving the right emails into the spam folders.
  • Assigning categories to CRM customer support tickets: Detecting the type of a ticket (e.g. refund or technical problem) and dispatching it automatically to the correct customer support person.
  • Classification of disaster conversations on social media: Detecting disasters like fires or floods from social media posts.
Examples of tweets about natural disasters. Image by the author.

Information Retrieval and Semantic Search

Information retrieval (IR) is focused on understanding the user’s intent (typically expressed with a query) and providing the most relevant results. Searches can be based on full-text or metadata searches. Traditional information retrieval systems work by (1) efficiently matching texts between queries and documents, and (2) assigning different importance to different words in a smart way.

How a text matching search engine works. Image by the author.

Semantic search is related to information retrieval in that it is concerned with finding the best match for a user’s query, but it goes beyond traditional IR techniques by considering the semantic meaning of the queries and the documents thanks to word embeddings.

How a semantic search engine works. Image by the author.

Recommender Systems

A recommender system is typically used to recommend items to users based on their past behavior, especially in online retail. They are also used in social networks to recommend connections and content. A recommender system working with NLP would recommend, for example, articles similar to the ones the user has read in the past.

Text Summarization

Text summarization is the process of generating a short, accurate, and representative summary of a longer text document. The goal of text summarization is to create a condensed version of the original document that captures its essential information while being significantly shorter.

Examples of text summarization use cases are:

  • Extracting key information from public news articles and producing insights such as trends and news spotlights.
  • Allowing clustering of documents by their relevant content.

Question Answering

Question Answering (QA) is focused on techniques to automatically answer questions posed in natural language.

Broadly speaking, there are two types of QA systems: extractive and generative.

  • Extractive Question Answering takes a question as input and retrieves the most relevant answer from a large database of potential answers.
Example of extractive question answering. Image by the author.
  • Generative Question Answering, on the other hand, generates an answer from scratch based on the question and sometimes also on additional context information.
Example of generative question answering. Image by the author.

Named-Entity Recognition

Named-Entity Recognition (NER) is a subtask of information extraction that seeks to locate and classify named entities in text into pre-defined categories such as the names of persons, organizations, locations, expressions of times, quantities, monetary values, percentages, etc.

NER systems typically use a combination of machine learning and rule-based methods to identify named entities in text. While machine learning methods can be used to automatically learn patterns from annotated training data, rule-based methods use manually crafted rules to identify named entities.

Named-Entity Recognition example. Image by the author.

Knowledge Graphs

A Knowledge Graph is a data structure that stores information in the form of a graph. The nodes in the graph represent entities, and the edges represent relationships between those entities. Knowledge graphs are used in a variety of applications, including search engines, question answering systems, and recommender systems.

One of the most well-known knowledge graphs is the Google Knowledge Graph, which was launched in 2012. The Google Knowledge Graph contains billions of entities and trillions of edges, and is used to power features such as the “People also search for” and “Related searches” boxes that appear on the right-hand side of the search results page.

Graphics about building a knowledge graph from online articles (unstructured text). Image by the author.

Machine Translation

Machine Translation (MT) is the process of translating text or speech from one language to another. It was the first task of historical interest for NLP. First approached in the 1950s, today it has made great strides thanks to deep learning.

Keyword and Keyphrase Extraction

Keyword and Keyphrase Extraction is the task of automatically identifying the most important words and phrases in a document. It’s currently tackled with graph-based models, statistical models, and word embeddings.

Text Generation

Text Generation is the task of automatically creating natural language text similar to those produced by humans. The generation of texts has become so accurate in recent years that it is difficult to distinguish from those written by humans in some cases.

Text generation example. Image by the author.

Chatbots and Personal Assistants

Chatbots and Personal Assistants are computer programs that are designed to simulate human conversation, while also helping users in doing tasks. They are commonly used in online customer service to answer simple questions or requests.

Speech-to-Text and Text-to-Speech

In Speech-to-Text (STT), also called Automatic Speech Recognition (ASR), the computer listens to a person speaking and converts the sounds into written words. In Text-to-Speech (TTS), the computer reads written text and converts it into spoken words.

Both speech-to-text and text-to-speech have a variety of applications. They can be used to create text documents from audio recordings, generate audio files from text, create subtitles for videos, and provide accessibility for people with disabilities.

Speech-to-text and text-to-speech technology is constantly improving, and it is now possible to create high-quality audio files that sound natural and realistic.

Text-to-Speech Examples

Open this link to listen to machine-generated speech with different voices and tones of voice. They have been generated with the TorToiSe open-source TTS model.

Image Search

Image Search is the process of searching for images based on their visual content and using textual queries. It’s a multimodal task as it concerns data in different modalities: text and image.

Nowadays, image-based search engines are developed somewhat similar to semantic text-based search engines:

  1. All the images are embedded and represented as vectors.
  2. The query is embedded as well.
  3. The best results are the images with the highest vector similarity to the query.
How an image search engine works. Image by the author.

Thank you for reading! I am preparing an online course for NLP practitioners with lessons like this one. If you want to be updated when it comes out or you are interested in learning more about NLP, remember to follow NLPlanet: you can find us on Medium, LinkedIn, Twitter, and our new Discord server!

--

--

Fabio Chiusano
NLPlanet

Freelance data scientist — Top Medium writer in Artificial Intelligence