Skip to content

Commit 515fec5

Browse files
Katsuya-TomiokaLi Xu
authored andcommitted
Tej 1058 sentiment (#112)
* [maven-release-plugin] prepare release rosette-api-java-binding-1.8.1 * [maven-release-plugin] prepare for next development iteration * TEJ-1058: added linking confidence in EntitySentiment.
1 parent 7764259 commit 515fec5

File tree

10 files changed

+38
-9
lines changed

10 files changed

+38
-9
lines changed

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.basistech.rosette</groupId>
2121
<artifactId>rosette-api-java-binding</artifactId>
22-
<version>1.8.1-SNAPSHOT</version>
22+
<version>1.8.2-SNAPSHOT</version>
2323
</parent>
2424
<artifactId>rosette-api</artifactId>
2525
<name>rosette-api</name>

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.basistech.rosette</groupId>
2121
<artifactId>rosette-api-java-binding</artifactId>
22-
<version>1.8.1-SNAPSHOT</version>
22+
<version>1.8.2-SNAPSHOT</version>
2323
</parent>
2424
<artifactId>rosette-api-common</artifactId>
2525
<name>rosette-api-common</name>

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>com.basistech.rosette</groupId>
2222
<artifactId>rosette-api-java-binding</artifactId>
23-
<version>1.8.1-SNAPSHOT</version>
23+
<version>1.8.2-SNAPSHOT</version>
2424
</parent>
2525
<groupId>com.basistech.rosette</groupId>
2626
<artifactId>rosette-api-examples</artifactId>

json/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>com.basistech.rosette</groupId>
2222
<artifactId>rosette-api-java-binding</artifactId>
23-
<version>1.8.1-SNAPSHOT</version>
23+
<version>1.8.2-SNAPSHOT</version>
2424
</parent>
2525
<artifactId>rosette-api-json</artifactId>
2626
<name>rosette-api-json</name>

json/src/main/java/com/basistech/rosette/apimodel/jackson/EntitySentimentMixin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public EntitySentimentMixin(
3232
@JsonProperty("count") Integer count,
3333
@JsonProperty("entityId") String entityId,
3434
@JsonProperty("confidence") Double confidence,
35+
@JsonProperty("salience") Double salience,
36+
@JsonProperty("linkingConfidence") Double linkingConfidence,
3537
@JsonProperty("sentiment") Label sentiment) {
3638
//
3739
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"entities": [
3+
{
4+
"count": 17,
5+
"mention": "Samsung",
6+
"normalized": "Samsung",
7+
"type": "ORGANIZATION",
8+
"salience": 1.0,
9+
"confidence": 1.0,
10+
"linkingConfidence": 1.0,
11+
"sentiment": {"label": "neutral", "confidence": 1.0}
12+
}
13+
]
14+
}

model/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.basistech.rosette</groupId>
2121
<artifactId>rosette-api-java-binding</artifactId>
22-
<version>1.8.1-SNAPSHOT</version>
22+
<version>1.8.2-SNAPSHOT</version>
2323
</parent>
2424
<artifactId>rosette-api-model</artifactId>
2525
<name>rosette-api-model</name>

model/src/main/java/com/basistech/rosette/apimodel/EntitySentiment.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<modelVersion>4.0.0</modelVersion>
1919
<groupId>com.basistech.rosette</groupId>
2020
<artifactId>rosette-api-java-binding</artifactId>
21-
<version>1.8.1-SNAPSHOT</version>
21+
<version>1.8.2-SNAPSHOT</version>
2222
<parent>
2323
<artifactId>open-source-parent</artifactId>
2424
<groupId>com.basistech</groupId>

release/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<groupId>com.basistech.rosette</groupId>
2121
<artifactId>rosette-api-java-binding</artifactId>
22-
<version>1.8.1-SNAPSHOT</version>
22+
<version>1.8.2-SNAPSHOT</version>
2323
</parent>
2424
<groupId>com.basistech.rosette</groupId>
2525
<artifactId>rosette-api-release</artifactId>

0 commit comments

Comments
 (0)