Skip to content

Instantly share code, notes, and snippets.

@denizyuret
Last active August 29, 2015 14:13
Show Gist options
  • Save denizyuret/a4410b1c812dd515893e to your computer and use it in GitHub Desktop.
Save denizyuret/a4410b1c812dd515893e to your computer and use it in GitHub Desktop.
function partest(model, corpus)
for i=1:numel(corpus)
sentence = corpus{i};
parser = initparser(model, sentence);
while 1
valid = validmoves(parser);
if ~any(valid) break; end
x = getfeatures(parser, sentence, model);
scores = predict(model, x);
scores(~valid) = -inf;
[~,move] = max(scores);
transition(parser, move);
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment