Dan Holevoet
Dan Holevoet

Reputation: 9183

The Cloud Natural Language API response for entity analysis shows entity offset of -1 no matter what text I give it. Is this the expected behavior?

I was expecting to get the offset set based on the position of the entity within the request text block, however, for all the entities identified the offset is set at -1 in the response.

Upvotes: 0

Views: 188

Answers (1)

Dan Holevoet
Dan Holevoet

Reputation: 9183

Make sure to set the encoding type in your request. When the entity type is not set in the request call, the API sets the offset to -1 in the response. For more details visit https://cloud.google.com/natural-language/reference/rest/v1beta1/EncodingType.

Upvotes: 3

Related Questions