【附PDF下载】Tensorflow新特性与NLP最佳实践(Jupyter Notebooks)

2018 年 9 月 28 日 专知

【导读】学习TensorFlow最好的方式之一就是大量地阅读TensorFlow实例代码。《Good practices in Modern Tensorflow for NLP》by Guillaume Genthial 利用Jupyter Notebooks展示了大量的TensorFlow新特性与NLP的实例代码。



目录:


  1. Eager execution(动态图)

  2. tf.data: feeding data into the graph (如果将数据传入图中)

    1. Placeholders (before)) (静态图的Placeholder)

    2. Dataset from np.array (利用Dataset API以np.array作为输入)

    3. Dataset from text file (利用Dataset API以文件作为输入)

    4. Dataset from custom generator (利用Dataset API以自定义的生成器作为输入)

  3. tf.data: Dataset Transforms (数据变换)

    1. Shuffle (随机打乱数据)

    2. Repeat (重复数据)

    3. Map (对数据执行Map变换操作)

    4. Batch (将数据切分为Batch)

    5. Padded batch (有Padding操作的Batch)

  4. NLP: preprocessing in Tensorflow

    1. Tokenizing by white space in TensorFlow (利用空白对文本进行Token化)

    2. Lookup token index from vocab file in TensorFlow (从词典获取词的索引号)

  5. Full Example (完整示例)

    1. Task and Data

    2. Graph (test with eager execution)) 

    3. Model (tf.estimator)) (Estimator API)

      1. Before: custom model classes (自定义Model类)

      2. Now: tf.estimator (Estimator API)

      3. input_fn (数据输入)

      4. model_fn(定义EstimatorSpec)

      5. Instantiate and train your Estimator (实例化和训练Estimator)

      6. TensorBoard, train_and_evaluatepredict etc. (TensorBoard可视化香)

  6. A word about TensorFlow model serving

    1. Serving interface (Serving接口)

    2. Docker Image (Docker镜像)

      1. Pull existing image (下载已有镜像)

      2. Run (运行)

      3. Rest API POST with curl (Restful API以及用curl请求该API)


请关注专知公众号(扫一扫最下面专知二维码,或者点击上方蓝色专知),

  • 后台回复“GPMTN” 就可以获取全文 PPT下载链接~ 


参考资料:

  • http://nbviewer.jupyter.org/github/roamanalytics/roamresearch/blob/master/BlogPosts/Modern_TensorFlow/modern-tensorflow.ipynb#Serving-interface

-END-

专 · 知


人工智能领域26个主题知识资料全集获取与加入专知人工智能服务群: 欢迎微信扫一扫加入专知人工智能知识星球群,获取专业知识教程视频资料和与专家交流咨询!


请PC登录www.zhuanzhi.ai或者点击阅读原文,注册登录专知,获取更多AI知识资料!


请加专知小助手微信(扫一扫如下二维码添加),加入专知主题群(请备注主题类型:AI、NLP、CV、 KG等)交流~

 AI 项目技术 & 商务合作:bd@zhuanzhi.ai, 或扫描上面二维码联系!

请关注专知公众号,获取人工智能的专业知识!

点击“阅读原文”,使用专知

登录查看更多
25

相关内容

Google发布的第二代深度学习系统TensorFlow
最新《自动微分手册》77页pdf
专知会员服务
97+阅读 · 2020年6月6日
一份循环神经网络RNNs简明教程,37页ppt
专知会员服务
168+阅读 · 2020年5月6日
【干货书】机器学习Python实战教程,366页pdf
专知会员服务
332+阅读 · 2020年3月17日
《强化学习—使用 Open AI、TensorFlow和Keras实现》174页pdf
专知会员服务
136+阅读 · 2020年3月1日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
90+阅读 · 2019年10月10日
学习自然语言处理路线图
专知会员服务
133+阅读 · 2019年9月24日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
tensorflow LSTM + CTC实现端到端OCR
机器学习研究会
26+阅读 · 2017年11月16日
开源|基于tensorflow使用CNN-RNN进行中文文本分类!
全球人工智能
11+阅读 · 2017年11月12日
Arxiv
29+阅读 · 2020年3月16日
Star-Transformer
Arxiv
5+阅读 · 2019年2月28日
Bidirectional Attention for SQL Generation
Arxiv
4+阅读 · 2018年6月21日
Arxiv
6+阅读 · 2018年2月24日
VIP会员
相关VIP内容
最新《自动微分手册》77页pdf
专知会员服务
97+阅读 · 2020年6月6日
一份循环神经网络RNNs简明教程,37页ppt
专知会员服务
168+阅读 · 2020年5月6日
【干货书】机器学习Python实战教程,366页pdf
专知会员服务
332+阅读 · 2020年3月17日
《强化学习—使用 Open AI、TensorFlow和Keras实现》174页pdf
专知会员服务
136+阅读 · 2020年3月1日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
90+阅读 · 2019年10月10日
学习自然语言处理路线图
专知会员服务
133+阅读 · 2019年9月24日
相关资讯
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
tensorflow LSTM + CTC实现端到端OCR
机器学习研究会
26+阅读 · 2017年11月16日
开源|基于tensorflow使用CNN-RNN进行中文文本分类!
全球人工智能
11+阅读 · 2017年11月12日
相关论文
Arxiv
29+阅读 · 2020年3月16日
Star-Transformer
Arxiv
5+阅读 · 2019年2月28日
Bidirectional Attention for SQL Generation
Arxiv
4+阅读 · 2018年6月21日
Arxiv
6+阅读 · 2018年2月24日
Top
微信扫码咨询专知VIP会员