@@ -31,6 +31,7 @@ public final class EntitySentiment {
3131 private final Double confidence ;
3232 private final Double salience ;
3333 private final Label sentiment ;
34+ private final Double linkingConfidence ;
3435
3536 /**
3637 * constructor for {@code EntitySentiment}
@@ -49,7 +50,7 @@ public EntitySentiment(String type,
4950 String entityId ,
5051 Double confidence ,
5152 Label sentiment ) {
52- this (type , mention , normalized , count , entityId , confidence , null , sentiment );
53+ this (type , mention , normalized , count , entityId , confidence , null , null , sentiment );
5354 }
5455
5556 /**
@@ -61,6 +62,7 @@ public EntitySentiment(String type,
6162 * @param entityId if the entity was linked, the ID from the knowledge base.
6263 * @param confidence entity confidence.
6364 * @param salience entity salience.
65+ * @param linkingConfidence linking confidence.
6466 * @param sentiment the sentiment information.
6567 */
6668 public EntitySentiment (String type ,
@@ -70,6 +72,7 @@ public EntitySentiment(String type,
7072 String entityId ,
7173 Double confidence ,
7274 Double salience ,
75+ Double linkingConfidence ,
7376 Label sentiment ) {
7477 this .type = type ;
7578 this .mention = mention ;
@@ -78,6 +81,7 @@ public EntitySentiment(String type,
7881 this .entityId = entityId ;
7982 this .confidence = confidence ;
8083 this .salience = salience ;
84+ this .linkingConfidence = linkingConfidence ;
8185 this .sentiment = sentiment ;
8286 }
8387
@@ -139,6 +143,14 @@ public Double getSalience() {
139143 return salience ;
140144 }
141145
146+ /**
147+ * get the linking confidence
148+ * @return the linking confidence
149+ */
150+ public Double getLinkingConfidence () {
151+ return linkingConfidence ;
152+ }
153+
142154 /**
143155 * @return the sentiment information.
144156 */
@@ -162,11 +174,12 @@ public boolean equals(Object o) {
162174 && Objects .equals (entityId , that .entityId )
163175 && Objects .equals (confidence , that .confidence )
164176 && Objects .equals (salience , that .salience )
177+ && Objects .equals (linkingConfidence , that .linkingConfidence )
165178 && Objects .equals (sentiment , that .sentiment );
166179 }
167180
168181 @ Override
169182 public int hashCode () {
170- return Objects .hash (type , mention , normalized , count , entityId , confidence , salience , sentiment );
183+ return Objects .hash (type , mention , normalized , count , entityId , confidence , salience , linkingConfidence , sentiment );
171184 }
172185}
0 commit comments