Easy AI Tutorial: Natural Language Processing (NLP)
> Fundamentals of natural language processing technology.
What Is NLP?
Natural Language Processing (NLP) is a branch of artificial intelligence that enables computers to understand, generate, and process human language, combining computer science, AI, and linguistics. Its goals include:
- Intelligent understanding — letting computers grasp the meaning of human language
- Natural interaction — enabling natural human–machine language communication
- Efficient processing — quickly handling large volumes of text
- Multi-task support — translation, classification, question answering, and more
- 1950s — Alan Turing proposes the Turing Test, asking "Can machines think?" and setting AI's philosophical foundation.
- 1950s–60s — Chomsky's generative grammar provides a theoretical framework for computational linguistics and machine translation; ELIZA (1966) demonstrates simple pattern-matching dialogue.
- 1970s–90s — Statistical methods rise (Hidden Markov Models, statistical machine translation), shifting NLP from rules to data-driven approaches. The internet and standardized corpora (e.g., Penn Treebank) provide large-scale training data.
- 2001 — Conditional Random Fields (CRF) achieve breakthroughs in sequence labeling (POS tagging, NER).
- 2013 — Word2Vec launches the era of distributed dense word vectors.
- 2018 — BERT sparks the pre-trained language model wave; the GPT series and Transformer architecture push NLP toward human-level performance.
- Chinese word segmentation (CWS) — splitting continuous Chinese text into meaningful words (e.g.,
今天|天气|真|好), avoiding errors like splitting雍和宫into雍|和|宫. - Subword segmentation — breaking words into smaller units (BPE, WordPiece) to handle rare and compound words.
- POS tagging — assigning part-of-speech labels (e.g.,
She (pronoun) | is (verb) | playing (verb participle)). - Text classification — assigning text to predefined categories (e.g., sports, tech, finance, entertainment news).
- Named entity recognition (NER) — extracting people, locations, organizations, dates (e.g.,
Bill Gates,Microsoft,2024). - Relation extraction — identifying semantic relations between entities.
- Text summarization — extractive (selecting key sentences) and abstractive (regenerating meaning).
- Machine translation — cross-language semantic conversion (e.g.,
今天天气很好。→今日の天気はとても良いです。). - Question answering (QA) — retrieval-based, knowledge-base, and community-style systems requiring comprehension and reasoning.
- Vector Space Model (VSM, 1970s) — sparse high-dimensional vectors with TF-IDF weighting; suffers from sparsity, ignores word order and semantics.
- N-gram models (1980s–90s) — Markov-assumption probability of a word given the previous N−1 words; data-sparse for large N, no long-range dependencies.
- Word2Vec (2013) — CBOW and Skip-Gram produce low-dimensional dense vectors capturing semantic similarity and analogies.
- ELMo (2018) — bidirectional LSTM pretraining yields context-dependent dynamic embeddings, solving polysemy.
- Everyday tools: voice assistants (Siri), smart input methods, machine translation (Google Translate)
- Information processing: spam filtering, sentiment/public-opinion analysis, news classification
- Intelligent systems: QA bots, knowledge graph construction, recommendation systems
NLP vs. LLMs
| Aspect | Traditional NLP | Large Language Models (LLMs) | |---|---|---| | Technical basis | Bag-of-words, shallow neural networks, preprocessing (stop-word removal) | Pretraining on web-scale and multimodal data | | Strengths | Low resource consumption, high interpretability, precise on specific tasks (POS tagging, NER, sentiment analysis, specific language-pair translation) | Strong generalization, excellent generation, understanding complex context (creative writing, multi-turn dialogue, code generation) | | Relationship | Complementary: precision + flexibility, efficiency + capability, specialized + general | |
A Brief History
Core Tasks
Text Representation Techniques
Applications
Challenges and Future Directions
Challenges: ambiguity (e.g., "Apple" as fruit vs. company), metaphor understanding, cross-lingual and cultural differences.
Future directions: optimization of pre-trained models (e.g., GPT-4), multimodal fusion (language + image/speech), few-shot learning, and explainable NLP. NLP is evolving from surface-level processing toward deep semantic understanding.
---
*Originally published on zhichai.net as part of the Easy AI tutorial series.*