Learns things

This commit is contained in:
Matthew Honnibal 2017-05-06 18:21:02 +02:00
parent bcf4cd0a5f
commit 04ae1c01f1
2 changed files with 4 additions and 5 deletions

View File

@ -135,10 +135,9 @@ def main(lang_name, train_loc, dev_loc, model_dir, clusters_loc=None):
encoder = TokenVectorEncoder(vocab)
parser = DependencyParser(vocab, actions=actions, features=features, L1=0.0)
Xs, ys = organize_data(vocab, train_sents)
Xs = Xs[:10]
ys = ys[:10]
Xs = Xs[:100]
ys = ys[:100]
with encoder.model.begin_training(Xs[:100], ys[:100]) as (trainer, optimizer):
docs = list(Xs)
for doc in docs:

View File

@ -161,8 +161,8 @@ def build_tok2vec(lang, width, depth=2, embed_size=1000):
#(static | prefix | suffix | shape)
(lower | prefix | suffix | shape | tag)
>> Maxout(width, width*5)
>> (ExtractWindow(nW=1) >> Maxout(width, width*3))
>> (ExtractWindow(nW=1) >> Maxout(width, width*3))
#>> (ExtractWindow(nW=1) >> Maxout(width, width*3))
#>> (ExtractWindow(nW=1) >> Maxout(width, width*3))
)
)
return tok2vec