Skip to content

Commit

Permalink
Widening the salience range for natural language system tests.
Browse files Browse the repository at this point in the history
Fixes googleapis#2274. However, the test will likely remain flaky
if the output is a moving target.
  • Loading branch information
dhermes committed Sep 9, 2016
1 parent 52c5872 commit 1b81d0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions system_tests/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ def _check_analyze_entities_result(self, entities):
# Verify entity 1.
self.assertEqual(entity1.name, self.NAME1)
self.assertEqual(entity1.entity_type, EntityType.PERSON)
self.assertTrue(0.7 < entity1.salience < 0.8)
# NOTE: As of Sept. 8, 2016, entity1.salience == 0.81992269
self.assertTrue(0.6 < entity1.salience < 1.0)
self.assertEqual(entity1.mentions, [entity1.name])
self.assertEqual(entity1.wikipedia_url,
'http://en.wikipedia.org/wiki/Caravaggio')
self.assertEqual(entity1.metadata, {})
# Verify entity 2.
self.assertEqual(entity2.name, self.NAME2)
self.assertEqual(entity2.entity_type, EntityType.LOCATION)
self.assertTrue(0.15 < entity2.salience < 0.25)
# NOTE: As of Sept. 8, 2016, entity2.salience == 0.14427181
self.assertTrue(0.0 < entity2.salience < 0.4)
self.assertEqual(entity2.mentions, [entity2.name])
self.assertEqual(entity2.wikipedia_url,
'http://en.wikipedia.org/wiki/Italy')
Expand Down

0 comments on commit 1b81d0e

Please sign in to comment.