Advertisement
Guest User

Untitled

a guest
Aug 31st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. WatsonException: Error: unsupported media type, Code: 415
  2.  
  3. from watson_developer_cloud import AlchemyLanguageV1
  4. alchemy_language = AlchemyLanguageV1(url="https://gateway.watsonplatform.net/natural-language-understanding/api",
  5. username="xxx",
  6. password="xxx")
  7. print(json.dumps(alchemy_language.sentiment(text="hehe")))
  8.  
  9. import json
  10. from watson_developer_cloud import AlchemyLanguageV1
  11.  
  12. alchemy_language = AlchemyLanguageV1(api_key='API_KEY')
  13. print(json.dumps(
  14. alchemy_language.sentiment(
  15. text='hehe'),
  16. indent=2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement