生成nlu引擎训练数据集的微型dsl

pychatl的Python项目详细描述


安装

PIP

$ pip install pychatl

来源

$ git clone https://github.com/atlassistant/chatl.git
$ cd chatl/python
$ python setup.py install

$ pip install -e .

用法

从终端

usage: pychatl [-h][--version][-a ADAPTER][-m MERGE][--pretty]
             files [files ...]

Generates training dataset from a simple DSL.

positional arguments:
  files                 One or more DSL files to process

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -a ADAPTER, --adapter ADAPTER
                        Name of the adapter to use
  -m MERGE, --merge MERGE
                        Options file to merge with the final result
  --pretty              Pretty output

从代码

frompychatlimportparseresult=parse("""
%[get_forecast]
  will it rain in @[city] @[dateStart]

~[new york]
  ny
  nyc

@[dateStart](type=snips/datetime)
  at the end of the day
  tomorrow
  today

@[city]
  ~[new york]
  paris
""")# Now you got a parsed dataset so you may want to process it for a specific NLU enginesfrompychatl.adaptersimportsnipssnips_dataset=snips(result)# Or give options with `snips(result, language='en')`# And now you got your dataset ready to be fitted within snips-nlu!

测试

$ pip install -e .[test]
$ python -m nose --with-doctest --with-coverage --cover-package=pychatl

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将日期字符串解析为整数变量?   java如何在Spring3+WS2+中使用注释、JibxMarshalling或使用xml配置配置JibxMarshalling和unmarshalling?   安装Oracle Jdeveloper时mac中出现java安装错误。   设置自动保存计时器以在java中定期保存文件(但不使用任何JavaFXAPI)的最佳策略是什么?   模板获取handlebar java中迭代器列表的长度   java如何在特定JAX RS调用中排除对象中的字段?   在Struts 2中抛出NullPointerException的java getText()方法   java比较捐献者和接受者的血型   fedora Java向后兼容性   字符串Java替换多个字符   复制BuffereImage时出现java数组索引错误   并行处理Java 8并行流findFirst   java关闭应用程序后如何离开服务?   Java:Tesseractocr:如何查找单词坐标?