Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Constituency Parser Predictor and tests #914

Merged
merged 4 commits into from
Feb 22, 2018

Conversation

DeNeutoy
Copy link
Contributor

@DeNeutoy DeNeutoy commented Feb 22, 2018

This is smaller than it looks because I had to regenerate the fixtures

predictor = Predictor.from_archive(archive, 'constituency-parser')
result = predictor.predict_json(inputs)

assert len(result["spans"]) == 21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be nice to add comment why this is the expected result

assert result["sentence"] == ["What", "a", "great", "test", "sentence", "."]
assert isinstance(result["trees"], str)

for class_distribution in result["class_probabilities"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you want to add an assert for len(class_probabilities) like you have in the other test? this would pass if it were empty for some reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah thanks

@DeNeutoy DeNeutoy merged commit 740f4fb into allenai:master Feb 22, 2018
@DeNeutoy DeNeutoy deleted the constituency-demo branch February 22, 2018 22:37
gabrielStanovsky pushed a commit to gabrielStanovsky/allennlp that referenced this pull request Sep 7, 2018
* add constituency predictor, clean up some span padding in decode

* regenerate test fixtures, address some regressions

* batch test

* fix up test, docs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants