Code Monkey home page Code Monkey logo

Comments (14)

ForgetThatNight avatar ForgetThatNight commented on July 18, 2024 3

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()`

from crimekgassitant.

prozyworld avatar prozyworld commented on July 18, 2024

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

同问

from crimekgassitant.

ForgetThatNight avatar ForgetThatNight commented on July 18, 2024

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

同问

连长什么样子都不知道

from crimekgassitant.

Maxhyl avatar Maxhyl commented on July 18, 2024

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

from crimekgassitant.

ForgetThatNight avatar ForgetThatNight commented on July 18, 2024

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

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

from crimekgassitant.

sometimestios avatar sometimestios commented on July 18, 2024

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

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

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

from crimekgassitant.

rancho628 avatar rancho628 commented on July 18, 2024

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

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

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

from crimekgassitant.

TTTnlp avatar TTTnlp commented on July 18, 2024

有数据了吗

from crimekgassitant.

21want28k avatar 21want28k commented on July 18, 2024

有数据了吗

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

from crimekgassitant.

TTTnlp avatar TTTnlp commented on July 18, 2024

from crimekgassitant.

21want28k avatar 21want28k commented on July 18, 2024

没有。。

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 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文件的。

from crimekgassitant.

TTTnlp avatar TTTnlp commented on July 18, 2024

from crimekgassitant.

21want28k avatar 21want28k commented on July 18, 2024

我只用了加权打分的那个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。

from crimekgassitant.

TTTnlp avatar TTTnlp commented on July 18, 2024

from crimekgassitant.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.