mirror of https://github.com/explosion/spaCy.git
Learns things
This commit is contained in:
parent
bcf4cd0a5f
commit
04ae1c01f1
|
@ -135,10 +135,9 @@ def main(lang_name, train_loc, dev_loc, model_dir, clusters_loc=None):
|
||||||
encoder = TokenVectorEncoder(vocab)
|
encoder = TokenVectorEncoder(vocab)
|
||||||
parser = DependencyParser(vocab, actions=actions, features=features, L1=0.0)
|
parser = DependencyParser(vocab, actions=actions, features=features, L1=0.0)
|
||||||
|
|
||||||
|
|
||||||
Xs, ys = organize_data(vocab, train_sents)
|
Xs, ys = organize_data(vocab, train_sents)
|
||||||
Xs = Xs[:10]
|
Xs = Xs[:100]
|
||||||
ys = ys[:10]
|
ys = ys[:100]
|
||||||
with encoder.model.begin_training(Xs[:100], ys[:100]) as (trainer, optimizer):
|
with encoder.model.begin_training(Xs[:100], ys[:100]) as (trainer, optimizer):
|
||||||
docs = list(Xs)
|
docs = list(Xs)
|
||||||
for doc in docs:
|
for doc in docs:
|
||||||
|
|
|
@ -161,8 +161,8 @@ def build_tok2vec(lang, width, depth=2, embed_size=1000):
|
||||||
#(static | prefix | suffix | shape)
|
#(static | prefix | suffix | shape)
|
||||||
(lower | prefix | suffix | shape | tag)
|
(lower | prefix | suffix | shape | tag)
|
||||||
>> Maxout(width, width*5)
|
>> 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
|
return tok2vec
|
||||||
|
|
Loading…
Reference in New Issue