Skip to content

[BUG] PIIEntities response missing some response fields in RecognizePii.java #7056

Description

@tasharm-0412

Expected :

		// The text that need be analysed.
        String text = "My SSN is 555-55-5555";
        
        RecognizePiiEntitiesResult recognizePiiEntitiesResult = client.recognizePiiEntities(text);

        for (NamedEntity entity : recognizePiiEntitiesResult.getNamedEntities()) {
            System.out.printf(
                "Recognized PII Entity Text: %s, Type: %s, Subtype: %s, Offset: %s, Length: %s, Score: %s.%n",
                entity.getText(),
                entity.getType(),
                entity.getSubtype() == null || entity.getSubtype().isEmpty() ? "N/A" : entity.getSubtype(),
                entity.getOffset(),
                entity.getLength(),
                entity.getScore());
        }

Actual :
// The text that need be analysed.
String text = "My SSN is 555-55-5555";

    for (NamedEntity entity : client.recognizePiiEntities(text).getNamedEntities()) {
        System.out.printf(
            "Recognized PII Entity: %s, Entity Type: %s, Entity Subtype: %s, Offset: %s, Length: %s, Score: %s.%n",
            entity.getText(),
            entity.getType(),
            entity.getSubtype(),
            entity.getScore());
    }

should add the remaining fields.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Cognitive - Text Analytics

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions