Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/snipsco/snips-nlu-rs
Snips NLU rust implementation
https://github.com/snipsco/snips-nlu-rs
inference nlu rust
Last synced: 9 days ago
JSON representation
Snips NLU rust implementation
- Host: GitHub
- URL: https://github.com/snipsco/snips-nlu-rs
- Owner: snipsco
- License: other
- Created: 2018-02-21T09:29:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T20:39:00.000Z (almost 2 years ago)
- Last Synced: 2024-08-01T17:32:50.251Z (3 months ago)
- Topics: inference, nlu, rust
- Language: Rust
- Homepage: https://snips.ai
- Size: 23.9 MB
- Stars: 340
- Watchers: 34
- Forks: 57
- Open Issues: 6
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nlp - snips-nlu-rs - 用於意圖解析的生產就緒等級函示庫。 (函式庫 / 書籍)
README
Snips NLU Rust
==============.. image:: https://travis-ci.org/snipsco/snips-nlu-rs.svg?branch=master
:target: https://travis-ci.org/snipsco/snips-nlu-rs.. image:: https://ci.appveyor.com/api/projects/status/rsf27a9txeomic8o/branch/master?svg=true
:target: https://ci.appveyor.com/project/snipsco/snips-nlu-rsInstallation
------------Add it to your ``Cargo.toml``:
.. code-block:: toml
[dependencies]
snips-nlu-lib = { git = "https://github.com/snipsco/snips-nlu-rs", branch = "master" }Add ``extern crate snips_nlu_lib`` to your crate root and you are good to go!
Intent Parsing with Snips NLU
-----------------------------The purpose of the main crate of this repository, ``snips-nlu-lib``, is to perform an information
extraction task called *intent parsing*.Let’s take an example to illustrate the main purpose of this lib, and consider the following sentence:
.. code-block:: text
"What will be the weather in paris at 9pm?"
Properly trained, the Snips NLU engine will be able to extract structured data such as:
.. code-block:: json
{
"intent": {
"intentName": "searchWeatherForecast",
"confidenceScore": 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 order to achieve such a result, the NLU engine needs to be fed with a trained model (json file).
This repository only contains the inference part, in order to produce trained models please check
the `Snips NLU python library `_.Example and API Usage
---------------------The `interactive parsing CLI `_ is a good example
of to how to use ``snips-nlu-rs``.Here is how you can run the CLI example:
.. code-block:: bash
$ git clone https://github.com/snipsco/snips-nlu-rs
$ cd snips-nlu-rs
$ cargo run --example interactive_parsing_cli data/tests/models/nlu_engineHere we used a sample trained engine, which consists in two intents: ``MakeCoffee`` and ``MakeTea``.
Thus, it will be able to parse queries like ``"Make me two cups of coffee please"`` or ``"I'd like a hot tea"``.As mentioned in the previous section, you can train your own nlu engine with the
`Snips NLU python library `_.License
-------Licensed under either of
* Apache License, Version 2.0 (`LICENSE-APACHE `_ or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license (`LICENSE-MIT `_) or http://opensource.org/licenses/MIT)
at your option.Contribution
------------Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.