Issue when running relation extraction using spacy and LLM #12814
-
When trying to use the spacy API for LLN I get following error: OSError: [E053] Could not read meta.json from config.toml What am I doing wrong? I created the rel_examples.jsonl file with following content:: {"text": "Laura bought a house in Boston with her husband Mark.", "ents": [{"start_char": 0, "end_char": 5, "label": "PERSON"}, {"start_char": 24, "end_char": 30, "label": "GPE"}, {"start_char": 48, "end_char": 52, "label": "PERSON"}], "relations": [{"dep": 0, "dest": 1, "relation": "LivesIn"}, {"dep": 2, "dest": 1, "relation": "LivesIn"}]} I created a config.toml file with content below: [components.llm.task] [components.llm.task.examples] In my jupyter notebook I have following code: s.environ['OPENAI_API_KEY'] = "KEY" import spacy When running the code I get the error mentioned above. I would appriciate any help. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi! It'll be easier if you follow the usage example over at https://github.com/explosion/spacy-llm/tree/main/usage_examples/rel_openai.
Let us know if you run into issues with that! |
Beta Was this translation helpful? Give feedback.
Hi! It'll be easier if you follow the usage example over at https://github.com/explosion/spacy-llm/tree/main/usage_examples/rel_openai.
.cfg
file and needs to be expanded to cover all subsections that spaCy needs. cf for example https://github.com/explosion/spacy-llm/blob/main/usage_examples/rel_openai/fewshot.cfgnlp
pipeline from the config withspacy-llm
, you can use ourspacy_llm.util.assemble
utility:nlp = assemble(config_path)
. cf example code in https://github.com/explosion/spacy-llm/blob/main/usage_examples/rel_openai/run_pipeline.pyLet us know if you run into issues with that!