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

Add test for sentiment analysis #117

Merged
merged 2 commits into from
Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added regression tests for training configs that run on a scheduled workflow.
- Added a test for the pretrained sentiment analysis model.

## [v1.1.0rc3](https:/allenai/allennlp-models/releases/tag/v1.1.0rc3) - 2020-08-12

Expand Down
5 changes: 5 additions & 0 deletions tests/pretrained_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ def test_dependency_parsing(self):
]
assert result["predicted_heads"] == [2, 0, 2, 2, 4, 2]

def test_sentiment_analysis(self):
predictor = load_predictor("roberta-sst")
result = predictor.predict_json({"sentence": "This is a positive review."})
assert result["label"] == "1"

def test_openie(self):
predictor = load_predictor("structured-prediction-srl")
result = predictor.predict_json(
Expand Down