Keras Text Preprocessing - Saving Tokenizer object to file for scoring

后端 未结 4 1128
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 03:59

I\'ve trained a sentiment classifier model using Keras library by following the below steps(broadly).

  1. Convert Text corpus into sequences using Tokenizer object
4条回答
  •  余生分开走
    2020-12-01 04:53

    I've created the issue https://github.com/keras-team/keras/issues/9289 in the keras Repo. Until the API is changed, the issue has a link to a gist that has code to demonstrate how to save and restore a tokenizer without having the original documents the tokenizer was fit on. I prefer to store all my model information in a JSON file (because reasons, but mainly mixed JS/Python environment), and this will allow for that, even with sort_keys=True

提交回复
热议问题