Guest User

Untitled

a guest
Dec 13th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import json
  2. from watson_developer_cloud import NaturalLanguageUnderstandingV1
  3. import watson_developer_cloud.natural_language_understanding.features.v1 as \
  4. Features
  5.  
  6.  
  7. natural_language_understanding = NaturalLanguageUnderstandingV1(
  8. version='2017-02-27',
  9. username="Your username",
  10. password="Your password")
  11.  
  12. response = natural_language_understanding.analyze(
  13. text='Bruce Banner is the Hulk and Bruce Wayne is BATMAN! '
  14. 'Superman fears not Banner, but Wayne.',
  15. features=[Features.Entities(), Features.Keywords()])
  16.  
  17. print(json.dumps(response, indent=2))
Add Comment
Please, Sign In to add comment