chest-xray / data.py
tungedng2710's picture
Commit of my dataset
518bc37
raw
history blame contribute delete
335 Bytes
import pandas as pd
import json
metadata_df = pd.read_csv("metadata.csv")
print(metadata_df.head())
json_dict = metadata_df.to_dict(orient='records')
with open('metadata.jsonl', 'w') as f:
for entry in json_dict:
# Convert each dictionary to a JSON string and write to the file
f.write(json.dumps(entry) + '\n')