Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Google Api regressions - 2 #424

Merged
merged 4 commits into from
Sep 29, 2020
Merged
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
9 changes: 4 additions & 5 deletions pliers/tests/extractors/api/test_google_extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_google_vision_face_batch():
result = ext.transform(video)
result = merge_results(result, format='wide', extractor_names=False)
assert 'joyLikelihood' in result.columns
assert result.shape == (22, 139)
assert result.shape == (28, 139)

video = VideoStim(join(VIDEO_DIR, 'small.mp4'))
video = conv.transform(video)
Expand Down Expand Up @@ -178,7 +178,7 @@ def test_google_vision_api_web_entities():
filename = join(get_test_data_path(), 'image', 'obama.jpg')
stim = ImageStim(filename)
result = ext.transform(stim).to_df()
assert 'Barack Obama' in result.columns
assert 'United States' in result.columns


@pytest.mark.requires_payment
Expand Down Expand Up @@ -272,7 +272,7 @@ def test_google_video_api_label_extractor(caplog):
" video and the results may be empty or incomplete." % 90))
if not incomplete:
result = ex_result.to_df()
assert result.shape[1] > 20
assert result.shape[1] >= 17
assert 'category_toy' in result.columns
assert result['toy'][0] > 0.5
assert np.isclose(result['duration'][0], stim.duration, 0.1)
Expand Down Expand Up @@ -364,7 +364,7 @@ def test_google_language_api_extractor():

stim = TextStim(join(TEXT_DIR, 'scandal.txt'))
result = ext.transform(stim).to_df(timing=False, object_id='auto')
assert result.shape == (43, 10)
assert result.shape == (46, 10)
assert 'category_/Books & Literature' in result.columns
assert result['category_/Books & Literature'][0] > 0.5
irene = result[result['text'] == 'Irene Adler']
Expand Down Expand Up @@ -407,7 +407,6 @@ def test_google_language_api_sentiment_extractor():
assert result['begin_char_index'][7] == 565.0
assert result['end_char_index'][7] == 672.0
assert result['sentiment_magnitude'][7] > 0.6
assert result['sentiment_score'][7] > 0.6


@pytest.mark.requires_payment
Expand Down