Natural language processing (NLP) is the field concerned with computational methods for working with human language. It includes identifying information in text, classifying messages, finding relevant passages, translating, summarizing, and generating responses.

“Natural language” means the languages people use, such as English, Romanian, or Arabic. NLP helps software work with their varied wording and structure. Producing a useful language output does not, by itself, establish human-like understanding or factual accuracy. Hugging Face’s introduction to NLP

A support application might use NLP to recognize that “I paid twice” and “there are two charges for the same order” describe a similar issue. It still needs transaction records to establish whether a duplicate payment actually occurred.

How NLP relates to ML, neural networks, and LLMs

These terms answer different questions:

Term What it describes Example
Machine learning An approach to learning patterns from data Learn to categorize previously reviewed messages
Neural network A family of machine learning models Use a trained network to represent or classify text
NLP The field of tasks and techniques involving human language Extract an order reference or translate a reply
Large language model A type of neural language model used for many language tasks Draft a summary from supplied conversation notes

NLP can use rules, dictionaries, statistical models, neural networks, or combinations of them. An LLM is one approach within the field. A fixed-format reference can often be extracted with a pattern; a specialized classifier may suit a narrow routing task; an LLM may help with flexible summaries. The right choice depends on the task and measured results.

For the learning concepts, read machine learning and neural networks. For generative language models, continue with LLMs explained.

What NLP systems do

Language applications can combine several tasks. Extracting a date, deciding a topic, and writing a response require different outputs and checks.

Task What it produces Example use
Text classification One or more labels for a message Route a request or identify its topics
Sentiment analysis A label or score for expressed sentiment Explore favorable and unfavorable feedback
Entity recognition and information extraction Text spans or structured fields Identify names, dates, references, or requested actions
Search and retrieval Ranked documents or passages Find relevant help guidance despite different wording
Translation Text in another language Translate a support reply while preserving its meaning
Summarization A shorter account of source material Prepare a case handover with decisions and unresolved issues
Question answering An extracted or generated answer Answer a question using a supplied policy
Text generation A continuation or newly composed text Draft an explanation from instructions and evidence

Classification can describe a whole message, while token classification can label particular text spans. Named entity recognition (NER) commonly identifies entities such as people, organizations, and locations. Extracting a business-specific field, such as an internal order reference, can require rules, custom labels, or a model adapted to that field. Text classification, token classification and NER

Speech systems add related tasks: automatic speech recognition (ASR) turns audio into a transcript, and text-to-speech produces spoken output. An assistant may transcribe a recording before summarizing it. Mistakes in the transcript can propagate into the summary, so review names, numbers, and dates against the recording. Speech recognition

From words to a representation a model can process

Neural models operate on numerical inputs. Several techniques connect the original language to those inputs or add useful structure to it.

Tokens and tokenization

Tokenization divides text into units for processing. Depending on the system, tokens may correspond to words, parts of words, characters, or byte-based units. A tokenizer maps those units to identifiers the model can use.

Token counts are not word counts. Different tokenizers and languages can divide the same text differently. For a pretrained model, use its compatible tokenizer and expected input format; arbitrary token IDs from another tokenizer do not carry the same meaning. How tokenizers work

Grammar, word forms, and entities

Some pipelines add part-of-speech tags such as noun or verb, use lemmatization to identify a word’s base form, or parse grammatical relationships. Entity recognition identifies relevant spans in context.

These are useful techniques, not mandatory steps in every language model application. In particular, automatically removing punctuation, negation, or capitalization can erase information the task needs. Preserve the original text so derived fields can be checked. spaCy’s linguistic features

Embeddings and semantic similarity

An embedding represents an item, such as a word, sentence, or document passage, as a vector of numbers. Models can learn representations that make related language easier to compare. For example, an embedding search may retrieve “recover account access” for “I can’t sign in.”

Similarity is not a truth test. Similar-looking passages can describe opposite rules, different products, or outdated policies. An embedding is also not a plain-text copy of the document or a unique, universal meaning code. Its usefulness depends on the model and task. Embeddings

A worked example: reading a support request

Consider this fictional message:

Please check order CD-104. I was charged twice, and the parcel has not arrived. Do not cancel it.

A useful language-processing workflow could propose the following interpretation. This is a teaching example, not a measured model output.

{
  "order_reference": "CD-104",
  "topics": ["payment", "delivery"],
  "customer_reports": ["charged twice", "parcel not received"],
  "requested_action": "investigate",
  "cancel_order": false,
  "payment_status_verified": false
}

Notice the distinctions:

  • Two issues are present. A single-label classifier could hide the payment or delivery issue. The output design should allow both when the task requires it.
  • Negation changes the action. Dropping “not” would reverse the customer’s cancellation instruction.
  • A reported problem is not a verified fact. The customer reports two charges; the application must inspect authoritative payment records before confirming that.
  • Extraction is not authorization. Recognizing an order reference does not establish identity, grant access, or authorize a refund.

The application can use the proposed fields to locate a case and suggest a route. It should validate the reference format, check permissions and business rules, and confirm the relevant records before any consequential action.

An illustrative NLP workflow takes the customer message about order CD-104, represents and analyzes its language, proposes payment and delivery topics while preserving the instruction not to cancel, then validates the proposed result against records and rules.

This example shows several stages explicitly for teaching. A real system might combine them in one model call or use separate components. The output still needs checking at the points where it affects a decision.

NLP, natural language understanding, and generation

Natural language understanding (NLU) is a common term for tasks concerned with interpreting language, such as intent classification and information extraction. Natural language generation (NLG) concerns producing language, such as a summary or response. These are overlapping areas of NLP rather than necessarily separate software modules.

An assistant can analyze a message, retrieve a policy, and generate a reply. The same LLM may participate in several stages, while other components handle retrieval and application logic. A fluent final answer does not prove that all earlier stages succeeded.

For document-grounded answers, retrieval-augmented generation (RAG) supplies selected source material to the model. Retrieval can improve access to relevant evidence, while the generated answer can still misstate or omit it. Read RAG and agentic RAG, or try our local document-chat guide with its fictional policy and answer checklist.

Why language can be difficult

The same words can express different meanings in different contexts. Some recurring challenges are:

  • Negation and scope: “Do not cancel the replacement” differs from “Cancel the replacement.”
  • Ambiguous references: “Send it to her” needs enough context to identify the item and recipient.
  • Relative dates and locale: “Next Friday” needs a reference date; “04/05” can be ambiguous without a date convention.
  • Multiple languages and domain vocabulary: a system may handle one language well and struggle with another, mixed-language messages, or internal abbreviations.
  • Tone and indirect requests: sarcasm, politeness, and frustration do not map cleanly to a single keyword or sentiment label.
  • Missing or conflicting evidence: plausible wording cannot resolve a policy contradiction or establish a fact absent from the available records.

Test the languages, document types, and writing styles your users actually produce. Do not assume that good English performance transfers unchanged to every other language. Inspect uneven errors across relevant user groups and protect personal information in source text and logs.

How to judge an NLP system

Start with real task requirements and independently checked examples. Include ordinary cases, difficult cases, and examples where the correct response is to admit that information is missing.

Task Useful checks
Classification Precision and recall for each important label, including mixed-topic messages
Extraction Correct field values, span boundaries where relevant, missing fields, and invented values
Retrieval Relevant evidence appears in the returned passages, including applicable exceptions
Translation Meaning, terminology, names, amounts, and negation are preserved
Summarization Source facts, decisions, exceptions, and unresolved issues remain accurate
Generation Claims are supported; the result follows instructions and suits its intended audience

Precision measures how often a predicted positive is right; recall measures how many actual positives are found. F1 combines precision and recall using their harmonic mean. An aggregate score can hide a weak category, language, or user group. Use metrics alongside inspection of actual errors. Classification metrics

For the fictional request, an answer that correctly extracts CD-104 but cancels the order fails the overall task. Evaluate the complete workflow, not only the component that is easiest to score. Record response time and operating cost too, and retest after changing the model, source material, or processing rules.

Check your understanding

Does every NLP task need an LLM?

No. Rules, dictionaries, specialized statistical models, and smaller neural models can solve particular tasks. Compare suitable approaches on the examples and constraints that matter.

Is finding a person's name the same as understanding their requested action?

No. Entity recognition finds relevant text spans. Identifying a requested action is a different task and can require interpreting the surrounding language and context.

Does “I was charged twice” prove a duplicate payment occurred?

No. It establishes what the customer reports. The application must check authoritative records before treating that report as a verified transaction fact.

Continue with large language models for one major approach to modern NLP, or prompt engineering to practice giving language models clear tasks and constraints.