Have trouble to understand alignment_mode arguments #378
Unanswered
innocent-charles
asked this question in
Q&A
Replies: 3 comments 4 replies
-
even for the "Innocent Charles is a Tanzanian, born on 22th, October 1999" . when i want to extract the day innocent was born, the LLMs give 22 when I check the logs, but the docs.ents do not provide anything. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @innocent-charles! Please
I'm not sure whether |
Beta Was this translation helpful? Give feedback.
0 replies
-
Okay, but how to run it with save_io ? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The alignment_mode argument is used to match entities as returned by the LLM to the tokens from the original Doc - specifically it’s used as argument in the call to [doc.char_span()](https://spacy.io/api/doc#char_span). The "strict" mode will only keep spans that strictly adhere to the given token boundaries. "contract" will only keep those tokens that are fully within the given range, e.g. reducing "New Y" to "New". Finally, "expand" will expand the span to the next token boundaries, e.g. expanding "New Y" out to "New York".
I have document as "Innocent Charles is a Tanzanian" and i wanted to extract the country from it.
LLMs give me country : Tanzania when i check the logs but, i dont get anything in the docs.ents output.
Why and How that ?
Beta Was this translation helpful? Give feedback.
All reactions