Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
So in this lecture we will be introducing the next section of this course, which is all about a very
interesting topic known as question answering.
Specifically, we will look at how to fine tune a transformer for this task.
As you recall, this is the task where we give the transformer a piece of text and ask it a question
based on that text.
Currently, the state of the art allows us to do extractive question answering, meaning that the correct
answer is simply a substring of the given text.
As a little exercise, it's worth thinking about how a neural network would be able to do that.
Consider whether this is a problem of classification or regression and what the outputs and loss function
might look like.
In order to prime your mind to learn the content of this section, you may find it beneficial to review
the beginner's corner where we looked at the question answering pipeline, which applies a pre-trained
model with just one line of code.
So let's discuss a brief outline for this section of the course.
As with the other sections of the course on fine tuning, we will follow the same high level steps.
As usual, we begin by tokenizing the inputs and processing the inputs so that they can be passed into
the model.
In this section, this will be our most laborious task.
We'll then look at how to compute metrics which, like the previous steps, will require a large amount
of work.
This will look very different from the previous sections, since we'll need to do quite a bit of work
to convert the model outputs into an actual string of text.
After these preliminary steps, we can finally move on to training the model and evaluating the model
after training is complete.
As usual, this portion will be brief.
So as a general theme for this section, basically it involves a little more API hunting, which means
figuring out the right functions to call in what they do, but also a lot more in terms of getting down
into the weeds, much more so than the previous sections of the course.
This is primarily due to two reasons.
Reason number one is that, as you recall, inputs for question answering come in the form of context
and question pairs.
You can imagine a context as something like a Wikipedia page on some topic because of this context can
be very long and we'll need some way to handle this, along with any complications that arise from how
we choose to do that.
The number two issue is that it's going to take quite a bit of work to convert our model outputs into
an actual answer represented as text.
At a high level, this is because the neural networks output numbers while what we want is text.
In my opinion, issue number one may simply be due to the fact that this is still a new library and
the developers haven't yet had a chance to encapsulate these steps into a more convenient API.
In any case, what this does mean is that like some of the previous sections, you will need to put
on your programming hat and write actual code.
This is not basic code like you'd see in a typical Udemy course, but real code that will require you
to think algorithmically.
Now, just as a heads up, there is one quirk with the hugging face API that will become apparent in
this section and this is that they tend to call everything an ID, so you'll have sequence IDs, example
IDs, token type IDs, token IDs, all kinds of IDs.
This becomes very annoying to keep track of since sequence and example are such generic words.
I've done my best to give variables less insane looking names.
But do keep in mind that one of the challenging things in this section is keeping track of what each
variable actually is.
To be honest with you, when I first encountered this code, I found it to be quite boring and overwhelming.
But in fact the code is quite interesting, so I encourage you to stick with it.
Put an honest amount of effort into understanding each step, and it will become an interesting problem
to solve if you are the type of person that likes to code.
Plus, it's a very cool application of NLP, so if you want to train your own question answering system
on a custom data set, this is something you'll have to know how to do.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.