DeepKE icon indicating copy to clipboard operation
DeepKE copied to clipboard

There are empty lines in the output csv file when use src/deepke/transform_data.py

Open JJJYmmm opened this issue 3 years ago • 3 comments

when using src/deepke/transform_data.py to convert a json file to a csv file,there is some empty lines between datas.

image

one method is to change the code on line 14

with open(fp_csv, 'w', encoding='utf-8') as f2:

to

with open(fp_csv, 'w', encoding='utf-8',newline='') as f2:

JJJYmmm avatar Jun 07 '23 15:06 JJJYmmm

Can you provide the data so that we can reproduce this problem?

tlk1997 avatar Jun 08 '23 06:06 tlk1997

Could you please provide more details so we can address the problem ASAP?

zxlzr avatar Jun 11 '23 02:06 zxlzr

Sorry for replying now

When I use src/deep/transform_data.py to convert my own jsondata into csv data, I found that the final csv file had meaningless blank line breaks between each sample, although it did not affect the training of the model.

The attachment is a json file and the transform script you provided, I add a json2csv_new function in the script to remove the the blank lines between samples.

This is a very small issue that does not affect the use of deepke,perhaps I shouldn't consider it a bug

I'm sorry again for replying so late

------------------ 原始邮件 ------------------ 发件人: "zjunlp/DeepKE" @.>; 发送时间: 2023年6月11日(星期天) 上午10:44 @.>; @.@.>; 主题: Re: [zjunlp/DeepKE] There are empty lines in the output csv file when use src/deepke/transform_data.py (Issue #286)

Could you please provide more details so we can address the problem ASAP?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

JJJYmmm avatar Jun 11 '23 07:06 JJJYmmm