Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/snipsco/snips-nlu-parsers

Rust crate for entity parsing
https://github.com/snipsco/snips-nlu-parsers

entity-recognition entity-resolution nlp nlu rust

Last synced: about 2 months ago
JSON representation

Rust crate for entity parsing

Awesome Lists containing this project

README

        

Snips NLU Parsers
=================

.. image:: https://travis-ci.org/snipsco/snips-nlu-parsers.svg?branch=master
:target: https://travis-ci.org/snipsco/snips-nlu-parsers

.. image:: https://ci.appveyor.com/api/projects/status/github/snipsco/snips-nlu-parsers?branch=master&svg=true
:target: https://ci.appveyor.com/project/snipsco/snips-nlu-parsers

This Rust crate provides APIs to extract entities in the context of a Natural Language Understanding (NLU)
task.

A `Python wrapper `_ is also available.

Installation
------------

Add this to your ``Cargo.toml``:

.. code-block:: toml

[dependencies]
snips-nlu-parsers = { git = "https://github.com/snipsco/snips-nlu-parsers", tag = "0.1.0" }

Usage
-----

.. code-block:: rust

use snips_nlu_parsers::{BuiltinEntityKind, BuiltinEntityParserLoader, Language};

fn parse_entities() {
let parser = BuiltinEntityParserLoader::new(Language::EN).load().unwrap();
let entities: Vec<(_, _)> = parser
.extract_entities("Book me restaurant for two people tomorrow", None)
.unwrap()
.into_iter()
.map(|e| (e.entity_kind, e.range))
.collect();
assert_eq!(
vec![
(BuiltinEntityKind::Number, 23..26),
(BuiltinEntityKind::Time, 34..42)
],
entities
);
}

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.