Skip to content
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
6 changes: 3 additions & 3 deletions docs/language/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ returns a :class:`~.language_v1.types.AnalyzeEntitiesResponse`.
====================
name: Michelangelo Caravaggio
type: PERSON
metadata: {'wikipedia_url': 'http://en.wikipedia.org/wiki/Caravaggio'}
metadata: {'wikipedia_url': 'https://en.wikipedia.org/wiki/Caravaggio'}
salience: 0.7615959
====================
name: Italian
type: LOCATION
metadata: {'wikipedia_url': 'http://en.wikipedia.org/wiki/Caravaggio'}
metadata: {'wikipedia_url': 'https://en.wikipedia.org/wiki/Italy'}
salience: 0.19960518
====================
name: The Calling of Saint Matthew
type: EVENT
metadata: {'wikipedia_url': 'http://en.wikipedia.org/wiki/Caravaggio'}
metadata: {'wikipedia_url': 'https://en.wikipedia.org/wiki/The_Calling_of_St_Matthew_(Caravaggio)'}
salience: 0.038798928

.. note::
Expand Down
8 changes: 4 additions & 4 deletions language/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,23 @@ def _check_analyze_entities_result(self, entities):
# Other mentions may occur, e.g. "painter".
self.assertIn(entity1.name, [str(i) for i in entity1.mentions])
self.assertEqual(entity1.metadata['wikipedia_url'],
'http://en.wikipedia.org/wiki/Caravaggio')
'https://en.wikipedia.org/wiki/Caravaggio')
self.assertIsInstance(entity1.metadata, dict)
# Verify entity 2.
self.assertEqual(entity2.name, self.NAME2)
self.assertEqual(entity2.entity_type, EntityType.LOCATION)
self.assertGreater(entity2.salience, 0.0)
self.assertEqual([str(i) for i in entity2.mentions], [entity2.name])
self.assertEqual(entity2.metadata['wikipedia_url'],
'http://en.wikipedia.org/wiki/Italy')
'https://en.wikipedia.org/wiki/Italy')
self.assertIsInstance(entity2.metadata, dict)
# Verify entity 3.
self.assertEqual(entity3.name, self.NAME3)
choices = (EntityType.EVENT, EntityType.WORK_OF_ART)
self.assertIn(entity3.entity_type, choices)
self.assertGreater(entity3.salience, 0.0)
self.assertEqual([str(i) for i in entity3.mentions], [entity3.name])
wiki_url = ('http://en.wikipedia.org/wiki/'
wiki_url = ('https://en.wikipedia.org/wiki/'
'The_Calling_of_St_Matthew_(Caravaggio)')
self.assertEqual(entity3.metadata['wikipedia_url'], wiki_url)
self.assertIsInstance(entity3.metadata, dict)
Expand Down Expand Up @@ -122,7 +122,7 @@ def test_analyze_sentiment(self):
positive_msg = 'Jogging is fun'
document = Config.CLIENT.document_from_text(positive_msg)
sentiment = document.analyze_sentiment().sentiment
self.assertEqual(sentiment.score, 0.5)
self.assertTrue(0.0 < sentiment.score < 1.0)
self.assertTrue(0.0 < sentiment.magnitude < 1.5)

def _verify_token(self, token, text_content, part_of_speech, lemma):
Expand Down