Skip to content

Commit

Permalink
fixed batch training
Browse files Browse the repository at this point in the history
  • Loading branch information
wittmamz committed Aug 9, 2015
1 parent 5f4709f commit 13d2821
Show file tree
Hide file tree
Showing 6 changed files with 39,990 additions and 2 deletions.
4 changes: 2 additions & 2 deletions named-entity-recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def train(self, file_in, file_out, max_iterations, top_x, decrease_alpha, shuffl
# batch training:
predictions = {}
for tag in classifiers:
predictions[tag] = classifiers[tag].weight_vector
predictions[tag] = [x for x in classifiers[tag].weight_vector]
print "\t\tEpoch " + str(i) + ", alpha = " + str(alpha)
path = []
normalization_constant = 10.0 ** 5.0
Expand Down Expand Up @@ -253,7 +253,7 @@ def train(self, file_in, file_out, max_iterations, top_x, decrease_alpha, shuffl
# apply batch results to weight vectors:
if batch_training:
for tag in classifiers:
classifiers[tag].weight_vector = predictions[tag]
classifiers[tag].weight_vector = [x for x in predictions[tag]]

# decrease alpha
if decrease_alpha:
Expand Down
Loading

0 comments on commit 13d2821

Please sign in to comment.