Skip to Content
机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
book

机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)

by Aurélien Géron
October 2020
Intermediate to advanced
693 pages
16h 26m
Chinese
China Machine Press
Content preview from 机器学习实战:基于Scikit-Learn、Keras 和TensorFlow (原书第2 版)
455
16
使用 RNN 和注意力机制
进行自然语言处理
当艾伦
·
图灵(Alan Turing)在 1950 年想象他著名的图灵测试
1
时,他的目标是评估
一台机器的能力来匹配人类的智能。他可以测试很多东西,例如识别图片中的猫、下
棋、作曲或逃脱迷宫等的能力,但有趣的是,他选择了一个语言任务。更具体地讲,他
设计了一个聊天机器人,能够欺骗其对话者以为它是人类
2
。此测试确实有其弱点:一
组硬编码规则可以欺骗毫无戒心或天真的人(例如,机器可以给出模糊的预定义回答来
回应某些关键字,也可以假装是在开玩笑或喝醉了来通过这个测试,或者通过应答自己
的问题来逃避棘手的问题),人类智力的许多方面都被完全忽略了(例如,解释非语言
交流(例如面部表情)的能力,或学习手工任务的能力)。但是测试确实突出了这样一
个事实,即掌握语言可以说是智人最大的认知能力。我们可以建造一台可以读写自然
语言的机器吗?
12
自然语言任务的常见方法是使用循环神经网络。我们继续探索 RNN(在第 15 章中介绍),
从字符 RNN 开始,经过训练可以预测句子中的下一个字符。这将使我们能够生成一些
原始文本,在此过程中,我们将了解如何在很长的序列上构建 TensorFlow 数据集。我
们首先使用无状态 RNN(在每次迭代时,处理文本的随机部分,而在文本的其余部分上
没有任何信息),然后我们将创建一个有状态 RNN(在 RNN 训练迭代之间保留隐藏状
态,并继续从中断处读取内容,从而允许其学习更长的模式)。接下来,我们将构建一
RNN
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

算法技术手册(原书第2 版)

算法技术手册(原书第2 版)

George T.Heineman, Gary Pollice, Stanley Selkow
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787111665977