You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 915 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # PyTorch-Character-Aware-Neural-Language-Model
  2. This is the PyTorch implementation of character-aware neural language model proposed in this [paper](https://arxiv.org/abs/1508.06615) by Yoon Kim.
  3. ## Requiredments
  4. The code is run and tested with **Python 3.5.2** and **PyTorch 0.3.1**.
  5. ## HyperParameters
  6. | HyperParam | value |
  7. | ------ | :-------|
  8. | LSTM batch size | 20 |
  9. | LSTM sequence length | 35 |
  10. | LSTM hidden units | 300 |
  11. | epochs | 35 |
  12. | initial learning rate | 1.0 |
  13. | character embedding dimension | 15 |
  14. ## Demo
  15. Train the model with split train/valid/test data.
  16. `python train.py`
  17. The trained model will saved in `cache/net.pkl`.
  18. Test the model.
  19. `python test.py`
  20. Best result on test set:
  21. PPl=127.2163
  22. cross entropy loss=4.8459
  23. ## Acknowledgement
  24. This implementation borrowed ideas from
  25. https://github.com/jarfo/kchar
  26. https://github.com/cronos123/Character-Aware-Neural-Language-Models