Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import settings . #store your API_USER and Password here.
- import json
- from watson_developer_cloud import NaturalLanguageUnderstandingV1
- import watson_developer_cloud.natural_language_understanding.features.v1 as Features
- natural_language_understanding = NaturalLanguageUnderstandingV1(
- username=settings.API_USER_NAME,
- password=settings.API_PASSWORD,
- version="2017-02-27")
- response = natural_language_understanding.analyze(
- text="you crap
- damn master",
- features=[
- Features.Entities(
- emotion=True,
- sentiment=True,
- limit=2
- ),
- Features.Keywords(
- emotion=True,
- sentiment=True,
- limit=2
- )
- ]
- )
- print(json.dumps(response, indent=2))
Add Comment
Please, Sign In to add comment