Released in 2014 by the computer science department at Stanford University, this 25-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: 29,837,875 |
Trained size: 132 MB
Examples
Resource retrieval
Retrieve the resource object:
Out[1]= | |
Get the pre-trained net:
Out[2]= | |
Basic usage
Use the net to obtain a list of word vectors:
Out[3]= | |
Obtain the dimensions of the vectors:
Out[4]= | |
Use the embedding layer inside a NetChain:
Out[5]= | |
Feature visualization
Create two lists of related words:
Visualize relationships between the words using the net as a feature extractor:
Out[8]= | |
Word analogies
Get the pre-trained net:
Out[9]= | |
Get a list of words:
Out[10]= | |
Obtain the vectors:
Create an association whose keys are words and whose values are vectors:
Find the eight nearest words to "king":
Out[13]= | |
Man is to king as woman is to:
Out[14]= | |
France is to Paris as Germany is to:
Out[15]= | |
Net information
Inspect the number of parameters of all arrays in the net:
Out[16]= | |
Obtain the total number of parameters:
Out[17]= | |
Obtain the layer type counts:
Out[18]= | |
Export to MXNet
Export the net into a format that can be opened in MXNet:
Out[19]= | |
Export also creates a net.params file containing parameters:
Out[20]= | |
Get the size of the parameter file:
Out[21]= | |
The size is similar to the byte count of the resource object:
Out[22]= | |
Represent the MXNet net as a graph:
Out[23]= | |
Requirements
Wolfram Language 11.2
(September 2017) or above
Resource History
Reference