Remove unused 'preprocess' argument in Tok2Vec'

This commit is contained in:
Matthew Honnibal 2017-09-17 12:30:16 -05:00
parent 039d609362
commit 8f42f8d305

View File

@ -226,7 +226,7 @@ def drop_layer(layer, factor=2.):
return model return model
def Tok2Vec(width, embed_size, preprocess=True, pretrained_dims=0): def Tok2Vec(width, embed_size, pretrained_dims=0):
cols = [ID, NORM, PREFIX, SUFFIX, SHAPE, ORTH] cols = [ID, NORM, PREFIX, SUFFIX, SHAPE, ORTH]
with Model.define_operators({'>>': chain, '|': concatenate, '**': clone, '+': add}): with Model.define_operators({'>>': chain, '|': concatenate, '**': clone, '+': add}):
norm = HashEmbed(width, embed_size, column=cols.index(NORM), name='embed_norm') norm = HashEmbed(width, embed_size, column=cols.index(NORM), name='embed_norm')
@ -242,7 +242,7 @@ def Tok2Vec(width, embed_size, preprocess=True, pretrained_dims=0):
>> LN(Maxout(width, width*4, pieces=3)), column=5) >> LN(Maxout(width, width*4, pieces=3)), column=5)
) )
) )
if pretrained_dims: if pretrained_dims >= 1:
embed = concatenate_lists(trained_vectors, SpacyVectors) embed = concatenate_lists(trained_vectors, SpacyVectors)
else: else:
embed = trained_vectors embed = trained_vectors