Acquiring data
The first step is to acquire some data to work with. For this chapter, we will require a lot of text data to convert it into tokens and visualize it to understand how neural networks rank word vectors based on Euclidean and Cosine distances. It is an important step in understanding how different words get associated with each other. This, in turn, can be used to design better, more efficient language and text-processing models.
Getting ready
Consider the following:
- The text data for the model needs to be in files of
.txt
format, and you must ensure that the files are placed in the current working directory. The text data can be anything from Twitter feeds, news feeds, customer reviews, computer code, or whole books saved in the.txt
format in the working directory. In our case, we have used the Game of Thrones books as the input text to our model. However, any text can be substituted in place of the books, and the same model will work. - Many classical texts are no longer protected...