In [4]:
import sys
import os
sys.path.append(os.path.join(os.getcwd(),'..'))
import watson_developer_cloud
import watson_developer_cloud.natural_language_understanding.features.v1 as features

In [3]:
nlu = watson_developer_cloud.NaturalLanguageUnderstandingV1(version='2017-02-27',
                                                            username='USERNAME',
                                                            password='PASSWORD')

In [6]:
nlu.analyze(text='this is my experimental text.  Bruce Banner is the Hulk and Bruce Wayne is BATMAN! Superman fears not Banner, but Wayne.',
            features=[features.Entities(), features.Keywords()])


Out[6]:
{'entities': [{'count': 3,
   'relevance': 0.915411,
   'text': 'Bruce Banner',
   'type': 'Person'},
  {'count': 1, 'relevance': 0.296395, 'text': 'Wayne', 'type': 'Person'}],
 'keywords': [{'relevance': 0.984789, 'text': 'Bruce Banner'},
  {'relevance': 0.958833, 'text': 'Bruce Wayne'},
  {'relevance': 0.853322, 'text': 'experimental text'},
  {'relevance': 0.627454, 'text': 'Hulk'},
  {'relevance': 0.619956, 'text': 'Superman'},
  {'relevance': 0.583188, 'text': 'BATMAN'}],
 'language': 'en'}

In [ ]: