def _validate(self, dev_dataset):
    self._model.eval()
    dev_score_list = []
    dev_iter = lm_tool.get_iterator(dev_dataset, batch_size=DEFAULT_CONFIG['batch_size'], bptt_len=DEFAULT_CONFIG['bptt_len'])
    for dev_item in tqdm(dev_iter):
        item_score = lm_tool.get_score(self._model, dev_item.text, dev_item.target)
        dev_score_list.append(item_score)
    return (sum(dev_score_list) / len(dev_score_list))
def _validate(self, dev_dataset):
    self._model.eval()
    dev_score_list = []
    dev_iter = lm_tool.get_iterator(dev_dataset, batch_size=DEFAULT_CONFIG['batch_size'], bptt_len=DEFAULT_CONFIG['bptt_len'])
    for dev_item in tqdm(dev_iter):
        item_score = lm_tool.get_score(self._model, dev_item.text, dev_item.target)
        dev_score_list.append(item_score)
    return (sum(dev_score_list) / len(dev_score_list))