Generating Contextual Embeddings with BERT
2

Wikipedia is among the most comprehensive and widely used sources of information on the internet. There are very few questions that can't be answered using Wikipedia's collection of articles. Yet, if we wanted to find the Wikipedia article for "the second King of England", we'd likely have to do some digging. Wouldn't it be convenient if we could immediately jump to the destination?

Wiki Search

This problem is an ideal candidate for a semantic search engine. Instead of having to manually parse contextual clues and click through many articles, semantic search will do the heavy lifting for us and allow us to immediately jump to the best part of the best article.

In this lesson, we'll use BERT to do exactly that by building a tool to embed and query thousands of sentences from English Wikipedia. But before diving into the project, let's first understand the theory behind BERT and learn to implement it ourselves in Python.