mycroft adapt研究

来源:互联网 发布:智盟软件电话 编辑:程序博客网 时间:2024/06/11 19:11

Adapt islicensed under the GNU Lesser General Public License version 3.0

 

The Adapt IntentParser is an open source software library for converting natural language intomachine readable data structures

Adapt is a rulesbased artificial intelligence library that is useful for interpreting naturallanguage input. For example, a user might want to create a natural languageinterface that allows them to play a Pandora station. The user might say"Turn on Pandora", or "Play Pandora", or "Put on myJoan Jett Pandora station." The Adapt engine would take this input andfeed the application a JSON data structure similar to:

{

    "confidence": 0.61,

    "target": null,

    "Artist": "joan jett",

    "intent_type":"MusicIntent",

    "MusicVerb": "put on",

    "MusicKeyword": "pandora"

}

The applicationwould then be designed to parse the JSON and play Joan Jett on using the opensource Pandora application "Pianobar"

 

GIT:

https://github.com/mycroftai/adapt

 

windows上安装例子:

1 下载adapt-master.zip

2 解压adapt-master.zip

3 pythonsetup.py install

 

验证安装是否成功,跑下测试例子:

pythonexamples/multi_intent_parser.py "play some music by the clash"


参考例子:

single_intent_parser.py

 

必须导入的模块:

import json

import sys

fromadapt.intent import IntentBuilder

fromadapt.engine import IntentDeterminationEngine