1

I'm using this API and the DetectEntities method. It's recognizing the text and its type correctly, but I need it to be able to split the name as necessary.

There are two fields in the form:

img1

The documentation doesn't seem to have anything regarding this. When sent to the backend, I need it to properly parse into XML, for example:

<name>
    <surname>Doe</surname>
    <given-names>John</given-names>
    <suffix>III</suffix>
</name>.

I'm using the API as,

$response = $GLOBALS['ComprehendClient']->detectEntities([
    'LanguageCode' => 'en',
    'Text' => 'John Doe Jr'
]);
dd($response);
die();

It dds with:

img3

Which is obviously not what I need. It will always recognize the name, but there is no way to predict how I'd need to split the string in the future.

I really like this API, and I haven't really found anything else that's even close to accomplishing to what I need. Maybe it's just simply impossible with this one. It'd be easier to just add a third column Suffix and just circumvent it that way.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Mike K
  • 7,621
  • 14
  • 60
  • 120

0 Answers0