41

AINLP公众号对话接口新增成语接龙

 5 years ago
source link: https://www.tuicool.com/articles/UV7rmmn
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

AINLP:一个有趣有AI的NLP公众号

成语接龙很有意思,原本计划找一些成语语料自己做一个,不过Google一圈后发现Github上有一个现成的项目: IdiomsSolitaire

Github链接: https://github.com/WangYihang/IdiomsSolitaire

这个项目自带2万多条成语数据,用法也很简单:

API Usage

>>> import IdiomsSolitaire
>>> IdiomsSolitaire.init()
>>> print IdiomsSolitaire.guess("一心一意")

Script Usage

# Install it first
pip install -r requirements.txt
# Use it in your termianl
$ python IdiomsSolitaire.py
Usage : 
        python IdiomsSolitaire.py [Idioms]
Example : 
        python IdiomsSolitaire.py '一心一意'
Author : 
        WangYihang <[email protected]>
$ python IdiomsSolitaire.py '一心一意'
[+] Init finished! [23594] words.
[一语破的] : [一句话就击中要害。的,箭靶的中心,比喻要害之处。]
$ python IdiomsSolitaire.py '一心一意'
[+] Init finished! [23594] words.
[一至於此] : [竟到如此地步。]

所以很快把这个接口接入了AINLP的对话功能中,感兴趣的同学可以关注AINLP公众号直接测试:

2a6ZRrJ.jpg!web

也可以直接尝试语音输入,不过个别地方识别确实有点歪打正着:

M7ruYnM.jpg!web

最后,欢迎关注我们的公众号AINLP,可以对对联,自动作诗,查询相似词,玩词语加减游戏等:

2E36B3z.jpg!web

注:原创文章,转载请注明出处及保留链接“我爱自然语言处理”: http://www.52nlp.cn

本文链接地址: AINLP公众号对话接口新增成语接龙 http://www.52nlp.cn/?p=12067

一个有趣有AI的NLP公众号,欢迎关注

Qzi2uyz.jpg!web

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK