spacy-llm icon indicating copy to clipboard operation
spacy-llm copied to clipboard

Few-Shot Relationship Extraction Example Error

Open krmchal opened this issue 2 months ago • 0 comments

While using the spacy_llm rel_openai example I continually run into the error:

  • IndexError: [E035] Error creating span with start 9 and end -1 for Doc of length 16.

This error seems to only happen when providing the pipeline with an examples jsonl file for the few-shot learner to inference with. I tracked the issue down to spacy_llm/tasks/rel/util:L58 where the function "to_doc" appears to add the token index -1 for the end character I believe.

I do not understand why this error is occurring can someone please check in on this? I have also went ahead and attached the examples file I used as well as the stack trace of the error. The examples.json file extension was changed to json in order to upload to github. The real extension is .jsonl

few_shot_trace.txt examples.json

krmchal avatar Apr 18 '24 15:04 krmchal