Skip to content

Instantly share code, notes, and snippets.

@tomdavidson
Created May 4, 2022 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomdavidson/bb49301cb22a182f1e3e85a917191dc6 to your computer and use it in GitHub Desktop.
Save tomdavidson/bb49301cb22a182f1e3e85a917191dc6 to your computer and use it in GitHub Desktop.
gcp analyze-entities example
$ gcloud ml language analyze-entities --content="Adt Security Systems bankruptcy dept 1501 Yamato Rd. Boca Raton, FL 33431"
{
"entities": [
{
"mentions": [
{
"text": {
"beginOffset": 21,
"content": "bankruptcy dept"
},
"type": "COMMON"
}
],
"metadata": {},
"name": "bankruptcy dept",
"salience": 0.3556909,
"type": "OTHER"
},
{
"mentions": [
{
"text": {
"beginOffset": 0,
"content": "Adt Security Systems"
},
"type": "PROPER"
}
],
"metadata": {},
"name": "Adt Security Systems",
"salience": 0.31495017,
"type": "ORGANIZATION"
},
{
"mentions": [
{
"text": {
"beginOffset": 42,
"content": "Yamato Rd"
},
"type": "PROPER"
}
],
"metadata": {
"mid": "/g/11bc659_w9"
},
"name": "Yamato Rd",
"salience": 0.2202551,
"type": "LOCATION"
},
{
"mentions": [
{
"text": {
"beginOffset": 65,
"content": "FL"
},
"type": "PROPER"
}
],
"metadata": {
"mid": "/m/02xry",
"wikipedia_url": "https://de.wikipedia.org/wiki/Florida"
},
"name": "FL",
"salience": 0.075629845,
"type": "LOCATION"
},
{
"mentions": [
{
"text": {
"beginOffset": 53,
"content": "Boca Raton"
},
"type": "PROPER"
}
],
"metadata": {
"mid": "/m/0c5v2",
"wikipedia_url": "https://de.wikipedia.org/wiki/Boca_Raton"
},
"name": "Boca Raton",
"salience": 0.033473987,
"type": "LOCATION"
},
{
"mentions": [
{
"text": {
"beginOffset": 37,
"content": "1501 Yamato Rd. Boca Raton, FL 33431"
},
"type": "TYPE_UNKNOWN"
}
],
"metadata": {
"broad_region": "Florida",
"country": "US",
"locality": "Boca Raton",
"narrow_region": "Palm Beach County",
"postal_code": "33431",
"street_name": "Yamato Road",
"street_number": "1501"
},
"name": "1501 Yamato Rd. Boca Raton, FL 33431",
"salience": 0.0,
"type": "ADDRESS"
},
{
"mentions": [
{
"text": {
"beginOffset": 37,
"content": "1501"
},
"type": "TYPE_UNKNOWN"
}
],
"metadata": {
"value": "1501"
},
"name": "1501",
"salience": 0.0,
"type": "NUMBER"
},
{
"mentions": [
{
"text": {
"beginOffset": 68,
"content": "33431"
},
"type": "TYPE_UNKNOWN"
}
],
"metadata": {
"value": "33431"
},
"name": "33431",
"salience": 0.0,
"type": "NUMBER"
}
],
"language": "en"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment