-
I am using the model for enrity and relation extraction. I adjusted the spacy model a little so that I can upload sentences in a csv file. I did some testing and notices that for some sentences I got following error in my terminal: IndexError: tuple index out of range So my question is: For the model to work do you need to preprocess input text based on the relarion you want to extract? So if I want to extract the relation between PERSON and GPE/LOC do I only need to feed sentences that contains a PERSON and a GPE/LOC? And how does the model deal with sentences where entities co-occure but do not have a relation? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Hi @AGudden!
Could you post your stack trace (and ideally the data you're using)?
While this depends on the model, I think it's safe to say it's not necessary to only feed sentences with the entity types whose relations to each other you're looking for. What I would recommend, to increase accuracy, is to provide some few-shot examples for those entity types.
This depends entirely on the used LLM, |
Beta Was this translation helpful? Give feedback.
spacy-llm==0.4.2
is out and should avoid this issue (LLM responses pointing at entity indices higher than the number of available entities are discarded).