NLP Tasks Overview
NLP Tasks Overview
OverviewMost NLP tasks can be grouped by the kind of output the model produces. In Classification, the model reads a piece of text and returns a single label. In "Multi"-classification, the model returns one label for every token (word) in the input. In Generation, the model returns new text of its own. The sections below explain each task in these three families.
1. Classification
Input text goes into the model and a single label (for example, a class number) comes out.
1.1 Sentiment Extraction
ClassificationSentiment extraction identifies the opinion or emotional tone expressed in a piece of text. The model maps the whole text to a single class such as positive, negative, or neutral. It is widely used to analyze product reviews, social media posts, and customer feedback at scale. Sarcasm and mixed opinions make this task harder than it looks.
Input : "The battery life is amazing and the screen is gorgeous!"
Output: Positive
1.2 Intent Detection
ClassificationIntent detection determines what a user wants to achieve from a short message or query. The model picks one intent from a predefined list, such as "book_flight" or "check_balance". It is a core component of chatbots and voice assistants, because the detected intent decides which action the system takes next. It is often paired with entity extraction to fill in details like dates and places.
Input : "Book me a flight to Dubai for tomorrow morning"
Output: book_flight
1.3 Language Detection
ClassificationLanguage detection identifies which language a given text is written in. The model uses clues such as character sets, common words, and character n-gram patterns to choose a language label. It is usually the first step in a multilingual pipeline, for example to route text to the right translation or search model. Very short texts and code-mixed text (such as Hinglish) are the main difficulties.
Input : "Bonjour, comment allez-vous aujourd'hui ?"
Output: French (fr)
1.4 Topic Modeling
ClassificationTopic modeling discovers the main themes that run through a text or a large collection of documents. It can be supervised, where each document is assigned to a known category, or unsupervised, where methods such as LDA find groups of related words without any labels. Each document is then described by the topics it covers. It is useful for organizing news archives, support tickets, and research papers.
Input : "The striker scored twice as the team secured a place in the final."
Output: Topic = Sports
2. "Multi"-classification
Input text goes into the model and a label is produced for every token (or for every part) of the input.
2.1 Part of Speech (POS) Tagging
Multi-classificationPOS tagging assigns a grammatical category, such as noun, verb, adjective, or preposition, to every word in a sentence. The same word can take different tags depending on context, so the model must look at the surrounding words. For example, "book" is a noun in "read a book" but a verb in "book a ticket". POS tags are a basic building block for parsing and information extraction.
Input : The cat sat on the mat
Output: DET NOUN VERB ADP DET NOUN
2.2 Named Entity Recognition (NER)
Multi-classificationNER finds and labels real-world entities in text, such as people, organizations, locations, dates, and amounts. Each token receives a tag showing whether it begins an entity, continues one, or is outside any entity. This turns unstructured text into structured data that can be searched or stored in a database. It is commonly used in resume parsing, news analysis, and medical record processing.
Input : "Sundar Pichai announced a Google office in Bengaluru on Monday."
Output: Sundar Pichai -> PERSON | Google -> ORG | Bengaluru -> LOCATION | Monday -> DATE
2.3 Dependency Parsing
Multi-classificationDependency parsing analyzes the grammatical structure of a sentence by linking each word to the word it depends on. Every link carries a relation label, such as subject, object, or modifier, and the main verb usually becomes the root of the tree. This shows who did what to whom in the sentence. The result is useful for relation extraction, question answering, and grammar checking.
Input : "She reads books"
Output: reads -> ROOT
She -> nsubj (subject of "reads")
books -> obj (object of "reads")
2.4 Constituency Parsing
Multi-classificationConstituency parsing breaks a sentence into nested phrases, such as noun phrases (NP) and verb phrases (VP), and builds a tree from them. Unlike dependency parsing, which links individual words, it groups words into larger units that act together. The tree shows how small phrases combine to form the full sentence. It is helpful for grammar analysis and for tasks that need phrase-level structure.
Input : "The dog chased the ball"
Output: (S (NP The dog) (VP chased (NP the ball)))
3. Generation
Input text goes into the model and new output text is produced, whose length and content are not fixed in advance.
3.1 Machine Translation
GenerationMachine translation automatically converts text from one language to another while keeping its meaning. The model reads the whole source sentence and then generates the target sentence word by word. Word order, grammar, and idioms differ between languages, so a good system cannot simply swap words one by one. Modern systems are built on sequence-to-sequence and Transformer models.
Input : "How are you today?" (English)
Output: "¿Cómo estás hoy?" (Spanish)
3.2 Question Answering
GenerationQuestion answering systems respond to a question written in natural language. In the extractive form, the answer is a span copied from a given passage; in the generative form, the model writes the answer in its own words. Some systems use only the knowledge stored in the model, while others retrieve documents first and answer from them. It powers search assistants, customer support bots, and reading comprehension tools.
Context : "The Eiffel Tower was completed in 1889 in Paris."
Question: "When was the Eiffel Tower completed?"
Answer : "1889"
3.3 Summarization
GenerationSummarization condenses a long text into a shorter version that keeps the most important information. Extractive summarization selects key sentences from the original, while abstractive summarization writes new sentences that capture the meaning. The main challenge is to stay faithful to the source and avoid adding facts that were never stated. It is used for news digests, meeting notes, and research paper abstracts.
Input : A 500-word article about a city's new metro line, covering its route,
cost, opening date, and expected ridership.
Output: "The city opened a 20 km metro line on Monday, expected to carry
200,000 riders daily."
3.4 Text Generation
GenerationText generation produces new, fluent text from a prompt by predicting one token at a time, each based on the tokens before it. It is the basic mechanism behind large language models and can be used for stories, emails, code, and conversation. Settings such as temperature control how predictable or creative the output is. Because the model can sound confident even when it is wrong, the generated text needs to be checked for accuracy.
Input : "Once upon a time, in a small village by the sea,"
Output: "there lived a fisherman who dreamed of sailing beyond the horizon..."
