Working of BERT
Learn how BERT is bidirectional with detailed examples.
We'll cover the following...
Bidirectional Encoder Representation from Transformer (BERT), as the name suggests, is based on the transformer model. We can perceive BERT as the transformer, but only with the encoder.
In transformers, we feed the sentence as input to the transformer's encoder, and it returns the representation for each word in the sentence as an output. Well, that's exactly what BERT is—an encoder representation from transformer. Okay, so what about the term Bidirectional?
How BERT is bidirectional
The encoder of the transformer is bidirectional in nature since it can read a sentence in both directions. Thus, BERT is basically the bidirectional encoder representation obtained from the transformer.
Let’s understand how BERT is a bidirectional encoder representation from the transformer with the help of an example.
Example: He got bit by a Pyhton
Say we have a sentence A: ‘He got bit by a Python’. Now, we feed this sentence as an input to the ...