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

Add json method for pack serialization/deserialization #917

Merged
merged 13 commits into from
Jan 12, 2023

Conversation

mylibrar
Copy link
Collaborator

@mylibrar mylibrar commented Jan 3, 2023

This PR is the first step towards fixing #836.

Description of changes

Serialize/deserialize pack into/from json data.

Possible influences of this PR.

Remove dependency on pickle and jsonpickle in pack deserilization/serialization.

Test Conducted

entry_data_structures_test.py
multi_pack_test.py
entry_data_structures_test.py

@mylibrar mylibrar self-assigned this Jan 3, 2023
@codecov
Copy link

codecov bot commented Jan 3, 2023

Codecov Report

Merging #917 (68e1080) into master (5f43e72) will increase coverage by 0.06%.
The diff coverage is 94.44%.

@@            Coverage Diff             @@
##           master     #917      +/-   ##
==========================================
+ Coverage   80.99%   81.06%   +0.06%     
==========================================
  Files         256      256              
  Lines       19821    19851      +30     
==========================================
+ Hits        16055    16093      +38     
+ Misses       3766     3758       -8     
Impacted Files Coverage Δ
forte/data/data_pack.py 85.00% <ø> (ø)
...atasets/wikipedia/dbpedia/dbpedia_datasets_test.py 100.00% <ø> (ø)
forte/processors/base/writers.py 68.60% <50.00%> (ø)
forte/data/base_pack.py 77.77% <92.59%> (+0.80%) ⬆️
forte/common/constants.py 100.00% <100.00%> (ø)
forte/data/container.py 80.48% <100.00%> (+4.01%) ⬆️
forte/data/multi_pack.py 83.14% <100.00%> (+0.12%) ⬆️
forte/data/ontology/top.py 79.30% <100.00%> (+0.05%) ⬆️
tests/forte/data/entry_data_structures_test.py 90.25% <100.00%> (+4.39%) ⬆️
tests/forte/data/multi_pack_test.py 97.13% <100.00%> (+0.07%) ⬆️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mylibrar mylibrar changed the title Add json method Add json method for pack serialization/deserialization Jan 3, 2023
Copy link
Member

@hunterhector hunterhector left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add something serialization example (the actual json file) in the example folder: https://github.com/asyml/forte/tree/master/examples/serialization

forte/data/base_pack.py Show resolved Hide resolved
forte/data/multi_pack.py Show resolved Hide resolved
@mylibrar mylibrar merged commit 38c96f5 into asyml:master Jan 12, 2023
@mylibrar mylibrar deleted the add-json-method branch January 12, 2023 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants