Add iteration argument to parser.update

This commit is contained in:
Matthew Honnibal 2017-03-11 07:00:47 -06:00
parent dcce9ca3f3
commit ca9c8c57c0

View File

@ -79,7 +79,7 @@ cdef class ParserModel(AveragedPerceptron):
nr_feat = self.extracter.set_features(features, context)
return nr_feat
def update(self, Example eg):
def update(self, Example eg, itn=0):
'''Does regression on negative cost. Sort of cute?'''
self.time += 1
best = arg_max_if_gold(eg.c.scores, eg.c.costs, eg.c.nr_class)
@ -286,7 +286,7 @@ cdef class Parser:
free(eg.is_valid)
return 0
def update(self, Doc tokens, GoldParse gold):
def update(self, Doc tokens, GoldParse gold, itn=0):
"""Update the statistical model.
Arguments: