Extracting regex match group entity

For a sentence like:

list issues assigned to Kevin labeled urgent

I would like to extract two entities, one “assignment” entity with value “Kevin” and another “label” entity with value “urgent”.

I’ve been feeding the model examples like:

list [open](open_status) issues [assigned to Amy]{"entity": "assignment", "value": "Amy"} [labeled prototype]{"entity": "label", "value": "background"}

and it’s extracting the “assignment” entity as “assigned to Kevin” rather than just “Kevin”. I’m not sure whether this is a matter of not having given the model enough examples, or whether I should be using a regex – is there a way to extract match groups from the regex?

Basically I just want the model to return the object of certain “trigger” words like “assigned to” and “labeled”.

Is there a way to do this canonically?

Hi @yirenlu92. If you put the annotation around “… [assigned to Amy] …”, it will extract all of that as the entity. It sounds like you want to actually annotate it as “… assigned to [Amy] …”, so that you extract just Amy. By giving annotated training examples, your model will learn the “trigger” words are on its own. It will also generalize from the examples your provide, which you would not get trying to match using regex