- Natural Language Processing with TensorFlow
- Thushan Ganegedara
- 354字
- 2021-06-25 21:28:24
Summary
Word embeddings have become an integral part of many NLP tasks and are widely used for tasks such as machine translation, chatbots, image caption generation, and language modeling. Not only do word embeddings act as a dimensionality reduction technique (compared to one-hot encoding) but they also give a richer feature representation than other existing techniques. In this chapter, we discussed two popular neural network-based methods for learning word representations, namely the skip-gram model and the CBOW model.
First, we discussed the classical approaches to develop an understanding about how word representations were learned in the past. We discussed various methods such as using WordNet, building a co-occurrence matrix of the words, and calculating TF-IDF. Later, we discussed the limitations of these approaches.
This motivated us to explore neural network-based word representation learning methods. First, we worked out an example by hand to understand how word embeddings or word vectors can be calculated and one use case of word vectors to learn the interesting things that can be done with word vectors.
Next, we discussed the first word-embedding learning algorithm—the skip-gram model. We then learned how to prepare the data to be used for learning. Later, we examined how to design a loss function that allows us to use word embeddings using the context words of a given word. Afterwards, we discussed a crucial limitation of the close-form loss function we developed. The loss function is not scalable for large vocabularies. Later we analyzed two popular approximations of the close-form loss that allowed us to calculate the loss efficiently and effectively—negative sampling and hierarchical softmax. Finally, we discussed how to implement the skip-gram algorithm using TensorFlow.
Then we reviewed the next choice for learning word embeddings—the CBOW model. We also discussed how CBOW differs from the skip-gram model. Finally, we discussed a TensorFlow implementation of CBOW as well.
In the next chapter, we will analyze the performance of the Word2vec techniques we learned and also learn several extensions that significantly improve their performance. Furthermore, we will learn another word embedding learning technique known as Global Vectors or GloVe.
- 垃圾回收的算法與實(shí)現(xiàn)
- Django開發(fā)從入門到實(shí)踐
- Integrating Facebook iOS SDK with Your Application
- HTML5秘籍(第2版)
- 現(xiàn)代C++編程實(shí)戰(zhàn):132個核心技巧示例(原書第2版)
- Xcode 6 Essentials
- RubyMotion iOS Develoment Essentials
- Elasticsearch Essentials
- Tableau Desktop可視化高級應(yīng)用
- 數(shù)據(jù)分析與挖掘算法:Python實(shí)戰(zhàn)
- 嵌入式Linux C語言程序設(shè)計(jì)基礎(chǔ)教程
- 從零開始學(xué)UI:概念解析、實(shí)戰(zhàn)提高、突破規(guī)則
- 人件集:人性化的軟件開發(fā)
- 區(qū)塊鏈原理、架構(gòu)與應(yīng)用(第2版)
- C/C++程序設(shè)計(jì)教程:面向過程分冊