1-Transformer_models-0-Introduction

中英文对照学习,效果更佳!
原课程链接:https://huggingface.co/course/chapter1/1?fw=pt

Introduction

引言

Ask a Question

问一个问题

Welcome to the 🤗 Course!

欢迎参加🤗课程!

This course will teach you about natural language processing (NLP) using libraries from the Hugging Face ecosystem — 🤗 Transformers, 🤗 Datasets, 🤗 Tokenizers, and 🤗 Accelerate — as well as the Hugging Face Hub. It’s completely free and without ads.

本课程将向您介绍如何使用Hugging Face生态系统中的库–🤗Transformer、🤗数据集、🤗标记器和🤗加速–以及Hugging Face中心进行自然语言处理。它是完全免费的,没有广告。

What to expect?

还能期待什么?

Here is a brief overview of the course:

以下是课程的简要概述:

Brief overview of the chapters of the course.
Brief overview of the chapters of the course.

课程各章的简要概述。课程各章的简要概述。

  • Chapters 1 to 4 provide an introduction to the main concepts of the 🤗 Transformers library. By the end of this part of the course, you will be familiar with how Transformer models work and will know how to use a model from the Hugging Face Hub, fine-tune it on a dataset, and share your results on the Hub!
  • Chapters 5 to 8 teach the basics of 🤗 Datasets and 🤗 Tokenizers before diving into classic NLP tasks. By the end of this part, you will be able to tackle the most common NLP problems by yourself.
  • Chapters 9 to 12 go beyond NLP, and explore how Transformer models can be used to tackle tasks in speech processing and computer vision. Along the way, you’ll learn how to build and share demos of your models, and optimize them for production environments. By the end of this part, you will be ready to apply 🤗 Transformers to (almost) any machine learning problem!

This course:

第1章到第4章介绍了🤗Transformer程序库的主要概念。在本课程的这一部分结束时,您将熟悉Transformer模型的工作原理,并将知道如何使用Hugging Face中心的模型,如何在数据集上对其进行微调,并在中心上分享您的结果!第5章到第8章在深入了解经典的自然语言编程任务之前,将教授🤗数据集和🤗标记器的基础知识。在本部分结束时,您将能够自己解决最常见的NLP问题。第9章到第12章将超越NLP,并探索如何使用Transformer模型来处理语音处理和计算机视觉中的任务。在此过程中,您将学习如何构建和共享模型的演示,并针对生产环境优化它们。在本部分结束时,您将准备好将🤗Transformer应用于(几乎)任何机器学习问题!本课程:

After you’ve completed this course, we recommend checking out DeepLearning.AI’s Natural Language Processing Specialization, which covers a wide range of traditional NLP models like naive Bayes and LSTMs that are well worth knowing about!

需要良好的Python知识最好是在入门深度学习课程(如Fast.ai针对程序员的实用深度学习或DeepLearning开发的程序之一)之后学习。AIDO不要求具有先前的PyTorch或TensorFlow知识,尽管对它们的一些熟悉将对您有所帮助完成本课程后,我们建议您查看DeepLearning.AI的自然语言处理专业,它涵盖了广泛的传统NLP模型,如naive Bayes和LSTM,非常值得了解!

Who are we?

我们是谁啊?

About the authors:

关于作者:

Abubakar Abid completed his PhD at Stanford in applied machine learning. During his PhD, he founded Gradio, an open-source Python library that has been used to build over 600,000 machine learning demos. Gradio was acquired by Hugging Face, which is where Abubakar now serves as a machine learning team lead.

阿布巴卡尔·阿比德在斯坦福大学完成了他的应用机器学习博士学位。在博士期间,他创建了GRadio,这是一个开源的Python库,已经被用来构建超过60万个机器学习演示。GRadio是通过拥抱Face获得的,Abubakar现在担任机器学习团队的负责人。

Matthew Carrigan is a Machine Learning Engineer at Hugging Face. He lives in Dublin, Ireland and previously worked as an ML engineer at Parse.ly and before that as a post-doctoral researcher at Trinity College Dublin. He does not believe we’re going to get to AGI by scaling existing architectures, but has high hopes for robot immortality regardless.

马修·卡里根是《Hugging Face》的机器学习工程师。他住在爱尔兰的都柏林,之前在Parse.ly担任ML工程师,在此之前是都柏林三一学院的博士后研究员。他不相信我们将通过扩展现有的架构来达到AGI,但无论如何,他对机器人不朽抱有很高的希望。

Lysandre Debut is a Machine Learning Engineer at Hugging Face and has been working on the 🤗 Transformers library since the very early development stages. His aim is to make NLP accessible for everyone by developing tools with a very simple API.

LySandre首次亮相是一名机器学习工程师,在Hugging Face方面,从非常早期的开发阶段开始,她就一直在开发🤗Transformer程序库。他的目标是通过开发具有非常简单的API的工具,使每个人都可以访问NLP。

Sylvain Gugger is a Research Engineer at Hugging Face and one of the core maintainers of the 🤗 Transformers library. Previously he was a Research Scientist at fast.ai, and he co-wrote Deep Learning for Coders with fastai and PyTorch with Jeremy Howard. The main focus of his research is on making deep learning more accessible, by designing and improving techniques that allow models to train fast on limited resources.

西尔万·古格是《Hugging Face》的研究工程师,也是🤗Transformer图书馆的核心维护者之一。在此之前,他是Fast.ai的研究科学家,并与Jeremy Howard共同为Fastai和PyTorch的程序员撰写了深度学习。他的主要研究重点是通过设计和改进技术,让模型能够在有限的资源上快速训练,从而使深度学习更容易获得。

Dawood Khan is a Machine Learning Engineer at Hugging Face. He’s from NYC and graduated from New York University studying Computer Science. After working as an iOS Engineer for a few years, Dawood quit to start Gradio with his fellow co-founders. Gradio was eventually acquired by Hugging Face.

达伍德·汗是《Hugging Face》的机器学习工程师。他来自纽约,毕业于纽约大学计算机科学专业。在做了几年iOS工程师后,达伍德辞职,与其他联合创始人一起创办了GRadio。GRadio最终通过拥抱Face而被收购。

Merve Noyan is a developer advocate at Hugging Face, working on developing tools and building content around them to democratize machine learning for everyone.

Merve Noyan是一位拥护面孔的开发人员,他致力于开发工具并围绕这些工具构建内容,以使每个人的机器学习民主化。

Lucile Saulnier is a machine learning engineer at Hugging Face, developing and supporting the use of open source tools. She is also actively involved in many research projects in the field of Natural Language Processing such as collaborative training and BigScience.

Lucile Saulnier是一名机器学习工程师,擅长Hugging Face、开发和支持开源工具的使用。她还积极参与了自然语言处理领域的许多研究项目,如协作培训和BigScience。

Lewis Tunstall is a machine learning engineer at Hugging Face, focused on developing open-source tools and making them accessible to the wider community. He is also a co-author of the O’Reilly book Natural Language Processing with Transformers.

Lewis Tunstall是一名机器学习工程师,致力于开发开源工具,并让更广泛的社区能够访问它们。他也是O‘Reilly出版的《与Transformer的自然语言处理》一书的合著者。

Leandro von Werra is a machine learning engineer in the open-source team at Hugging Face and also a co-author of the O’Reilly book Natural Language Processing with Transformers. He has several years of industry experience bringing NLP projects to production by working across the whole machine learning stack..

Leandro von Wera是Huging Face开源团队的机器学习工程师,也是O‘Reilly出版的《自然语言处理与Transformer》一书的合著者。他有几年的行业经验,通过在整个机器学习堆栈中工作,将NLP项目投入生产。

FAQ

常见问题解答

Here are some answers to frequently asked questions:

以下是常见问题的一些答案:

  • Does taking this course lead to a certification?
    Currently we do not have any certification for this course. However, we are working on a certification program for the Hugging Face ecosystem — stay tuned!
  • How much time should I spend on this course?
    Each chapter in this course is designed to be completed in 1 week, with approximately 6-8 hours of work per week. However, you can take as much time as you need to complete the course.
  • Where can I ask a question if I have one?
    If you have a question about any section of the course, just click on the ”Ask a question” banner at the top of the page to be automatically redirected to the right section of the Hugging Face forums:

Link to the Hugging Face forums
Note that a list of project ideas is also available on the forums if you wish to practice more once you have completed the course.

参加这门课程会获得认证吗?目前,我们没有针对此课程的任何认证。然而,我们正在为Hugging Face生态系统制定一个认证项目–敬请关注!我应该在这门课程上花费多少时间?本课程的每一章都设计为在一周内完成,每周大约工作6-8个小时。然而,您可以根据需要花费多长时间来完成课程。如果我有问题,我可以在哪里提问?如果您对课程的任何部分有疑问,只需点击页面顶部的“Ask a Problem”横幅,就会自动跳转到Hugging Face论坛的右侧部分:Hugging Face论坛的链接请注意,如果您希望在完成课程后进行更多练习,论坛上也有项目想法的列表。

  • Where can I get the code for the course?
    For each section, click on the banner at the top of the page to run the code in either Google Colab or Amazon SageMaker Studio Lab:

Link to the Hugging Face course notebooks
The Jupyter notebooks containing all the code from the course are hosted on the huggingface/notebooks repo. If you wish to generate them locally, check out the instructions in the course repo on GitHub.

我在哪里可以弄到课程的代码?对于每一节,点击页面顶部的横幅,就可以在Google Colab或Amazon SageMaker Studio Lab中运行代码:指向Hugging Face课程笔记本的链接Jupyter笔记本包含课程的所有代码都托管在HuggingFace/Notebooks库中。如果您希望在本地生成它们,请查看GitHub上的Course资源库中的说明。

  • How can I contribute to the course?
    There are many ways to contribute to the course! If you find a typo or a bug, please open an issue on the course repo. If you would like to help translate the course into your native language, check out the instructions here.

    我能为这门课程做些什么?有很多方法可以为课程做出贡献!如果您发现打字错误或错误,请在Course回收站上打开一个问题。如果您希望帮助将课程翻译成您的母语,请查看此处的说明。

  • What were the choices made for each translation?
    Each translation has a glossary and TRANSLATING.txt file that details the choices that were made for machine learning jargon etc. You can find an example for German here.

    每种翻译的选择是什么?每个翻译都有一个词汇表和TRANSLATING.txt文件,其中详细说明了机器学习、术语等方面的选择。你可以在这里找到德语的例子。

  • Can I reuse this course?
    Of course! The course is released under the permissive Apache 2 license. This means that you must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. If you would like to cite the course, please use the following BibTeX:

    我可以重复使用这个课程吗?当然了!该课程是在许可的Apache2许可下发布的。这意味着您必须给予适当的积分,提供许可证的链接,并指出是否进行了更改。您可以以任何合理的方式这样做,但不能以任何暗示许可方认可您或您的使用的方式。如果您想引用本课程,请使用以下BibTeX:

1
2
3
4
5
6
7
@misc{huggingfacecourse,
author = {Hugging Face},
title = {The Hugging Face Course, 2022},
howpublished = "\url{https://huggingface.co/course}",
year = {2022},
note = "[Online; accessed <today>]"
}

Let’s Go

我们走吧

Are you ready to roll? In this chapter, you will learn:

你准备好出发了吗?在本章中,您将了解:

  • How to use the pipeline() function to solve NLP tasks such as text generation and classification
  • About the Transformer architecture
  • How to distinguish between encoder, decoder, and encoder-decoder architectures and use cases