@@ -34,7 +34,7 @@ Create a Maven project in your preferred IDE or development environment. Then ad
34
34
<dependency >
35
35
<groupId >com.azure</groupId >
36
36
<artifactId >azure-ai-textanalytics</artifactId >
37
- <version >1.0.0-beta.4 </version >
37
+ <version >1.0.0-beta.5 </version >
38
38
</dependency >
39
39
</dependencies >
40
40
```
@@ -97,7 +97,7 @@ Create a method to instantiate the `TextAnalyticsClient` object with the key and
97
97
``` java
98
98
static TextAnalyticsClient authenticateClient(String key, String endpoint) {
99
99
return new TextAnalyticsClientBuilder ()
100
- .apiKey (new AzureKeyCredential (key))
100
+ .credential (new AzureKeyCredential (key))
101
101
.endpoint(endpoint)
102
102
.buildClient();
103
103
}
@@ -130,8 +130,8 @@ static void sentimentAnalysisExample(TextAnalyticsClient client)
130
130
sentenceSentiment. getConfidenceScores(). getPositive(),
131
131
sentenceSentiment. getConfidenceScores(). getNeutral(),
132
132
sentenceSentiment. getConfidenceScores(). getNegative());
133
+ }
133
134
}
134
- }
135
135
```
136
136
137
137
### Output
@@ -159,7 +159,7 @@ static void detectLanguageExample(TextAnalyticsClient client)
159
159
System . out. printf(" Detected primary language: %s, ISO 6391 name: %s, score: %.2f.%n" ,
160
160
detectedLanguage. getName(),
161
161
detectedLanguage. getIso6391Name(),
162
- detectedLanguage. getScore ());
162
+ detectedLanguage. getConfidenceScore ());
163
163
}
164
164
```
165
165
@@ -171,7 +171,7 @@ Detected primary language: French, ISO 6391 name: fr, score: 1.00.
171
171
## Named Entity recognition (NER)
172
172
173
173
> [ !NOTE]
174
- > In version ` 3.0-preview ` :
174
+ > In version ` 3.0 ` :
175
175
> * NER includes separate methods for detecting personal information.
176
176
> * Entity linking is a separate request than NER.
177
177
@@ -188,7 +188,7 @@ static void recognizeEntitiesExample(TextAnalyticsClient client)
188
188
" Recognized entity: %s, entity category: %s, entity sub-category: %s, score: %s.%n" ,
189
189
entity. getText(),
190
190
entity. getCategory(),
191
- entity. getSubCategory (),
191
+ entity. getSubcategory (),
192
192
entity. getConfidenceScore());
193
193
}
194
194
}
@@ -197,7 +197,8 @@ static void recognizeEntitiesExample(TextAnalyticsClient client)
197
197
### Output
198
198
199
199
``` console
200
- Recognized entity: Seattle, entity category: Location, entity sub-category: GPE, score: 0.92.
200
+ Recognized entity: trip, entity category: Event, entity sub-category: null, score: 0.61.
201
+ Recognized entity: Seattle, entity category: Location, entity sub-category: GPE, score: 0.82.
201
202
Recognized entity: last week, entity category: DateTime, entity sub-category: DateRange, score: 0.8.
202
203
```
203
204
@@ -210,23 +211,23 @@ static void recognizeLinkedEntitiesExample(TextAnalyticsClient client)
210
211
{
211
212
// The text that need be analyzed.
212
213
String text = " Microsoft was founded by Bill Gates and Paul Allen on April 4, 1975, " +
213
- " to develop and sell BASIC interpreters for the Altair 8800. " +
214
- " During his career at Microsoft, Gates held the positions of chairman, " +
215
- " chief executive officer, president and chief software architect, " +
216
- " while also being the largest individual shareholder until May 2014." ;
214
+ " to develop and sell BASIC interpreters for the Altair 8800. " +
215
+ " During his career at Microsoft, Gates held the positions of chairman, " +
216
+ " chief executive officer, president and chief software architect, " +
217
+ " while also being the largest individual shareholder until May 2014." ;
217
218
218
219
System . out. printf(" Linked Entities:%n" );
219
220
for (LinkedEntity linkedEntity : client. recognizeLinkedEntities(text)) {
220
221
System . out. printf(" Name: %s, ID: %s, URL: %s, Data Source: %s.%n" ,
221
- linkedEntity. getName(),
222
- linkedEntity. getDataSourceEntityId(),
223
- linkedEntity. getUrl(),
224
- linkedEntity. getDataSource());
222
+ linkedEntity. getName(),
223
+ linkedEntity. getDataSourceEntityId(),
224
+ linkedEntity. getUrl(),
225
+ linkedEntity. getDataSource());
225
226
System . out. printf(" Matches:%n" );
226
- for (LinkedEntityMatch linkedEntityMatch : linkedEntity. getLinkedEntityMatches ()) {
227
+ for (LinkedEntityMatch linkedEntityMatch : linkedEntity. getMatches ()) {
227
228
System . out. printf(" Text: %s, Score: %.2f%n" ,
228
- linkedEntityMatch. getText(),
229
- linkedEntityMatch. getConfidenceScore());
229
+ linkedEntityMatch. getText(),
230
+ linkedEntityMatch. getConfidenceScore());
230
231
}
231
232
}
232
233
}
@@ -238,24 +239,24 @@ static void recognizeLinkedEntitiesExample(TextAnalyticsClient client)
238
239
Linked Entities:
239
240
Name: Altair 8800, ID: Altair 8800, URL: https://en.wikipedia.org/wiki/Altair_8800, Data Source: Wikipedia.
240
241
Matches:
241
- Text: Altair 8800, Score: 0.78
242
+ Text: Altair 8800, Score: 0.88
242
243
Name: Bill Gates, ID: Bill Gates, URL: https://en.wikipedia.org/wiki/Bill_Gates, Data Source: Wikipedia.
243
244
Matches:
244
- Text: Bill Gates, Score: 0.55
245
- Text: Gates, Score: 0.55
245
+ Text: Bill Gates, Score: 0.63
246
+ Text: Gates, Score: 0.63
246
247
Name: Paul Allen, ID: Paul Allen, URL: https://en.wikipedia.org/wiki/Paul_Allen, Data Source: Wikipedia.
247
248
Matches:
248
- Text: Paul Allen, Score: 0.53
249
+ Text: Paul Allen, Score: 0.60
249
250
Name: Microsoft, ID: Microsoft, URL: https://en.wikipedia.org/wiki/Microsoft, Data Source: Wikipedia.
250
251
Matches:
251
- Text: Microsoft, Score: 0.47
252
- Text: Microsoft, Score: 0.47
252
+ Text: Microsoft, Score: 0.55
253
+ Text: Microsoft, Score: 0.55
253
254
Name: April 4, ID: April 4, URL: https://en.wikipedia.org/wiki/April_4, Data Source: Wikipedia.
254
255
Matches:
255
- Text: April 4, Score: 0.25
256
+ Text: April 4, Score: 0.32
256
257
Name: BASIC, ID: BASIC, URL: https://en.wikipedia.org/wiki/BASIC, Data Source: Wikipedia.
257
258
Matches:
258
- Text: BASIC, Score: 0.28
259
+ Text: BASIC, Score: 0.33
259
260
```
260
261
## Key phrase extraction
261
262
0 commit comments