Last active
August 29, 2015 14:13
-
-
Save denizyuret/a4410b1c812dd515893e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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