The following supports the demo of the IBM Watson NLU service given as part of the O'Reilly webcast: Using natural language processing to build applications in the enterprise
From the IBM Watson NLU site: "Natural Language Understanding enables advanced text analysis through natural language processing. The service analyzes unstructured text to extract metadata such as entities, general concepts, keywords, categories, relations, sentiment, and emotion. With custom annotation models developed using Watson Knowledge Studio, you can further customize the service to identify domain-specific entities and relations in your content."
Getting started:
- Create a free IBM Cloud (formerly Bluemix) account here: https://ibm.biz/BdjVVX
- From the Dashboard, click on the blue "Create+" button
- From the sidebar, select Watson, and then "Natural Language Understanding"
- Select the "Lite" plan (gives 30,000 NLU items per month for free) and click "Create"
- Copy your credentials
For the following curl requests, we'll use this initial sentence -- "I drove my friend Mary to the park in my Tesla while listening to music on my iPhone."
curl --user "61100b1a-64ad-482a-be61-018a86a3cca3":"l67YmgA2uQC1" \
"https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2017-02-27&text=I%20drove%20my%20friend%20Mary%20to%20the%20park%20in%20my%20Tesla%20while%20listening%20to%20music%20on%20my%20iPhone.&features=entities"
curl --user "61100b1a-64ad-482a-be61-018a86a3cca3":"l67YmgA2uQC1" "https://gateway.watsonplatform.net/natural-language-unerstanding/api/v1/analyze?version=2017-02-27&text=I%20drove%20my%20friend%20Mary%20to%20the%20park%20in%20my%20Tesla%20while%20listening%20to%20music%20on%20my%20iPhone.&features=entities,sentiment,emotion"
curl --user "61100b1a-64ad-482a-be61-018a86a3cca3":"l67YmgA2uQC1" \
"https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2017-02-27&text=I%20drove%20my%20friend%20Mary%20to%20the%20park%20in%20my%20Tesla%20while%20listening%20to%20music%20on%20my%20iPhone.&features=entities,sentiment,emotion,keywords"
curl --user "61100b1a-64ad-482a-be61-018a86a3cca3":"l67YmgA2uQC1" \
"https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2017-02-27&text=I%20drove%20my%20friend%20Mary%20to%20the%20park%20in%20my%20Tesla%20while%20listening%20to%20music%20on%20my%20iPhone.&features=entities,sentiment,emotion,keywords,relations,semantic_roles"
New sentence text -- "I drove my mean and angry friend Mary to the park in my Tesla while listening to music on my iPhone."
curl --user "61100b1a-64ad-482a-be61-018a86a3cca3":"l67YmgA2uQC1" "https://gateway.watsonplatform.net/natural-language-understanding/api/v1/analyze?version=2017-02-27&text=I%20drove%20my%20mean%20and%20angry%20friend%20Mary%20to%20the%20park%20in%20my%20Tesla%20while%20listening%20to%20music%20on%20my%20iPhone.&features=entities,sentiment,emotion"
Free chapter preview on NLP from new book: Getting Started with Artificial Intelligence