NER output from amazon sagemaker endpoint

0

I have successfully deployed sagemaker endpoint for huggingface NER model https://huggingface.co/Universal-NER/UniNER-7B-all

Now as I'm trying to use it.

import boto3
import json
ENDPOINT_NAME = "ner-2023-09-14-11-39-34"
runtime= boto3.client('runtime.sagemaker')
payload = {"inputs": "My name is Wolfgang and I live in Berlin"}
body_data = json.dumps(payload).encode('utf-8')
response = runtime.invoke_endpoint(EndpointName=ENDPOINT_NAME,
                                       ContentType='application/json',
                                       Body=body_data)
result = json.loads(response['Body'].read().decode())
print(result)
[{'generated_text': 'My name is Wolfgang and I live in Berlin. I am 27 years old and I am a student. I am studying at the University'}

]

As you can see the generated_text just completes the sentence. I was expecting the NER model will identify the person and place in the input text. Is there any way to get the expected output ? like Wolfgang = Person, Berlin = Place

munna
gefragt vor 8 Monaten55 Aufrufe
Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen