Skip to content

Commit

Permalink
Fixed a bug in minibatch_parse
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Jul 13, 2017
1 parent 163d81e commit 5ac5f9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assignment2/q2_parser_transitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ def minibatch_parse(sentences, model, batch_size):

while len(unfinished_parse) > 0:
minibatch = unfinished_parse[0:batch_size]
# perform transition and single step parser on the minibatch until it is emplty
# perform transition and single step parser on the minibatch until it is empty
while len(minibatch) > 0:
transitions = model.predict(minibatch)
for index, action in enumerate(transitions):
minibatch[index].parse_step(action)
minibatch = [parse for parse in partial_parses if len(parse.stack) > 1 or len(parse.buffer) > 0]
minibatch = [parse for parse in minibatch if len(parse.stack) > 1 or len(parse.buffer) > 0]

# move to the next batch
unfinished_parse = unfinished_parse[batch_size:]
Expand Down

0 comments on commit 5ac5f9a

Please sign in to comment.