def __init__(self, source,
source_dict,
batch_size=128,
maxlen=100,
minlen=0,
n_words_source=-1):
if source.endswith('.gz'):
self.source = gzip.open(source, 'r')
else:
self.source = open(source, 'r')
self.source_dict = {'1': 1, '0': 0, 0: 3}
self.batch_size = batch_size
self.maxlen = maxlen
self.minlen = 10
self.n_words_source = n_words_source
self.end_of_data = False
char_data_iterator.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录