All language subtitles for 006Transformer编码器模型

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified) Download
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

In this video, we'll study the encoder architecture. An example of a popular

encoder-only architecture is BERT, which is the most popular model of its kind.

Let's first start by understanding how it works. We'll use a small example, using three words. We

use these as inputs, and pass them through the encoder. We retrieve a numerical representation

of each word. Here, for example, the encoder converts the three words “Welcome to NYC”

in these three sequences of numbers. The encoder outputs exactly one sequence of numbers per input

word. This numerical representation can also be called a "Feature vector", or "Feature tensor".

Let's dive in this representation. It contains one vector per word that was passed through the

encoder. Each of these vector is a numerical representation of the word in question.

The dimension of that vector is defined by the architecture of the model, for the base BERT

model, it is 768. These representations contain the value of a word; but contextualized. For

example, the vector attributed to the word "to", isn't the representation of only the "to" word.

It also takes into account the words around it, which we call the “context”.As in, it looks to the

left context, the word on the left of the one we're studying (here the word "Welcome") and

the context on the right (here the word "NYC") and outputs a value for the word, within its context.

It is therefore a contextualized value. One could say that the vector of 768 values holds the

"meaning" of that word in the text. How it does this is thanks to the self-attention mechanism.

The self-attention mechanism relates to different positions (or different words) in a single

sequence, in order to compute a representation of that sequence. As we've seen before, this

means that the resulting representation of a word has been affected by other words in the sequence.

We won't dive into the specifics here, but we'll offer some further readings if you want to get

a better understanding at what happens under the hood. So when should one use an encoder?

Encoders can be used as standalone models in a wide variety of tasks. For example BERT, arguably

the most famous transformer model, is a standalone encoder model and at the time of release,

beat the state of the art in many sequence classification tasks, question answering tasks,

and masked language modeling, to only cite a few. The idea is that encoders are very powerful

at extracting vectors that carry meaningful information about a sequence. This vector can

then be handled down the road by additional layers of neurons to make sense of them.

Let's take a look at some examples where encoders really shine.

First of all, Masked Language Modeling, or MLM. It's the task of predicting a hidden word

in a sequence of words. Here, for example, we have hidden the word between "My" and "is". This is one

of the objectives with which BERT was trained: it was trained to predict hidden words in a sequence.

Encoders shine in this scenario in particular, as bidirectional information is crucial here.

If we didn't have the words on the right (is, Sylvain, and the dot), then there is very little

chance that BERT would have been able to identify "name" as the correct word. The encoder needs to

have a good understanding of the sequence in order to predict a masked word, as even if the text is

grammatically correct, It does not necessarily make sense in the context of the sequence.

As mentioned earlier, encoders are good at doing sequence classification.

Sentiment analysis is an example of a sequence classification task.

The model's aim is to identify the sentiment of a sequence – it can range from giving a sequence

a rating from one to five stars if doing review analysis, to giving a positive or negative rating

to a sequence, which is what is shown here. For example here, given the two sequences,

we use the model to compute a prediction and to classify the sequences among these two classes:

positive and negative. While the two sequences are very similar, containing the same words,

the meaning is different – and the encoder model is able to grasp that difference.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.