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.

base_model.py 434 B

1234567891011121314151617181920
  1. class BaseModel(object):
  2. """base model for all models"""
  3. def __init__(self):
  4. pass
  5. def prepare_input(self, data):
  6. raise NotImplementedError
  7. def mode(self, test=False):
  8. raise NotImplementedError
  9. def data_forward(self, x):
  10. raise NotImplementedError
  11. def grad_backward(self):
  12. raise NotImplementedError
  13. def loss(self, pred, truth):
  14. raise NotImplementedError

一款轻量级的自然语言处理(NLP)工具包,目标是减少用户项目中的工程型代码,例如数据处理循环、训练循环、多卡运行等