Skip to content

Commit 32bfdff

Browse files
authored
[zh-TW] Added chapters 1-9 (#477)
The translation is based on Simplified Chinese version, converted via OpenCC and fixed some formatting issues.
1 parent ca81c80 commit 32bfdff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+21228
-20
lines changed

chapters/zh-TW/_toctree.yml

Lines changed: 197 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,197 @@
1-
- title: 0. 設置
2-
sections:
3-
- local: chapter0/1
4-
title: 簡介
1+
- title: 0. 安裝
2+
sections:
3+
- local: chapter0/1
4+
title: 課程簡介
5+
6+
- title: 1. Transformer 模型
7+
sections:
8+
- local: chapter1/1
9+
title: 本章簡介
10+
- local: chapter1/2
11+
title: 自然語言處理
12+
- local: chapter1/3
13+
title: Transformers 能做什麼?
14+
- local: chapter1/4
15+
title: Transformers 是如何運作的?
16+
- local: chapter1/5
17+
title: 編碼器模型
18+
- local: chapter1/6
19+
title: 解碼器模型
20+
- local: chapter1/7
21+
title: 序列到序列模型
22+
- local: chapter1/8
23+
title: 偏見和侷限性
24+
- local: chapter1/9
25+
title: 總結
26+
- local: chapter1/10
27+
title: 章末小測驗
28+
quiz: 1
29+
30+
- title: 2. 使用 🤗 Transformers
31+
sections:
32+
- local: chapter2/1
33+
title: 本章簡介
34+
- local: chapter2/2
35+
title: 管道的內部
36+
- local: chapter2/3
37+
title: 模型
38+
- local: chapter2/4
39+
title: 標記器(Tokenizer)
40+
- local: chapter2/5
41+
title: 處理多個序列
42+
- local: chapter2/6
43+
title: 把它們放在一起
44+
- local: chapter2/7
45+
title: 基本用法完成!
46+
- local: chapter2/8
47+
title: 章末小測驗
48+
quiz: 2
49+
50+
- title: 3. 微調一個預訓練模型
51+
sections:
52+
- local: chapter3/1
53+
title: 本章簡介
54+
- local: chapter3/2
55+
title: 預處理數據
56+
- local: chapter3/3
57+
title: 使用 Trainer API 或者 Keras 微調一個模型
58+
local_fw: { pt: chapter3/3, tf: chapter3/3_tf }
59+
- local: chapter3/4
60+
title: 一個完成的訓練過程
61+
- local: chapter3/5
62+
title: 微調,章節回顧!
63+
- local: chapter3/6
64+
title: 章末小測驗
65+
quiz: 3
66+
67+
- title: 4. 分享你的模型和標記器
68+
sections:
69+
- local: chapter4/1
70+
title: The Hugging Face Hub
71+
- local: chapter4/2
72+
title: 使用預訓練的模型
73+
- local: chapter4/3
74+
title: 分享預訓練的模型
75+
- local: chapter4/4
76+
title: 構建模型卡片
77+
- local: chapter4/5
78+
title: Part 1 完結!
79+
- local: chapter4/6
80+
title: 章末小測驗
81+
quiz: 4
82+
83+
- title: 5. 🤗 Datasets庫
84+
sections:
85+
- local: chapter5/1
86+
title: 本章簡介
87+
- local: chapter5/2
88+
title: 如果我的數據集不在 Hub 上怎麼辦?
89+
- local: chapter5/3
90+
title: 是時候來學一下切片了
91+
- local: chapter5/4
92+
title: 大數據? 🤗 Datasets 來救援!
93+
- local: chapter5/5
94+
title: 創建自己的數據集
95+
- local: chapter5/6
96+
title: 使用 FAISS 進行語義搜索
97+
- local: chapter5/7
98+
title: 🤗 Datasets,回顧!
99+
- local: chapter5/8
100+
title: 章末小測驗
101+
quiz: 5
102+
103+
- title: 6. 🤗 Tokenizers庫
104+
sections:
105+
- local: chapter6/1
106+
title: 本章簡介
107+
- local: chapter6/2
108+
title: 根據已有的 tokenizer 訓練新的 tokenizer
109+
- local: chapter6/3
110+
title: 快速標記器的特殊能力
111+
- local: chapter6/3b
112+
title: QA 管道中的快速標記器
113+
- local: chapter6/4
114+
title: 標準化和預標記化
115+
- local: chapter6/5
116+
title: 字節對編碼標記化
117+
- local: chapter6/6
118+
title: WordPiece 標記化
119+
- local: chapter6/7
120+
title: Unigram 標記化
121+
- local: chapter6/8
122+
title: 逐塊地構建標記器
123+
- local: chapter6/9
124+
title: 標記器,回顧!
125+
- local: chapter6/10
126+
title: 章末小測驗
127+
quiz: 6
128+
129+
- title: 7. 主要的 NLP 任務
130+
sections:
131+
- local: chapter7/1
132+
title: 章節簡介
133+
- local: chapter7/2
134+
title: 標記(token)分類
135+
- local: chapter7/3
136+
title: 微調一個掩碼(mask)語言模型
137+
- local: chapter7/4
138+
title: 翻譯
139+
- local: chapter7/5
140+
title: 文本摘要
141+
- local: chapter7/6
142+
title: 從頭開始訓練因果語言模型
143+
- local: chapter7/7
144+
title: 問答系統
145+
- local: chapter7/8
146+
title: 掌握 NLP
147+
- local: chapter7/9
148+
title: 章節測驗
149+
quiz: 7
150+
151+
- title: 8. 如何尋求幫助
152+
sections:
153+
- local: chapter8/1
154+
title: 章節簡介
155+
- local: chapter8/2
156+
title: 出現錯誤時該怎麼辦
157+
- local: chapter8/3
158+
title: 在論壇上尋求幫助
159+
- local: chapter8/4
160+
title: 調試訓練管道
161+
local_fw: { pt: chapter8/4, tf: chapter8/4_tf }
162+
- local: chapter8/5
163+
title: 如何提出一個好的問題
164+
- local: chapter8/6
165+
title: Part 2 完結!
166+
- local: chapter8/7
167+
title: 章節測驗
168+
quiz: 8
169+
170+
- title: 9. 構建並分享你的模型
171+
new: true
172+
subtitle: 我訓練了一個模型,但我該如何展示它呢?
173+
sections:
174+
- local: chapter9/1
175+
title: Gradio 簡介
176+
- local: chapter9/2
177+
title: 構建你的第一個演示
178+
- local: chapter9/3
179+
title: 瞭解接口類
180+
- local: chapter9/4
181+
title: 與他人分享演示
182+
- local: chapter9/5
183+
title: 與 Hugging Face Hub 整合
184+
- local: chapter9/6
185+
title: 高級界面功能
186+
- local: chapter9/7
187+
title: Gradio 塊簡介
188+
- local: chapter9/8
189+
title: Gradio, 回顧!
190+
- local: chapter9/9
191+
title: 章末測試
192+
quiz: 9
193+
194+
- title: 課程活動
195+
sections:
196+
- local: events/2
197+
title: Part 2 發佈活動

chapters/zh-TW/chapter0/1.mdx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
# 簡介
1+
# 課程簡介
22

3-
歡迎來到Hugging Face的教學!本篇介紹將會帶著你設置運行環境。如果你正開始學的話,不妨先看看[第一章](/course/chapter1)再回來,這樣就能直接開始試著執行裡面的程式碼了。
3+
歡迎來到 Hugging Face 的教學!本篇介紹將會帶著你設置運行環境。如果你正開始學的話,不妨先看看[第一章](/course/chapter1)再回來,這樣就能直接開始試著執行裡面的程式碼了。
44

5-
我們會用到的所有函式庫都將會以Python資源包的方式被取得,所以這邊我們會教你如何設置Python環境並安裝你所需要的函式庫
5+
我們會用到的所有函式庫都將會以 Python 資源包的方式被取得,所以這邊我們會教你如何設置 Python 環境並安裝你所需要的函式庫
66

7-
本篇將會涵蓋兩種設置環境的方法 - 使用Colab notebook或是Python虛擬環境。選你自己覺得合適的方式就好,但是對於初學者我們強烈推薦先從使用Colab notebook開始
7+
本篇將會涵蓋兩種設置環境的方法 - 使用 Colab notebook 或是 Python 虛擬環境。選你自己覺得合適的方式就好,但是對於初學者我們強烈推薦先從使用 Colab notebook 開始
88

9-
我們不會提到Windows系統,如果你是Windows的使用者,我們建議使用Colab notebook。如果你用的是Linux或是macOS,你可以任意選擇上述的兩種方法。
9+
我們不會提到 Windows 系統,如果你是 Windows 的使用者,我們建議使用 Colab notebook。如果你用的是 Linux 或是 macOS,你可以任意選擇上述的兩種方法。
1010

1111
大部分的教學都會需要一個Hugging Face的帳號。我們建議現在就[創一個](https://huggingface.co/join)
1212

1313
## 使用Google Colab notebook
1414

15-
用Colab notebook是最簡單容易的方法;在瀏覽器開一頁Colab notebook就能直接開始寫程式了
15+
用 Colab notebook 是最簡單容易的方法;在瀏覽器開一頁 Colab notebook 就能直接開始寫程式了
1616

17-
如果你對Colab notebook不熟悉的話,我們建議你從[這篇介紹](https://colab.research.google.com/notebooks/intro.ipynb)開始。在Colab上你可以使用一些加速硬體,像是GPU或TPU,而且工作量不大的話也不收錢
17+
如果你對 Colab notebook 不熟悉的話,我們建議你從[這篇介紹](https://colab.research.google.com/notebooks/intro.ipynb)開始。在 Colab 上你可以使用一些加速硬體,像是 GPU 或 TPU,而且工作量不大的話也不收費
1818

19-
當你開始熟悉Colab後,建立新的筆記本然後開始進行設置:
19+
當你開始熟悉 Colab 後,建立新的筆記本然後開始進行設置:
2020

2121
<div class="flex justify-center">
2222
<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter0/new_colab.png" alt="An empty colab notebook" width="80%"/>
2323
</div>
2424

25-
接下來就是安裝我們將會用到的函式庫。我們會使用 `pip` 這個Python的資源管理工具來安裝。在Colab notebook裡,你可以用 `!` 來執行系統指令,所以你可以用以下的指令來安裝 🤗 Transformers函式庫
25+
接下來就是安裝我們將會用到的函式庫。我們會使用 `pip` 這個Python的資源管理工具來安裝。在Colab notebook裡,你可以用 `!` 來執行系統指令,所以你可以用以下的指令來安裝 🤗 Transformers 函式庫
2626

2727
```
2828
!pip install transformers
2929
```
3030

31-
把函式庫導入到Python runtime可以確認你的資源包有被正確地安裝
31+
把函式庫導入到 Python runtime 可以確認你的資源包有被正確地安裝
3232

3333
```
3434
import transformers
@@ -38,7 +38,7 @@ import transformers
3838
<img src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter0/install.gif" alt="A gif showing the result of the two commands above: installation and import" width="80%"/>
3939
</div>
4040

41-
這會安裝一個非常輕量的🤗 Transformers。裡面沒有安裝任何像是PyTorch或TensorFlow等的機器學習框架。因為我們會用到很多函式庫裡的不同功能,所以我們建議安裝包含了大部分使用情境所需資源的開發用版本:
41+
這會安裝一個非常輕量的 🤗 Transformers。裡面沒有安裝任何像是 PyTorch 或 TensorFlow 等的機器學習框架。因為我們會用到很多函式庫裡的不同功能,所以我們建議安裝包含了大部分使用情境所需資源的開發用版本:
4242

4343

4444
```
@@ -50,16 +50,16 @@ import transformers
5050

5151
## 使用Python虛擬環境
5252

53-
如果你比較想用Python虛擬環境的話,第一步就是安裝Python。我們建議跟著[這篇教學](https://realpython.com/installing-python/)做為起手式。
53+
如果你比較想用 Python 虛擬環境的話,第一步就是安裝 Python。我們建議跟著[這篇教學](https://realpython.com/installing-python/)做為起手式。
5454

5555

56-
當你安裝好Python後,你應該就能從終端機執行Python指令了。在進行下一步之前你可以先執行以下指令來確認Python有沒有安裝好`python --version` 這條指令會讓終端機顯示你所安裝的Python版本
56+
當你安裝好 Python 後,你應該就能從終端機執行 Python 指令了。在進行下一步之前你可以先執行以下指令來確認 Python 有沒有安裝好`python --version` 這條指令會讓終端機顯示你所安裝的 Python 版本
5757

5858

59-
在終端機執行像是`python --version`的Python指令時,你應該把你的指令想成是用你系統上主要的Python版本來執行。我們建議不要在這個版本上安裝任何資源包,讓每個專案在各自獨立的環境裡運行就可以了。這樣每個專案都可以有各自的相依性跟資源包,你也不用擔心不同專案之間使用同一個環境時潛在的相容性問題。
59+
在終端機執行像是`python --version`的 Python 指令時,你應該把你的指令想成是用你系統上主要的 Python 版本來執行。我們建議不要在這個版本上安裝任何資源包,讓每個專案在各自獨立的環境裡運行就可以了。這樣每個專案都可以有各自的相依性跟資源包,你也不用擔心不同專案之間使用同一個環境時潛在的相容性問題。
6060

6161

62-
在Python我們可以用[*虛擬環境*](https://docs.python.org/3/tutorial/venv.html)來做這件事。虛擬環境是一個獨立包裝的樹狀目錄,每一個目錄下都有安裝特定版本的Python跟它需要的所有資源包。創建這樣的虛擬環境可以用很多不同的工具,不過我們會用一個叫做[`venv`](https://docs.python.org/3/library/venv.html#module-venv)的Python官方資源包。
62+
在 Python 我們可以用[*虛擬環境*](https://docs.python.org/3/tutorial/venv.html)來做這件事。虛擬環境是一個獨立包裝的樹狀目錄,每一個目錄下都有安裝特定版本的Python跟它需要的所有資源包。創建這樣的虛擬環境可以用很多不同的工具,不過我們會用一個叫做[`venv`](https://docs.python.org/3/library/venv.html#module-venv)的Python官方資源包。
6363

6464
首先,創建你希望你的程式執行時所在的目錄 - 舉例來說,你可能想要在你的家目錄下新增一個叫*transformers-course*的目錄:
6565

@@ -103,7 +103,7 @@ which python
103103

104104
### 安裝相依性資源包
105105

106-
在之前的段落中提到的使用Google Colab的情況裡,你會需要安裝相依性資源包才能繼續。你可以用 `pip` 這個資源管理工具來安裝開發版的🤗 Transformers:
106+
在之前的段落中提到的使用 Google Colab 的情況裡,你會需要安裝相依性資源包才能繼續。你可以用 `pip` 這個資源管理工具來安裝開發版的🤗 Transformers:
107107

108108
```
109109
pip install "transformers[sentencepiece]"

chapters/zh-TW/chapter1/1.mdx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# 本章簡介
2+
3+
<CourseFloatingBanner
4+
chapter={1}
5+
classNames="absolute z-10 right-0 top-0"
6+
/>
7+
8+
## 歡迎來到🤗教學
9+
10+
<Youtube id="00GKzGyWFEs" />
11+
12+
本教學將使用 Hugging Face 生態系統中的庫——🤗 Transformers、🤗 Datasets、🤗 Tokenizers 和 🤗 Accelerate——以及 Hugging Face Hub 教你自然語言處理 (NLP)。它是完全免費的,並且沒有廣告。
13+
14+
15+
## 有什麼是值得期待的?
16+
17+
以下是課程的簡要概述:
18+
19+
<div class="flex justify-center">
20+
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter1/summary.svg" alt="Brief overview of the chapters of the course."/>
21+
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter1/summary-dark.svg" alt="Brief overview of the chapters of the course."/>
22+
</div>
23+
24+
- 第 1 章到第 4 章介紹了 🤗 Transformers 庫的主要概念。在本課程的這一部分結束時,您將熟悉 Transformer 模型的工作原理,並將瞭解如何使用 [Hugging Face Hub](https://huggingface.co/models) 中的模型,在數據集上對其進行微調,並在 Hub 上分享您的結果。
25+
- 第 5 章到第 8 章在深入研究經典 NLP 任務之前,教授 🤗 Datasets和 🤗 Tokenizers的基礎知識。在本部分結束時,您將能夠自己解決最常見的 NLP 問題。
26+
- 第 9 章到第 12 章更加深入,探討瞭如何使用 Transformer 模型處理語音處理和計算機視覺中的任務。在此過程中,您將學習如何構建和分享模型,並針對生產環境對其進行優化。在這部分結束時,您將準備好將🤗 Transformers 應用於(幾乎)任何機器學習問題!
27+
28+
這個課程:
29+
30+
* 需要良好的 Python 知識
31+
* 最好先學習深度學習入門課程,例如[DeepLearning.AI](https://www.deeplearning.ai/) 提供的 [fast.ai實用深度學習教程](https://course.fast.ai/)
32+
* 不需要事先具備 [PyTorch](https://pytorch.org/)[TensorFlow](https://www.tensorflow.org/) 知識,雖然熟悉其中任何一個都會對huggingface的學習有所幫助
33+
34+
完成本課程後,我們建議您查看 [DeepLearning.AI的自然語言處理系列課程](https://www.coursera.org/specializations/natural-language-processing?utm_source=deeplearning-ai&utm_medium=institutions&utm_campaign=20211011-nlp-2-hugging_face-page-nlp-refresh),其中涵蓋了廣泛的傳統 NLP 模型,如樸素貝葉斯和 LSTM,這些模型非常值得瞭解!
35+
36+
## 我們是誰?
37+
38+
關於作者:
39+
40+
**Matthew Carrigan** 是 Hugging Face 的機器學習工程師。他住在愛爾蘭都柏林,之前在 Parse.ly 擔任機器學習工程師,在此之前,他在Trinity College Dublin擔任博士後研究員。他不相信我們會通過擴展現有架構來實現 AGI,但無論如何都對機器人充滿希望。
41+
42+
**Lysandre Debut** 是 Hugging Face 的機器學習工程師,從早期的開發階段就一直致力於 🤗 Transformers 庫。他的目標是通過使用非常簡單的 API 開發工具,讓每個人都可以使用 NLP。
43+
44+
**Sylvain Gugger** 是 Hugging Face 的一名研究工程師,也是 🤗Transformers庫的核心維護者之一。此前,他是 fast.ai 的一名研究科學家,他與Jeremy Howard 共同編寫了[Deep Learning for Coders with fastai and Py Torch](https://learning.oreilly.com/library/view/deep-learning-for/9781492045519/)。他的主要研究重點是通過設計和改進允許模型在有限資源上快速訓練的技術,使深度學習更容易普及。
45+
46+
**Merve Noyan** 是 Hugging Face 的開發者倡導者,致力於開發工具並圍繞它們構建內容,以使每個人的機器學習平民化。
47+
48+
**Lucile Saulnier** 是 Hugging Face 的機器學習工程師,負責開發和支持開源工具的使用。她還積極參與了自然語言處理領域的許多研究項目,例如協作訓練和 BigScience。
49+
50+
**Lewis Tunstall** 是 Hugging Face 的機器學習工程師,專注於開發開源工具並使更廣泛的社區可以使用它們。他也是即將出版的一本書[O’Reilly book on Transformers](https://www.oreilly.com/library/view/natural-language-processing/9781098136789/)的作者之一。
51+
52+
**Leandro von Werra** 是 Hugging Face 開源團隊的機器學習工程師,也是即將出版的一本書[O’Reilly book on Transformers](https://www.oreilly.com/library/view/natural-language-processing/9781098136789/)的作者之一。他擁有多年的行業經驗,通過在整個機器學習堆棧中工作,將 NLP 項目投入生產。
53+
54+
你準備好了嗎?在本章中,您將學習:
55+
* 如何使用 `pipeline()` 函數解決文本生成、分類等NLP任務
56+
* 關於 Transformer 架構
57+
* 如何區分編碼器、解碼器和編碼器-解碼器架構和用例

0 commit comments

Comments
 (0)