eeqa icon indicating copy to clipboard operation
eeqa copied to clipboard

convert_example.py

Open humoxian opened this issue 3 years ago • 5 comments

When I try to run convert_example.py (in .proc/) as the proc/README says,it always generate the error: json.decoder.JSONDecodeError:Expecting property name enclosed in double quotes:line 2 column 1(char 2) Could anyone tell me why this happened?And how to solve this problem?Thanks!

humoxian avatar Nov 20 '21 02:11 humoxian

I'm facing the same problem as you. How did you solve it?

Yonghao-Li avatar May 05 '22 06:05 Yonghao-Li

这样改:

------------------ 原始邮件 ------------------ 发件人: "xinyadu/eeqa" @.>; 发送时间: 2022年5月5日(星期四) 下午2:46 @.>; @.@.>; 主题: Re: [xinyadu/eeqa] convert_example.py (Issue #14)

I'm facing the same problem as you. How did you solve it?

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

humoxian avatar May 05 '22 12:05 humoxian

Please refer to these images on how to fix the JSONDecodeError. If you can't see the attached images, then simply change the Line 749 of parse_ace_event.py from g.write(json.dumps(js, default=int, indent = 4) + "\n") to g.write(json.dumps(js, default=int, indent = None) + "\n").

Best regards.

------------------ 原始邮件 ------------------ 发件人: "xinyadu/eeqa" @.>; 发送时间: 2022年5月6日(星期五) 上午9:50 @.>; @.@.>; 主题: Re: [xinyadu/eeqa] convert_example.py (Issue #14)

I'm sorry to bother you,too. I didn't receive your specific operation.I think my description is inaccurate。

Traceback (most recent call last): &nbsp; File "scripts/data/ace-event/convert_examples.py", line 10, in <module&gt; &nbsp; &nbsp; line = json.loads(line) &nbsp; File "/root/miniconda3/lib/python3.7/json/init.py", line 348, in loads &nbsp; &nbsp; return _default_decoder.decode(s) &nbsp; File "/root/miniconda3/lib/python3.7/json/decoder.py", line 337, in decode &nbsp; &nbsp; obj, end = self.raw_decode(s, idx=_w(s, 0).end()) &nbsp; File "/root/miniconda3/lib/python3.7/json/decoder.py", line 353, in raw_decode &nbsp; &nbsp; obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 1 (char 2)

I face the same JSONDecoderError as you did at the beginning. I hope your answer can help me。 Best wishes。 ------------------ 原始邮件 ------------------ 发件人: "xinyadu/eeqa" @.&gt;; 发送时间:&nbsp;2022年5月5日(星期四) 晚上8:37 @.&gt;; @.@.&gt;; 主题:&nbsp;Re: [xinyadu/eeqa] convert_example.py (Issue #14)

这样改:

------------------&amp;nbsp;原始邮件&amp;nbsp;------------------
发件人: "xinyadu/eeqa" @.&amp;gt;;
发送时间:&amp;nbsp;2022年5月5日(星期四) 下午2:46
@.
&amp;gt;;
@.@.&amp;gt;;
主题:&amp;nbsp;Re: [xinyadu/eeqa] convert_example.py (Issue #14)

I'm facing the same problem as you. How did you solve it?


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

humoxian avatar May 06 '22 02:05 humoxian

OMG! I'm facing the same problem as you. How did you solve it?

myhcjwds avatar Jul 04 '22 09:07 myhcjwds

Please refer to these images on how to fix the JSONDecodeError. If you can't see the attached images, then simply change the Line 749 of parse_ace_event.py from g.write(json.dumps(js, default=int, indent = 4) + "\n") to g.write(json.dumps(js, default=int, indent = None) + "\n"). Best regards. ------------------ 原始邮件 ------------------ 发件人: "xinyadu/eeqa" @.>; 发送时间: 2022年5月6日(星期五) 上午9:50 @.>; @.@.>; 主题: Re: [xinyadu/eeqa] convert_example.py (Issue #14) I'm sorry to bother you,too. I didn't receive your specific operation.I think my description is inaccurate。 Traceback (most recent call last): &nbsp; File "scripts/data/ace-event/convert_examples.py", line 10, in <module&gt; &nbsp; &nbsp; line = json.loads(line) &nbsp; File "/root/miniconda3/lib/python3.7/json/init.py", line 348, in loads &nbsp; &nbsp; return _default_decoder.decode(s) &nbsp; File "/root/miniconda3/lib/python3.7/json/decoder.py", line 337, in decode &nbsp; &nbsp; obj, end = self.raw_decode(s, idx=_w(s, 0).end()) &nbsp; File "/root/miniconda3/lib/python3.7/json/decoder.py", line 353, in raw_decode &nbsp; &nbsp; obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 1 (char 2) I face the same JSONDecoderError as you did at the beginning. I hope your answer can help me。 Best wishes。 ------------------ 原始邮件 ------------------ 发件人: "xinyadu/eeqa" @.&gt;; 发送时间:&nbsp;2022年5月5日(星期四) 晚上8:37 @.&gt;; @.@.&gt;; 主题:&nbsp;Re: [xinyadu/eeqa] convert_example.py (Issue #14) 这样改: ------------------&amp;nbsp;原始邮件&amp;nbsp;------------------ 发件人: "xinyadu/eeqa" @.&amp;gt;; 发送时间:&amp;nbsp;2022年5月5日(星期四) 下午2:46 @.&amp;gt;; @.@.&amp;gt;; 主题:&amp;nbsp;Re: [xinyadu/eeqa] convert_example.py (Issue #14) I'm facing the same problem as you. How did you solve it? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.&amp;gt; — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.&gt; — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

I have solved it, thanks for your sharing!

myhcjwds avatar Jul 04 '22 09:07 myhcjwds