Giter Site home page Giter Site logo

gamebotprevue's Introduction

Gamebot

用 Vue.js 编写的一个用来演示 NLU(自然语言理解) 能力 和 游戏库查询功能的 Demo。

代码写的很烂,请求链条是在两个 HTTP 异步回调里完成的。鉴于我自己也不是专业的前端,也没写过 Vue.js,嗯,等以后知道了规范的写法之后,再考虑优化吧。目前注意力主要集中在两个后端服务的改造上。

Demo

下面这两个后端服务在我另外两个 Git Project 上,可以通过 docker 部署在本机自测,或者部署到 K8s 平台上(计划)。

NLU 和 游戏库 两个后端服务的格式:

# API for NLU
Request: HTTP GET http://localhost:5005/parse?q=搜索任天堂出的射击游戏
Response:
{
  "intent": {
    "name": "game_recommend",
    "confidence": 0.4798265664356213
  },
  "entities": [
    {
      "entity": "company",
      "value": "任天堂",
      "start": 2,
      "end": 5,
      "confidence": null,
      "extractor": "ner_mitie"
    },
    {
      "entity": "type",
      "value": "射击",
      "start": 7,
      "end": 9,
      "confidence": null,
      "extractor": "ner_mitie"
    }
  ],
  "text": "搜索任天堂出的射击游戏"
}

# API for GameSet Query
Request: HTTP POST http://127.0.0.1:5010/gamesearch
Request Body: 
{
  "query": {
    "name": "塞尔达",
    "company": "任天堂",
    "score": 9.5,
    "platform": "switch"
  }
}
Response:s
{
    "games": [
        {
            "name": "塞尔达传说:旷野之息",
            "nickname": "The Legend of Zelda:Breath of the Wild",
            "score": 9.7,
            "pop": 9715,
            "date": "2017-03-03",
            "company": "任天堂",
            "platform": "['WiiU', 'switch']",
            "url": "https://www.vgtime.com/game/805.jhtml",
            "img": "https://img01.vgtime.com/photo/web/160616170441201.jpg"
        }
    ]
}

食用方法

# install dependencies
npm install

npm i basic-vue-chat

npm install sass-loader node-sass --save-dev

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

gamebotprevue's People

Contributors

yicongcao 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.