explosion / explosion/spacy-llm
Few-Shot Relationship Extraction Example Error
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
While using the [spacy_llm rel_openai](https://github.com/explosion/spacy-llm/tree/main/usage_examples/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](https://github.com/explosion/spacy-llm/blob/main/spacy_llm/tasks/rel/util.py#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](https://github.com/explosion/spacy-llm/files/15027136/few_shot_trace.txt)
[examples.json](https://github.com/explosion/spacy-llm/files/15027141/examples.json)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.