The Metadata Field

Part of the GCP Natural Language processor family

This page pertains to information returned from the AnalyzeEntitiesWithSentiment, AnalyzeEntities, and AnnotateText processors.

GCP's Natural Language API returns a set of data pertaining to an entity called metadata. The structure of this data is specific to the entity type it belongs to. The following are the structures of the metadata field based on the type of entity.

It should be noted that many of these fields may or may not be present, depending on if the API has detected them in your input or not.

Address (ADDRESS)

Field Name

Data Type

Description

street_number

string

The street number

locality

string

The city or town

street_name

string

The street/route name

postal_code

string

The postal code

country

string

The country

broad_region

string

Administrative area (such as a state or province)

narrow_region

string

Small administrative area (such as counties)

sublocality

string

Used primarily in Asian address to denote a district within a city

Date (DATE)

Field Name

Data Type

Description

month

string

The month of the date

year

string

The year of the date

day

string

The numerical day (not "Tuesday" or "Thursday") of the date

Price (PRICE)

Field Name

Data Type

Description

value

string

The amount of money

currency

string

The currency involved

Phone Number (PHONE_NUMBER)

Field Name

Data Type

Description

number

string

The phone number, formatted per local convention

national_prefix

string

The country code

area_code

string

The region/area code

extension

string

The phone extension (to be dialed after connection)

Last updated