X Tutup
Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Natural Language Understanding

Installation

Maven
<dependency>
  <groupId>com.ibm.watson</groupId>
  <artifactId>natural-language-understanding</artifactId>
  <version>8.6.0</version>
</dependency>
Gradle
'com.ibm.watson:natural-language-understanding:8.6.0'

Usage

Use Natural Language Understanding to analyze various features of text content at scale. Provide text, raw HTML, or a public URL, and IBM Watson Natural Language Understanding will give you results for the features you request. The service cleans HTML content before analysis by default, so the results can ignore most advertisements and other unwanted content.

Authenticator authenticator = new IamAuthenticator("<iam_api_key>");
NaturalLanguageUnderstanding service = new NaturalLanguageUnderstanding("2019-07-12", authenticator);

EntitiesOptions entities = new EntitiesOptions.Builder()
  .sentiment(true)
  .limit(1L)
  .build();
Features features = new Features.Builder()
  .entities(entities)
  .build();
AnalyzeOptions parameters = new AnalyzeOptions.Builder()
  .url("www.cnn.com")
  .features(features)
  .build();

AnalysisResults results = service.analyze(parameters).execute().getResult();
System.out.println(results);
X Tutup