makcedward / nlp

:memo: This repository recorded my NLP journey.
https://makcedward.github.io/
1.07k stars 326 forks source link

nlp-character_embedding.ipynb #7

Open sino30535 opened 5 years ago

sino30535 commented 5 years ago

Hi, thank you for the awesome code on character embedding model, I had a lot of fun playing with it. One little suggestion on the code, in CharCNN, def build_char_dictionary, you put chars = list(set(chars)). This will mess up the chars order in char_dict. Every time I start a new notebook, the chars' order will be different, therefore result in a different dictionary. What happened to me is I tried to load my trained keras model in a new notebook and found out that the model is not working. In the end I figured out it is because of my char_indices in preprocess step in totally different than old one. I didn't save the old char_indices before so I have no choice but to retrain the model, lol.