Skip to content

[Feature]: Sentence to and from JSON serialization (or from_dict) #3281

@turian

Description

@turian

Problem statement

For serving flair Sentences over an inference API, it would be very useful to be able to serialize the Sentence to and from JSON.

Solution

Ideally, json.dumps(Sentence) should work. Or, at least, Sentence should have a to_json method and static from_json method.

Or, some simply, all relevant classes could have a from_dictstatic method, so that Sentence.from_dict(s.to_dict()) == s

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new featurewontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions