Git Product home page Git Product logo

kgqa-for-chatbot's Introduction

基于知识图谱的智能音箱通用知识问答系统

1 项目环境

  1. ubuntu18.04

    安装方法见网上安装教程

  2. python3.5

    安装anaconda即可

  3. jena

    安装见网上安装教程,jena和Virtuoso只是一个载体,后面使用都是通过调用SPARQL Endpoint Server的接口而已。

2 使用方式

1 数据和python环境准备

  1. 启动jena

    进入jena目录, 执行以下命令
    ./fuseki-server
  2. 知识图谱导入

    打开 http://localhost:3030/index.html,页面如下

    1560262174466

    点击manage datasets,再点击页面中的add new dataset,如下,选择TDB2把数据保存到磁盘中,输入知识图谱的名字,这里为car,与代码中配置的SPARQL Endpoint Server对应即可。

    1560262307113点击creat dataset后调到existing datasets,选择upload data后选择知识图谱数据文件car_data/kg/car.ttl后电upload now即可。

    1560262643340

    因为选择保存到磁盘,所以数据导入一次即可,不用每次启动都导入。

  3. python环境

    # 执行
    pip install -r requirements.txt

2 启动

  1. 交互式启动

    # 执行
    python3.5 chat.py
  2. api形式

    # 执行
    python3.5 server.py
    

    用get方法请求api http://localhost:10000/chat 即可

    其中参数

    • user_id

      用户id

    • question

      问题

    样例如下

    http://localhost:10000/chat?user_id=2&question=**的人口有多少

kgqa-for-chatbot's People

Contributors

lulumengyi avatar

Stargazers

 avatar

Watchers

 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.