Skip to content
Switch branches/tags
Go to file

Latest commit


Git stats


Failed to load latest commit information.

Sememe Prediction

The code for Lexical Sememe Prediction via Word Embeddings and Matrix Factorization(IJCAI2017)

Running Requirement

Memory: at least 8GB, 16GB or more is recommended.

Storage: at least 15GB, 20GB or more is recommended.

Dependency: The version of python should be at least 3.5, numpy is needed.

How to Run

  1. Prepare a file that contains pre-trained Chinese word embeddings(of Google Word2Vec form). We recommend that the amount of words be at least 200,000 and the number of dimentions be at least 200. It will achieve much better result using a large ( 20GB or more is recommended) corpus to train your embeddings for running this program. For example, SogouT (password: f2ul).

  2. Rename the word embedding file as 'embedding_200.txt' and put it under the directory.

(For application user, then you should prepare a file named as "hownet.txt_test", which lists all the target words(per word per line, in UTF-8 NO BOM encoding). After that, what you should do is to run application_SPWE[SPSE/SPASE].sh and you can leave out the following instructions and get the result in output_SPWE[SPSE/SPASE])

  1. Run, the program will automatically generate evaluation data set and other data files required during training.

  2. Run . The corresponding model will be automatically training and evaluated. (As for SPASE model, it will take pretty much time for training. On a typical computer with CPU of 12 cores, it takes 3 days. For better performance, we suggest that user rewrite it in C++. Model.cpp serves as a simple example.)

  3. Run after you have run and

(Please check, you will get more information about how to run other combinations of models (only support combining 2 models at once)

Data Set

hownet.txt is an Chinese knowledge base with annotated word-sense-sememe information

Evaluation Set

After you have run, you will see 'hownet.txt_test' and 'hownet.txt_answer' file under the directory. These two files make the evaluation set. The size of the evaluation set is 10% of the full size of the part of embedding_200.txt which is anotated in hownet.txt. The evaluation set is generated by random choices.

Result Files

Feel free to get insight of the files which are named after 'output_', these files contain the sememe predictions for evaluation set.

You can also use pickle library in python to load the files which are named after 'model_'. For more information, please refer to


If you use the code, please cite this paper:

Ruobing Xie, Xingchi Yuan, Zhiyuan Liu, Maosong Sun. Lexical Sememe Prediction via Word Embeddings and Matrix Factorization. The 26th International Joint Conference on Artificial Intelligence (IJCAI 2017).


Codes for Lexical Sememe Prediction via Word Embeddings and Matrix Factorization (IJCAI 2017).





No releases published


No packages published

Contributors 4