public class RelationshipExtraction extends WatsonService
VERSION| Constructor and Description | 
|---|
| RelationshipExtraction()Instantiates a new relationship extraction service. | 
| Modifier and Type | Method and Description | 
|---|---|
| String | extract(String text)Extracts relationships between sentence components (nouns, verbs, subjects, objects, etc.)
 
  Here is an example of how to extract sentence components: | 
| Dataset | getDataset()Gets the dataset. | 
| void | setDataset(Dataset dataset)Sets the dataset. | 
| void | setReturnType(ReturnType returnType)Sets the returnType. | 
configureHttpClient, execute, executeRequest, executeWithoutResponse, getApiKey, getEndPoint, getName, getToken, setApiKey, setAuthentication, setDefaultHeaders, setEndPoint, setUsernameAndPassword, toStringpublic RelationshipExtraction()
public String extract(String text)
 RelationshipExtraction service = new RelationshipExtraction();
 service.setUsernameAndPassword("<username>", "<password>");
 
 service.setDataset(Dataset.ENGLISH_NEWS);
 String response = service.extract("IBM Watson developer cloud");
 
 System.out.println(response);
 text - the text to analyzepublic Dataset getDataset()
public void setDataset(Dataset dataset)
dataset - the new datasetpublic void setReturnType(ReturnType returnType)
returnType - the new returnTypeCopyright © 2015–2016. All rights reserved.