-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spans to doc.to_json #10073
Add spans to doc.to_json #10073
Conversation
This opens a can of worms related to whatever we're calling the "JSON format" and options for serializing docs to JSON. What are the intended uses of
but it's not the same format that can be loaded by
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I agree with Adriane's concerns about "the JSON format", I think that's an issue we'll have to address more properly in a separate discussion/PR. Given that we currently do already have doc.to_json
and that we won't be removing this in a next release, we might as well make it support spans.
Good work on also including an appropriate unit test, @thomashacker !
I had a few more small comments, cf below.
Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
Description
This
PR
adds spans todoc.to_json
.It is saved as a
dict
withSpanGroup
names as keys andlist[Span]
as values.The stored spans contain:
start
,end
,label
, andkb_id
Types of change
New feature to existing function
Checklist