Skip to content

Commit 4bf11b8

Browse files
committed
feat(Natural Language Understanding): Add confidence prop to EntitiesResult and EntityMention
1 parent b2da66d commit 4bf11b8

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/model/EntitiesResult.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class EntitiesResult extends GenericModel {
2424
private String type;
2525
private String text;
2626
private Double relevance;
27+
private Double confidence;
2728
private List<EntityMention> mentions;
2829
private Long count;
2930
private EmotionScores emotion;
@@ -63,6 +64,19 @@ public Double getRelevance() {
6364
return relevance;
6465
}
6566

67+
/**
68+
* Gets the confidence.
69+
*
70+
* Confidence in the entity identification from 0 to 1. Higher values indicate higher confidence. In standard entities
71+
* requests, confidence is returned only for English text. All entities requests that use custom models return the
72+
* confidence score.
73+
*
74+
* @return the confidence
75+
*/
76+
public Double getConfidence() {
77+
return confidence;
78+
}
79+
6680
/**
6781
* Gets the mentions.
6882
*

natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/model/EntityMention.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class EntityMention extends GenericModel {
2323

2424
private String text;
2525
private List<Long> location;
26+
private Double confidence;
2627

2728
/**
2829
* Gets the text.
@@ -45,4 +46,17 @@ public String getText() {
4546
public List<Long> getLocation() {
4647
return location;
4748
}
49+
50+
/**
51+
* Gets the confidence.
52+
*
53+
* Confidence in the entity identification from 0 to 1. Higher values indicate higher confidence. In standard entities
54+
* requests, confidence is returned only for English text. All entities requests that use custom models return the
55+
* confidence score.
56+
*
57+
* @return the confidence
58+
*/
59+
public Double getConfidence() {
60+
return confidence;
61+
}
4862
}

0 commit comments

Comments
 (0)