Skip to content

Commit 78dc410

Browse files
authored
Merge pull request #84046 from ashly1yeo/patch-3
Update python.md
2 parents 31328ad + 168384f commit 78dc410

File tree

1 file changed

+152
-81
lines changed
  • articles/cognitive-services/text-analytics/quickstarts

1 file changed

+152
-81
lines changed

articles/cognitive-services/text-analytics/quickstarts/python.md

Lines changed: 152 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ The sentiment score for a document is between 0.0 and 1.0, with a higher score i
183183
"score":0.334433376789093
184184
}
185185
],
186-
"errors":[
187-
188-
]
186+
"errors":[]
189187
}
190188
```
191189

@@ -262,9 +260,7 @@ pprint(key_phrases)
262260
"id":"4"
263261
}
264262
],
265-
"errors":[
266-
267-
]
263+
"errors":[]
268264
}
269265
```
270266

@@ -299,81 +295,156 @@ pprint(entities)
299295
### Output
300296

301297
```json
302-
{'documents': [{'id': '1',
303-
'entities': [{'name': 'Microsoft',
304-
'matches': [{'wikipediaScore': 0.502357972145024,
305-
'entityTypeScore': 1.0,
306-
'text': 'Microsoft',
307-
'offset': 0,
308-
'length': 9}],
309-
'wikipediaLanguage': 'en',
310-
'wikipediaId': 'Microsoft',
311-
'wikipediaUrl': 'https://en.wikipedia.org/wiki/Microsoft',
312-
'bingId': 'a093e9b9-90f5-a3d5-c4b8-5855e1b01f85',
313-
'type': 'Organization'},
314-
{'name': 'Bill Gates',
315-
'matches': [{'wikipediaScore': 0.5849375085784292,
316-
'entityTypeScore': 0.999847412109375,
317-
'text': 'Bill Gates',
318-
'offset': 25,
319-
'length': 10}],
320-
'wikipediaLanguage': 'en',
321-
'wikipediaId': 'Bill Gates',
322-
'wikipediaUrl': 'https://en.wikipedia.org/wiki/Bill_Gates',
323-
'bingId': '0d47c987-0042-5576-15e8-97af601614fa',
324-
'type': 'Person'},
325-
{'name': 'Paul Allen',
326-
'matches': [{'wikipediaScore': 0.5314163053043621,
327-
'entityTypeScore': 0.9988409876823425,
328-
'text': 'Paul Allen',
329-
'offset': 40,
330-
'length': 10}],
331-
'wikipediaLanguage': 'en',
332-
'wikipediaId': 'Paul Allen',
333-
'wikipediaUrl': 'https://en.wikipedia.org/wiki/Paul_Allen',
334-
'bingId': 'df2c4376-9923-6a54-893f-2ee5a5badbc7',
335-
'type': 'Person'},
336-
{'name': 'April 4',
337-
'matches': [{'wikipediaScore': 0.37312706493069636,
338-
'entityTypeScore': 0.8,
339-
'text': 'April 4',
340-
'offset': 54,
341-
'length': 7}],
342-
'wikipediaLanguage': 'en',
343-
'wikipediaId': 'April 4',
344-
'wikipediaUrl': 'https://en.wikipedia.org/wiki/April_4',
345-
'bingId': '52535f87-235e-b513-54fe-c03e4233ac6e',
346-
'type': 'Other'},
347-
{'name': 'April 4, 1975',
348-
'matches': [{'entityTypeScore': 0.8,
349-
'text': 'April 4, 1975',
350-
'offset': 54,
351-
'length': 13}],
352-
'type': 'DateTime',
353-
'subType': 'Date'},
354-
{'name': 'BASIC',
355-
'matches': [{'wikipediaScore': 0.35916049097766867,
356-
'entityTypeScore': 0.8,
357-
'text': 'BASIC',
358-
'offset': 89,
359-
'length': 5}],
360-
'wikipediaLanguage': 'en',
361-
'wikipediaId': 'BASIC',
362-
'wikipediaUrl': 'https://en.wikipedia.org/wiki/BASIC',
363-
'bingId': '5b16443d-501c-58f3-352e-611bbe75aa6e',
364-
'type': 'Other'},
365-
{'name': 'Altair 8800',
366-
'matches': [{'wikipediaScore': 0.8697256853652899,
367-
'entityTypeScore': 0.8,
368-
'text': 'Altair 8800',
369-
'offset': 116,
370-
'length': 11}],
371-
'wikipediaLanguage': 'en',
372-
'wikipediaId': 'Altair 8800',
373-
'wikipediaUrl': 'https://en.wikipedia.org/wiki/Altair_8800',
374-
'bingId': '7216c654-3779-68a2-c7b7-12ff3dad5606',
375-
'type': 'Other'}]}],
376-
'errors': []}
298+
{
299+
"documents" : [
300+
{
301+
"id" : "1",
302+
"entities" : [
303+
{
304+
"name" : "Microsoft",
305+
"matches" : [
306+
{
307+
"wikipediaScore" : 0.49897989655674446,
308+
"entityTypeScore" : 1.0,
309+
"text" : "Microsoft",
310+
"offset" : 0,
311+
"length" : 9
312+
}
313+
],
314+
"wikipediaLanguage" : "en",
315+
"wikipediaId" : "Microsoft",
316+
"wikipediaUrl" : "https://en.wikipedia.org/wiki/Microsoft",
317+
"bingId" : "a093e9b9-90f5-a3d5-c4b8-5855e1b01f85",
318+
"type" : "Organization"
319+
},
320+
{
321+
"name" : "Bill Gates",
322+
"matches" : [
323+
{
324+
"wikipediaScore" : 0.58357497243368983,
325+
"entityTypeScore" : 0.999847412109375,
326+
"text" : "Bill Gates",
327+
"offset" : 25,
328+
"length" : 10
329+
}
330+
],
331+
"wikipediaLanguage" : "en",
332+
"wikipediaId" : "Bill Gates",
333+
"wikipediaUrl" : "https://en.wikipedia.org/wiki/Bill_Gates",
334+
"bingId" : "0d47c987-0042-5576-15e8-97af601614fa",
335+
"type" : "Person"
336+
},
337+
{
338+
"name" : "Paul Allen",
339+
"matches" : [
340+
{
341+
"wikipediaScore" : 0.52977533244176866,
342+
"entityTypeScore" : 0.99884098768234253,
343+
"text" : "Paul Allen",
344+
"offset" : 40,
345+
"length" : 10
346+
}
347+
],
348+
"wikipediaLanguage" : "en",
349+
"wikipediaId" : "Paul Allen",
350+
"wikipediaUrl" : "https://en.wikipedia.org/wiki/Paul_Allen",
351+
"bingId" : "df2c4376-9923-6a54-893f-2ee5a5badbc7",
352+
"type" : "Person"
353+
},
354+
{
355+
"name" : "April 4",
356+
"matches" : [
357+
{
358+
"wikipediaScore" : 0.37220990924571939,
359+
"entityTypeScore" : 0.8,
360+
"text" : "April 4",
361+
"offset" : 54,
362+
"length" : 7
363+
}
364+
],
365+
"wikipediaLanguage" : "en",
366+
"wikipediaId" : "April 4",
367+
"wikipediaUrl" : "https://en.wikipedia.org/wiki/April_4",
368+
"bingId" : "52535f87-235e-b513-54fe-c03e4233ac6e",
369+
"type" : "Other"
370+
},
371+
{
372+
"name" : "April 4, 1975",
373+
"matches" : [
374+
{
375+
"entityTypeScore" : 0.8,
376+
"text" : "April 4, 1975",
377+
"offset" : 54,
378+
"length" : 13
379+
}
380+
],
381+
"type" : "DateTime",
382+
"subType" : "Date"
383+
},
384+
{
385+
"name" : "BASIC",
386+
"matches" : [
387+
{
388+
"wikipediaScore" : 0.35686239324548041,
389+
"entityTypeScore" : 0.8,
390+
"text" : "BASIC",
391+
"offset" : 89,
392+
"length" : 5
393+
}
394+
],
395+
"wikipediaLanguage" : "en",
396+
"wikipediaId" : "BASIC",
397+
"wikipediaUrl" : "https://en.wikipedia.org/wiki/BASIC",
398+
"bingId" : "5b16443d-501c-58f3-352e-611bbe75aa6e",
399+
"type" : "Other"
400+
},
401+
{
402+
"name" : "Altair 8800",
403+
"matches" : [
404+
{
405+
"wikipediaScore" : 0.868324676465041,
406+
"entityTypeScore" : 0.8,
407+
"text" : "Altair 8800",
408+
"offset" : 116,
409+
"length" : 11
410+
}
411+
],
412+
"wikipediaLanguage" : "en",
413+
"wikipediaId" : "Altair 8800",
414+
"wikipediaUrl" : "https://en.wikipedia.org/wiki/Altair_8800",
415+
"bingId" : "7216c654-3779-68a2-c7b7-12ff3dad5606",
416+
"type" : "Other"
417+
},
418+
{
419+
"name" : "Altair",
420+
"matches" : [
421+
{
422+
"entityTypeScore" : 0.52505272626876831,
423+
"text" : "Altair",
424+
"offset" : 116,
425+
"length" : 6
426+
}
427+
],
428+
"type" : "Organization"
429+
},
430+
{
431+
"name" : "8800",
432+
"matches" : [
433+
{
434+
"entityTypeScore" : 0.8,
435+
"text" : "8800",
436+
"offset" : 123,
437+
"length" : 4
438+
}
439+
],
440+
"type" : "Quantity",
441+
"subType" : "Number"
442+
}
443+
]
444+
}
445+
],
446+
"errors" : []
447+
}
377448
```
378449

379450
## Next steps

0 commit comments

Comments
 (0)