[NeurIPS 2019] Spherical Text Embedding
[NeurIPS 2019] Spherical Text Embedding
The source code used for Spherical Text Embedding, published in NeurIPS 2019. The code structure (especially file reading and saving functions) is adapted from the Word2Vec implementation.
We provide pre-trained JoSE embeddings on the wikipedia dump.
Unlike Euclidean embeddings such as Word2Vec and GloVe, spherical embeddings do not necessarily benefit from higher-dimensional space, so it might be a good idea to start with lower-dimensional ones first.
We provide a shell script run.sh for compiling the source file and training embedding.
Note: When preparing the training text corpus, make sure each line in the file is one document/paragraph.
Note: It is recommended to use the default hyperparameters, especially the number of negative samples (-negative) and loss function margin (-margin).
Invoke the command without arguments for a list of hyperparameters and their meanings:
…We provide a shell script eval_sim.sh for word similarity evaluation of trained spherical word embeddings on the wikipedia dump. The script will first download a zipped file of the pre-processed wikipedia dump (retrieved 2019.05; the zipped version is of ~4GB; the unzipped one is of ~13GB; for a detailed description of the dataset, see its README file), and then run JoSE on it. Finally, the trained embeddings are evaluated on three benchmark word similarity datasets: WordSim-353, MEN and SimLex-999.
We provide a shell script eval_cluster.sh for document clustering evaluation of trained spherical document embeddings on the 20 Newsgroup dataset. The script will perform K-Means and Spherical K-Means clustering on the trained document embeddings.
We provide a shell script eval_classify.sh for document classification evaluation of trained spherical document embeddings on the 20 Newsgroup dataset. The script will perform KNN classification following the original 20 Newsgroup train/test split with the trained document embeddings as features.
Please cite the following paper if you find the code helpful for your research.
@inproceedings{meng2019spherical,
title={Spherical Text Embedding},
author={Meng, Yu and Huang, Jiaxin and Wang, Guangyuan and Zhang, Chao and Zhuang, Honglei and Kaplan, Lance and Han, Jiawei},
booktitle={Advances in neural information processing systems},
year={2019}
}No open issues yet, or sync has not completed.