Skip to content

Instantly share code, notes, and snippets.

@NesrineSF
Created March 31, 2021 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NesrineSF/575165fc9c3bf14d9532bd5a1ccb25f3 to your computer and use it in GitHub Desktop.
Save NesrineSF/575165fc9c3bf14d9532bd5a1ccb25f3 to your computer and use it in GitHub Desktop.
request of the API for both sentences
#first sentence
object_noun = "The object of this exercise is to raise money for the charity."
#second sentence
object_verb = "A lot of people will object to the book."
language = 'en'
#Request to the API for the first sentence
output = client.specific_resource_analysis(
body={"document": {"text": object_noun}},
params={'language': language, 'resource': 'disambiguation'
})
#Request to the API for the second sentence
output_2 = client.specific_resource_analysis(
body={"document": {"text": object_verb}},
params={'language': language, 'resource': 'disambiguation'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment