Git Product home page Git Product logo

kgqa's Introduction

KGQA

基于知识图谱的智慧城市主题智能问答系统,包含意图识别与类知识库送入LLM方法

py2neo疑似寄了,封装了一套自己用到的的Neo4j操作

实体识别直接AC自动机暴力,听说有库也懒得调了,直接和gpt一起手搓几十行解决,最后还要去掉名称有包含关系的实体,也是二重循环暴力了。也可以用结巴分词后再一一匹配,隔壁wenda的接口用的这个方法

意图识别调用torchtext自带的xmlroberta进行训练,本质文本分类,训练集为自编的智慧城市下的若干公共服务场景的用户问题,对实体和语气词进行预处理,使用EDA_NLP_for_Chinese进行数据增强。自己改了EDA源码,取消了近义词和插入,因为自己造数据集的时候已经搞得差不多了,而且实体预处理后的占位单词不能转变为近义词

LLM使用RWKV,借鉴了wenda的prompt,对用户问题中找到的所有实体,查询其在知识图谱中的所有相关知识送入LLM prompt中,让LLM自己提取。在这种已知图谱形状,自己做了知识翻译的情况下,使用3B小模型跑fp16i8,就能达到很好的效果

RWKV用的API见我的另一仓库,知识图谱调用的wenda接口同样上传

kgqa's People

Contributors

qingquanlingyu avatar

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.