Loading...
Given a sentence and its BIO tags, extract all entity spans with their types.
Input format:
Output: Each entity on a separate line as "WORDS: TYPE". If no entities, print "No entities found".
John Smith works at New York
John Smith: PERSON New York: LOC
Step 1: Parse BIO tags John=B-PERSON, Smith=I-PERSON, works=O, at=O, New=B-LOC, York=I-LOC
Step 2: Group consecutive B+I tags Entity 1: "John Smith" → PERSON Entity 2: "New York" → LOC