How to overwrite spans of Example object? #11829
Answered
by
ljvmiranda921
jamnicki
asked this question in
Help: Coding & Implementations
-
Hello! example["doc_annotation"]["spans"][spans_key] = new_span_group I encoutered following error executing above code and I have no idea of fix: TypeError: 'spacy.training.example.Example' object is not subscriptable Do I need to create new |
Beta Was this translation helpful? Give feedback.
Answered by
ljvmiranda921
Nov 22, 2022
Replies: 1 comment 1 reply
-
Hi @jamnicki , I'm curious as to why you're overwriting spans in the example.reference.spans[spans_key] = span_group |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jamnicki
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @jamnicki , I'm curious as to why you're overwriting spans in the
Example
object, are you trying to train using a custom training loop, etc.? But to answer your question, you should only update thereference
attribute of yourExample
object (Example.reference
is aDoc
).