Algorithms for Natural Language Understanding

廉价感情. 提交于 2019-12-06 14:29:12

One way Stanford CoreNLP could help you is its TokensRegex functionality. With this tool you can write explicit patterns and then tag them in your input text. Then your code can react based on the presence of certain patterns.

Here are some links with more info:

http://nlp.stanford.edu/software/tokensregex.shtml

http://nlp.stanford.edu/software/regexner/

I would recommend identifying common expressions that you want to handle that deserve a clear response, and build up so you get decent coverage of what users input.

For instance:

Let us (start|begin).
(Start|begin) the (program|software)
I'm ready to (start|begin)
etc...

Obviously you could combine these rules and make them increasingly complicated. But I think a straight forward approach would be to think of the various ways one might express they want to begin and then capture that with rules.

I have a quick solution for you if you are okay with using an online API, you can easily achieve this with Wit AI's cloud API: http://wit.ai/. All you do is just create intents for your commands and specify the data that you want to extract and you're good to go. Otherwise if you aren't then you'll have to write the algorithms yourself to do what http://wit.ai/ does, which is what I ended up doing for my personal project because I wanted a self-contained system i.e. without using cloud APIs. As a heads up, the algorithm uses TokensRegex to find TokenSequencePatterns.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!