The detailed implementation please see the additional PPT.
- PyTorch 0.2
- tqdm
- matplotlib
- Java >= 8 (for Stanford CoreNLP utilities)
- Python >= 2.7
First, run the script ./fetch_and_preprocess.sh
to download Stanford Parser and Stanford POS Tagger, and generates dependency parses of the Xianer dataset using this Dependency Parser.
Second, go to src
directory and run python main_xianer.py
to train and test the xianer model, and have a look at config.py
for command-line arguments. The predict result is in the 'data' directiry, and attention visualization result is in the 'img' directiry.
- PyTorch 0.1x don't support Biliear Network, and need to modify some built-in functions.
- Pretrained Chinese word embedding file can find in 'xxx/embedding/huge.readable' in xxx.
- Add 'xxx/anaconda2/bin' to the PATH in xxx can run our project properly.
Riddhiman Dasgupta for the pyTorch implementation of the tree-lstm. Kai Sheng Tai for the original LuaTorch implementation, and to the Pytorch team for the fun library.