CrimeKgAssitant icon indicating copy to clipboard operation
CrimeKgAssitant copied to clipboard

请问能告诉下 question_train.txt是怎么来的吗?思路也行

Open ForgetThatNight opened this issue 4 years ago • 14 comments

cur = '/'.join(os.path.abspath(file).split('/')[:-1]) self.train_file = os.path.join(cur, 'question_train.txt') 就是这个文件找不到

ForgetThatNight avatar Mar 06 '20 03:03 ForgetThatNight

cur = '/'.join(os.path.abspath(file).split('/')[:-1]) self.train_file = os.path.join(cur, 'question_train.txt') 就是这个文件找不到

同问

prozyworld avatar Mar 09 '20 06:03 prozyworld

cur = '/'.join(os.path.abspath(file).split('/')[:-1]) self.train_file = os.path.join(cur, 'question_train.txt') 就是这个文件找不到

同问

连长什么样子都不知道

ForgetThatNight avatar May 28 '20 09:05 ForgetThatNight

从数据处理那里就可以看到数据格式啊,很明显就是文本对应标签

Maxhyl avatar Jun 01 '20 08:06 Maxhyl

从数据处理那里就可以看到数据格式啊,很明显就是文本对应标签

连蒙带猜的已经解决了,从json文件读取数据猜写进去的格式弄好了

ForgetThatNight avatar Jun 03 '20 03:06 ForgetThatNight

从数据处理那里就可以看到数据格式啊,很明显就是文本对应标签

连蒙带猜的已经解决了,从json文件读取数据猜写进去的格式弄好了

@ForgetThatNight 请问您可以分享处理json文件的代码吗?

sometimestios avatar Mar 25 '21 02:03 sometimestios

从数据处理那里就可以看到数据格式啊,很明显就是文本对应标签

连蒙带猜的已经解决了,从json文件读取数据猜写进去的格式弄好了

+1,请问是从qa_corpus.json读取吗,求代码好人一生平安

rancho628 avatar Mar 25 '21 04:03 rancho628

有数据了吗

TTTnlp avatar Apr 22 '22 05:04 TTTnlp

有数据了吗

兄弟,你拿到那个文件的数据了吗?

21want28k avatar Sep 12 '22 07:09 21want28k

没有。。

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午3:46 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11)

有数据了吗

兄弟,你拿到那个文件的数据了吗?

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

TTTnlp avatar Sep 12 '22 09:09 TTTnlp

没有。。 ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午3:46 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11) 有数据了吗 兄弟,你拿到那个文件的数据了吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

这个项目你怎么用的,我看训练的过程里面,缺挺多txt文件的。

21want28k avatar Sep 12 '22 09:09 21want28k

我只用了加权打分的那个TXT(之前评论里面作者发出来了),其他要的我都没有抓数据

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午5:16 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11)

没有。。 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午3:46 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11) 有数据了吗 兄弟,你拿到那个文件的数据了吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

这个项目你怎么用的,我看训练的过程里面,缺挺多txt文件的。

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

TTTnlp avatar Sep 12 '22 09:09 TTTnlp

我只用了加权打分的那个TXT(之前评论里面作者发出来了),其他要的我都没有抓数据 ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午5:16 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11) 没有。。 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午3:46 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11) 有数据了吗 兄弟,你拿到那个文件的数据了吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> 这个项目你怎么用的,我看训练的过程里面,缺挺多txt文件的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

可以加你一个联系吗?我是小白,不是很懂,我感觉少了挺多txt。

21want28k avatar Sep 12 '22 09:09 21want28k

1210934084  QQ

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午5:19 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11)

我只用了加权打分的那个TXT(之前评论里面作者发出来了),其他要的我都没有抓数据 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午5:16 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11) 没有。。 … ------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2022年9月12日(星期一) 下午3:46 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [liuhuanyong/CrimeKgAssitant] 请问能告诉下 question_train.txt是怎么来的吗?思路也行 (#11) 有数据了吗 兄弟,你拿到那个文件的数据了吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> 这个项目你怎么用的,我看训练的过程里面,缺挺多txt文件的。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

可以加你一个联系吗?我是小白,不是很懂,我感觉少了挺多txt。

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

TTTnlp avatar Oct 11 '22 07:10 TTTnlp

qa_corpus.json

`import numpy as np from tqdm import tqdm import pandas as pd

def build_qa_corpus(): source_path = "/home/lc/Python/recommendersystem/rasa_resource/CrimeKgAssitant/data/qa_corpus.json" json = pd.read_json(source_path, lines=True) print(json.shape) print(json.info()) json.head()

label_dict = {
    "婚姻家庭": 0,
    "劳动纠纷": 1,
    "交通事故": 2,
    "债权债务": 3,
    "刑事辩护": 4,
    "合同纠纷": 5,
    "房产纠纷": 6,
    "侵权": 7,
    "公司法": 8,
    "医疗纠纷": 9,
    "拆迁安置": 10,
    "行政诉讼": 11,
    "建设工程": 12
}

content_path = "/home/lc/Python/recommendersystem/rasa_resource/CrimeKgAssitant/data/question_train.txt"
file = open(content_path, "w")

for i in tqdm(range(len(json))):
    question = json.iloc[i]['question']
    category = json.iloc[i]['category']
    file.write(question.strip() + "\t" + str(label_dict[category.strip()]))
    file.write("\n")

file.close()

if name == 'main': build_qa_corpus()`

ForgetThatNight avatar Nov 09 '22 09:11 ForgetThatNight