Skip to content

Commit f87a849

Browse files
[concept-expansion] Removed label requirement
1 parent 211ac07 commit f87a849

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

examples/java/com/ibm/watson/developer_cloud/concept_expansion/v1/ConceptExpansionExample.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ public static void main(String[] args) {
2323
service.setUsernameAndPassword("<username>", "<password>");
2424

2525
String[] seeds = new String[] {"nyc", "dc", "london", "big cities"};
26-
String label = "demo";
2726

28-
Job job = service.createJob(label, seeds);
27+
Job job = service.createJob(seeds);
2928

3029
while (service.getJobStatus(job) == Job.Status.AWAITING_WORK
3130
|| service.getJobStatus(job) == Job.Status.IN_FLIGHT) {

src/main/java/com/ibm/watson/developer_cloud/concept_expansion/v1/ConceptExpansion.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ public ConceptExpansion() {
6767
setDataset(Dataset.MT_SAMPLES);
6868
}
6969

70+
/**
71+
* Creates a {@link Job}.
72+
*
73+
* @param seeds List of terms to be used as seeds
74+
*
75+
* @return the {@link Job}
76+
*/
77+
public Job createJob(final String[] seeds) {
78+
return createJob(null, seeds);
79+
}
80+
7081
/**
7182
* Creates a {@link Job}.
7283
*
@@ -76,7 +87,6 @@ public ConceptExpansion() {
7687
* @return the {@link Job}
7788
*/
7889
public Job createJob(final String label, final String[] seeds) {
79-
Validate.notEmpty(label, "label cannot be null or empty");
8090
Validate.notEmpty(seeds, "seeds cannot be null or empty");
8191
Validate.notNull(dataset, "dataset cannot be null");
8292

0 commit comments

Comments
 (0)