Skip to content

Commit 7ef11c2

Browse files
Updated examples in README.md
[ci skip] Updated examples in README.md
1 parent 8c8ff52 commit 7ef11c2

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,10 @@ Example: Extract keywords from an image.
125125
AlchemyVision service = new AlchemyVision();
126126
service.setApiKey("<api_key>");
127127

128-
Map<String,Object> params = new HashMap<String, Object>();
129-
params.put(AlchemyVision.IMAGE, new File("src/test/resources/obama.jpg"));
130-
ImageKeywords keywords = service.getImageKeywords(params);
128+
File image = new File("src/test/resources/alchemy/obama.jpg");
129+
Boolean forceShowAll = false;
130+
Boolean knowledgeGraph = false;
131+
ImageKeywords keywords = service.getImageKeywords(, forceShowAll, knowledgeGraph);
131132

132133
System.out.println(keywords);
133134
```
@@ -188,7 +189,7 @@ The [Document Conversion][document_conversion] service allows to convert pdf, wo
188189
Returns the document list using the [Document Conversion][document_conversion] service.
189190

190191
```java
191-
DocumentConversion service = new DocumentConversion();
192+
DocumentConversion service = new DocumentConversion("2015-12-01");
192193
service.setUsernameAndPassword("<username>", "<password>");
193194

194195
File doc = new File("src/test/resources/document_conversion/word-document-heading-input.doc");
@@ -266,7 +267,7 @@ components (nouns, verbs, subjects, objects, etc.) by using the
266267
RelationshipExtraction service = new RelationshipExtraction();
267268
service.setUsernameAndPassword("<username>", "<password>");
268269

269-
service.setDataset(RelationshipExtractionDataset.ENGLISH_NEWS);
270+
service.setDataset(Dataset.ENGLISH_NEWS);
270271
String response = service.extract("IBM Watson Developer Cloud");
271272
System.out.println(response);
272273
```
@@ -407,7 +408,7 @@ Use the [Visual Insights][visual_insights] to get insight into the themes presen
407408
VisualInsights service = new VisualInsights();
408409
service.setUsernameAndPassword("<username>", "<password>");
409410

410-
File images = new File("src/test/resources/images.zip");
411+
File images = new File("src/test/resources/visual_insights/images.zip");
411412
Summary summary = service.getSummary(images);
412413

413414
System.out.println(summary);
@@ -423,12 +424,9 @@ following picture.
423424
VisualRecognition service = new VisualRecognition();
424425
service.setUsernameAndPassword("<username>", "<password>");
425426

426-
File image = new File("src/test/resources/car.png");
427-
428-
LabelSet labelSet = new LabelSet();
429-
labelSet.withLabelGroup("Auto Racing").withLabelGroup("Sports");
427+
File image = new File("src/test/resources/visual_recognition/car.png");
430428

431-
RecognizedImage recognizedImage = service.recognize(image, labelSet);
429+
VisualRecognitionImages recognizedImage = service.recognize(image);
432430
System.out.println(recognizedImage);
433431
```
434432

0 commit comments

Comments
 (0)