This project uses Java SDK provided by Watson Developer Cloud services to solve complex problems
Watson on the IBM Cloud allows you to integrate the world's most powerful AI into your application and store, train and manage your data in the most secure cloud..
Some of the IBM Watson Services
- Conversation
- Dialog
- Discovery
- Language Translator
- Natural Language Understanding
- Personality Insights
- Visual Recognition
Watson Conversation is used wherever it is required to add conversational capability to the apps to engage with end-users on their platforms of choice
static Conversation service;
//provide the workspaceid
String workspaceId;
public ConversationService(String username, String password, String workspaceId) {
service = new Conversation(Conversation.VERSION_DATE_2017_05_26, username, password);
this.workspaceId = workspaceId;
}
public List<String> getResponse(String text) {
// Conversation
MessageOptions newMessageOptions = new MessageOptions.Builder().workspaceId(workspaceId)
.input(new InputData.Builder(text).build()).build();
MessageResponse response = service.message(newMessageOptions).execute();
return response.getOutput().getText();
}
The reponse from the conversation service is based on the configured intents,entities and dialog.
Response from Watson:[Welcome to Customer service., How can I help you?]
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.
//extracts the keywords from the text
public List<KeywordsResult> detectKeywords(String text) {
KeywordsOptions keywords = new KeywordsOptions.Builder().build();
Features features = new Features.Builder().keywords(keywords).build();
AnalyzeOptions parameters = new AnalyzeOptions.Builder().text(text).features(features).build();
AnalysisResults response = service.analyze(parameters).execute();
List<KeywordsResult> keywordsResult = response.getKeywords();
return keywordsResult;
}
This a sample output for keywords of a text. The relevance number shows how much the keyword is relevant to the text.
Keywords [{
"relevance": 0.99942,
"text": "investigator David Ferrucci"
}, {
"relevance": 0.758179,
"text": "question answering"
}, {
"relevance": 0.435151,
"text": "natural language"
},
The Watson Language Translator service provides domain-specific translation between languages.
Supported Languages: English, Arabic, French, German, Italian, Japanese, Portuguese, Korean, and Spanish
Language: English
Watson is a question answering computer system capable of answering questions posed in natural language
developed in IBM's DeepQA project by a research team led by principal investigator David Ferrucci.
Language: German
Watson ist eine Frage beantwortet Computersystem kann der Beantwortung von Anfragen in natürlicher Sprache gestellt entwickelte DeepQA der IBM von einem Forschungsteam von Hauptprüfer David Ferrucci geführt
- Java SDK to use the IBM Watson service
- IBM Cloud docs