Skip to content
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

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

Open
turian opened this issue Jul 12, 2023 · 2 comments
Open

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

turian opened this issue Jul 12, 2023 · 2 comments
Labels
feature A new feature

Comments

@turian
Copy link

turian commented Jul 12, 2023

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

@turian turian added the feature A new feature label Jul 12, 2023
@turian turian changed the title [Feature]: Sentence to and from JSON serialization [Feature]: Sentence to and from JSON serialization (or from_dict) Jul 13, 2023
@amithadiraju1694
Copy link

Can contribute if this is still open LMK, @turian .

@turian
Copy link
Author

turian commented Jan 12, 2025

@amithadiraju1694 I still believe this would be a useful feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants