# 1.1 为什么选择序列模型？（Why Sequence Models?）

语音识别：给定一个输入音频片段 $$X$$，要求输出对应的文字记录 $$Y$$。输入和输出数据都是序列模型，因为 $$X$$是一个按时播放的音频片段，输出 $$Y$$是一系列单词

音乐生成问题：只有输出数据 $$Y$$是序列，而输入数据可以是空集，也可以是个单一的整数，这个数可能指代想要生成的音乐风格，或者想要生成的那首曲子的头几个音符

处理情感分类：输入数据 $$X$$是序列，会得到类似这样的输入：“**There is nothing to like in this movie.**”，你认为这句评论对应几星？

**DNA**序列分析：**DNA**用**A**、**C**、**G**、**T**四个字母来表示。给定一段**DNA**序列，能够标记出哪部分是匹配某种蛋白质？

机器翻译：输入句：“**Voulez-vou chante avecmoi?**”（法语：要和我一起唱么？），要求输出另一种语言的翻译结果

视频行为识别：得到一系列视频帧，要求识别其中的行为

命名实体识别：给定一个句子，要求识别出句中的人名

[![](https://github.com/fengdu78/deeplearning_ai_books/raw/master/images/ae2970d80a119cd341ef31c684bfac49.png)](https://github.com/fengdu78/deeplearning_ai_books/blob/master/images/ae2970d80a119cd341ef31c684bfac49.png)

这些问题都可以被称作使用标签数据 $$(X,Y)$$作为训练集的监督学习。但序列问题有很多不同类型。有些问题里，输入数据 $$X$$和输出数据$$Y$$都是序列，但就算在那种情况下，$$X$$和$$Y$$有时也会不一样长。或者像上图编号1和编号2所示的$$X$$和$$Y$$有相同的数据长度。在另一些问题里，只有 $$X$$或者只有$$Y$$是序列


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://baozoulin.gitbook.io/neural-networks-and-deep-learning/di-wu-men-ke-xu-lie-mo-xing-sequence-models/di-wu-men-kexulie-mo-578b28-sequence-models/recurrent-neural-networks/11-wei-shi-yao-xuan-ze-xu-lie-mo-xing-ff1f-ff08-why-sequence-models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
