Transformers自然语言处理(修订版,影印版)
出版时间:2023年03月
页数:383
“transformers相关书籍的杰作 —— 清晰易懂!”
——Jeremy Howard
fast.ai联合创始人,昆士兰大学教授
“清晰精辟的现代自然语言处理指南。推荐!”
——Christopher Manning
斯坦福大学机器学习
Thomas M. Siebel教授
自2017年推出以来,transformers已迅速成为在各种自然语言处理任务中实现最佳结果的主导架构。如果你是一名数据科学家或程序员,这本实践用书将向你展示如何使用Hugging FaceTransformers(基于Python的深度学习库)训练和扩展这些大型模型。
transformers已经被用来撰写真实的新闻故事、改进Google搜索查询,甚至创建会讲老套笑话的聊天机器人。在这本指南中,作者Lewis Tunstall、Leandro von Werra、Thomas Wolf(Hugging Face Transformers的创建者)通过实践方法来教你如何使用transformers以及如何将它集成到你的应用中。你将快速学习可以由transformers帮助解决的各种任务。
● 为核心NLP任务构建、调试和优化transformers模型,例如文本分类、命名实体识别和问答
● 学习如何使用transformers进行跨语言迁移学习
● 在缺乏标记数据的实际场景中应用transformers
● 使用提取、修剪和量化等技术高效部署transformers模型
● 从头开始训练transformers并学习如何扩展到多个GPU和分布式环境
- Foreword
- Preface
- 1. Hello Transformers
- The Encoder-Decoder Framework
- Attention Mechanisms
- Transfer Learning in NLP
- Hugging Face Transformers: Bridging the Gap
- A Tour of Transformer Applications
- The Hugging Face Ecosystem
- Main Challenges with Transformers
- Conclusion
- 2. Text Classification
- The Dataset
- From Text to Tokens
- Training a Text Classifier
- Conclusion
- 3. Transformer Anatomy
- The Transformer Architecture
- The Encoder
- The Decoder
- Meet the Transformers
- Conclusion
- 4. Multilingual Named Entity Recognition
- The Dataset
- Multilingual Transformers
- A Closer Look at Tokenization
- Transformers for Named Entity Recognition
- The Anatomy of the Transformers Model Class
- Tokenizing Texts for NER
- Performance Measures
- Fine-Tuning XLM-RoBERTa
- Error Analysis
- Cross-Lingual Transfer
- Interacting with Model Widgets
- Conclusion
- 5. Text Generation
- The Challenge with Generating Coherent Text
- Greedy Search Decoding
- Beam Search Decoding
- Sampling Methods
- Top-k and Nucleus Sampling
- Which Decoding Method Is Best?
- Conclusion
- 6. Summarization
- The CNN/DailyMail Dataset
- Text Summarization Pipelines
- Comparing Different Summaries
- Measuring the Quality of Generated Text
- Evaluating PEGASUS on the CNN/DailyMail Dataset
- Training a Summarization Model
- Conclusion
- 7. Question Answering
- Building a Review-Based QA System
- Improving Our QA Pipeline
- Going Beyond Extractive QA
- Conclusion
- 8. Making Transformers Efficient in Production
- Intent Detection as a Case Study
- Creating a Performance Benchmark
- Making Models Smaller via Knowledge Distillation
- Making Models Faster with Quantization
- Benchmarking Our Quantized Model
- Optimizing Inference with ONNX and the ONNX Runtime
- Making Models Sparser with Weight Pruning
- Conclusion
- 9. Dealing with Few to No Labels
- Building a GitHub Issues Tagger
- Implementing a Naive Bayesline
- Working with No Labeled Data
- Working with a Few Labels
- Leveraging Unlabeled Data
- Conclusion
- 10. Training Transformers from Scratch
- Large Datasets and Where to Find Them
- Building a Tokenizer
- Training a Model from Scratch
- Results and Analysis
- Conclusion
- 11. Future Directions
- Scaling Transformers
- Going Beyond Text
- Multimodal Transformers
- Where to from Here?
- Index
书名:Transformers自然语言处理(修订版,影印版)
国内出版社:东南大学出版社
出版时间:2023年03月
页数:383
书号:978-7-5766-0589-1
原版书书名:Natural Language Processing with Transformers
原版书出版商:O'Reilly Media
Lewis Tunstall
Lewis Tunstall是Hugging Face机器学习工程师,致力于为NLP社区开发实用工具,并帮助人们更好地使用这些工具。
Leandro von Werra
Leandro von Werra是Hugging Face机器学习工程师,致力于代码生成模型的研究与社区推广工作。
Thomas Wolf
Thomas Wolf是Hugging Face首席科学官兼联合创始人,他的团队肩负着促进AI研究和普及的使命。
The bird on the cover of Natural Language Processing with Transformers is a coconut lorikeet (Trichoglossus haematodus), a relative of parakeets and parrots. It is also known as the green-naped lorikeet and is native to Oceania.
The plumage of coconut lorikeets blends into their colorful tropical and subtropical surroundings; their green nape meets a yellow collar beneath a deep dark blue head, which ends in an orange-red bill. Their eyes are orange and the breast feathers are red. Coconut lorikeets have one of the longest, pointed tails of the seven species of lorikeet, which is green from above and yellow underneath. These birds measure 10 to 12 inches long and weigh 3.8 to 4.8 ounces.
Coconut lorikeets have one monogamous partner and lay two matte white eggs at a time. They build nests over 80 feet high in eucalyptus trees and live 15 to 20 years in the wild. This species suffers from habitat loss and capture for the pet trade.