Released in 2014 by the computer science department at Stanford University, this 50-dimensional representation is trained using an original method called Global Vectors (GloVe). It encodes 1,193,515 tokens as unique vectors, with all tokens outside the vocabulary encoded as the zero-vector. Token case is ignored.
Number of layers: 1 |
Parameter count: 59,675,750 |
Trained size: 252 MB
Examples
Resource retrieval
Get the pre-trained net:
Out[1]= |  |
Basic usage
Use the net to obtain a list of word vectors:
Out[2]= |  |
Obtain the dimensions of the vectors:
Out[3]= |  |
Use the embedding layer inside a NetChain:
Out[4]= |  |
Feature visualization
Create two lists of related words:
Visualize relationships between the words using the net as a feature extractor:
Out[7]= |  |
Word analogies
Get the pre-trained net:
Out[8]= |  |
Get a list of words:
Out[9]= |  |
Obtain the vectors:
Create an association whose keys are words and whose values are vectors:
Find the eight nearest words to "king":
Out[12]= |  |
Man is to king as woman is to:
Out[13]= |  |
France is to Paris as Germany is to:
Out[14]= |  |
Net information
Inspect the number of parameters of all arrays in the net:
Out[15]= |  |
Obtain the total number of parameters:
Out[16]= |  |
Obtain the layer type counts:
Out[17]= |  |
Export to MXNet
Export the net into a format that can be opened in MXNet:
Out[18]= |  |
Export also creates a net.params file containing parameters:
Out[19]= |  |
Get the size of the parameter file:
Out[20]= |  |
The size is similar to the byte count of the resource object:
Out[21]= |  |
Represent the MXNet net as a graph:
Out[22]= |  |
Requirements
Wolfram Language 11.2
(September 2017) or above
Resource History
Reference