Vertex AI - Text entity extraction response format

Hello!

I would like to ask if it's possible to get the same output format from the Vertex AI entity extraction REST API as from the Google Natural Language API?

Because now in the response of Vertex AI we get only a list with the confidence scores, displayNames and the start/end offsets of the textSegments, but the entities itself are not in the json (in the NLP response there is also "content" with the entity). So this is how I would like to get the response from the Vertex AI for each entity:

{
"annotationSpecId": " ",
"displayName": "date",
"textExtraction": {
"score": 0.69745916,
"textSegment": {
"startOffset": "382",
"endOffset": "392",
"content": "12.07.2022"
}

Can you help please how I could achive this?

Thank you for your help in advance!

Zsolt

2 REPLIES 2

So if my understanding is correct you want the result to be the same as GNL while using vertex. You could read more about how to properly prepare the text you will use on the documentation that I’m providing you.

Dear Eduardo,

thank you for your reply!
No, I didn't mean the input. I already have a dataset with labels and annotations and I already trained a model, but when I make an API call with a text, the field "content" is missing in the response. I only get a list of "displayNames", "startoffsets" and "endoffsets", but I also need the field "content", where I see the entity that belongs to those "displayName", "startoffset" and "endoffset" fields.
Is it possible to get a json from the Vertex AI API that also has this "content" field?