GithubHelp home page GithubHelp logo

isabella232 / snips-nlu-rs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from snipsco/snips-nlu-rs

0.0 0.0 0.0 24.42 MB

Snips NLU rust implementation

Home Page: https://snips.ai

License: Other

Shell 2.01% Python 3.76% C 2.92% Objective-C 0.11% Rust 81.86% Kotlin 4.30% Swift 5.05%

snips-nlu-rs's Introduction

Snips NLU Rust

https://travis-ci.org/snipsco/snips-nlu-rs.svg?branch=master https://ci.appveyor.com/api/projects/status/rsf27a9txeomic8o/branch/master?svg=true

Installation

Add it to your Cargo.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:

"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",
      "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:

$ git clone https://github.com/snipsco/snips-nlu-rs
$ cd snips-nlu-rs
$ cargo run --example interactive_parsing_cli data/tests/models/nlu_engine

Here 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

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.

snips-nlu-rs's People

Contributors

adrienball avatar clemdoum avatar cpoisson avatar deluvi avatar fredszaq avatar hdlj avatar ivanceras avatar kali avatar mattgathu avatar nebuto avatar rosasternsonos avatar rtmvc avatar tobor-spins avatar tristandeleu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.