A SAS NLP pipeline produces a named entity recognition (NER) output table where each row is an entity mention. A data engineer needs to aggregate this to the document level to count how many PERSON entities appear per document. Which SAS step accomplishes this most directly?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — b is correct because PROC SQL with WHERE entity_type='PERSON', GROUP BY doc_id, and COUNT(*) directly produces a document-level count of PERSON entity mentions. A (PROC FREQ) would produce a cross-tabulation but not a clean per-document count filtered to one entity type.
Full explanation below image
Full Explanation
B is correct because PROC SQL with WHERE entity_type='PERSON', GROUP BY doc_id, and COUNT(*) directly produces a document-level count of PERSON entity mentions. A (PROC FREQ) would produce a cross-tabulation but not a clean per-document count filtered to one entity type. C (PROC TRANSPOSE) would pivot entity types across columns, which is a different output structure. D is wrong; PROC MEANS computes numeric statistics; entity_type is character and COUNT in this context requires PROC FREQ or PROC SQL.