Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/process_scitsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ def main():
structure_filepaths = [os.path.join(data_directory, "train", "structure", elem) for elem in train_structure_files]
structure_filepaths += [os.path.join(data_directory, "test", "structure", elem) for elem in test_structure_files]

with open(os.path.join(data_directory, "train", "structure", structure_filepaths[1]), 'r') as infile:
with open(structure_filepaths[1], 'r') as infile:
data = json.load(infile)

splits_by_filepath = dict()
Expand Down Expand Up @@ -1454,7 +1454,7 @@ def main():
split = splits_by_filepath[structure_filepath]

try:
with open(os.path.join(data_directory, "train", "structure", structure_filepath), 'r') as infile:
with open(structure_filepath, 'r') as infile:
data = json.load(infile)
data['cells'] = sorted(sorted(data['cells'], key=lambda x: x['start_col']), key=lambda x: x['start_row'])
table_dict = create_table_dict(data)
Expand Down Expand Up @@ -1908,4 +1908,4 @@ def main():
del doc # Just removes from memory, not from disk

if __name__ == "__main__":
main()
main()