https://github.com/snipsco/snips-nlu
https://snips-nlu.readthedocs.io/en/latest/quickstart.html
这个库是用来解析一个问题,识别问的是啥问题,以及这个问题的各个要素
比如:
这个问题问出来,机器要自动能识别出来:
问题的倾向:天气预报
天气预报的时间:9pm
天气预报的地点:paris
这个问题有很广泛的应用:
语音助手:请帮我打开电灯 => 倾向:打开,打开的对象:电灯
自动订票:请帮我订明天去北京的机票=>倾向:订票,航班的时间:明天,航班的目的地:北京
What is Snips NLU about ?
Behind every chatbot and voice assistant lies a common piece of technology: Natural Language Understanding (NLU). Anytime a user interacts with an AI using natural language, their words need to be translated into a machine-readable description of what they meant.
The NLU engine first detects what the intention of the user is (a.k.a. intent), then extracts the parameters (called slots) of the query. The developer can then use this to determine the appropriate action or response.
Let’s take an example to illustrate this, and consider the following sentence:
"What will be the weather in paris at 9pm?"
Properly trained, the Snips NLU engine will be able to extract structured data such as:
{
"intent": {
"intentName": "searchWeatherForecast",
"probability": 0.95
},
"slots": [
{
"value": "paris",
"entity": "locality",
"slotName": "forecast_locality"
},
{
"value": {
"kind": "InstantTime",
"value": "2018-02-08 20:00:00 +00:00"
},
"entity": "snips/datetime",
"slotName": "forecast_start_datetime"
}
]
}
In this case, the identified intent is searchWeatherForecast and two slots were extracted, a locality and a datetime. As you can see, Snips NLU does an extra step on top of extracting entities: it resolves them. The extracted datetime value has indeed been converted into a handy ISO format.
领取专属 10元无门槛券
私享最新 技术干货