Skip to content

Latest commit

 

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Snips NLU Parsers

Installation

Linux x86 / MacOS (>= 10.11) / Windows

Wheels and source distribution are available for Python >= 3.5

pip install snips-nlu-parsers

Other platforms

This package can be installed via pip from a source distribution. As it contains some rust code, rust must be installed on your machine.

To install Rust, run the following in your terminal, then follow the onscreen instructions:

curl https://sh.rustup.rs -sSf | sh

You will also need the python lib setuptools_rust:

pip install setuptools_rust

Finally, you can install snips-nlu-parsers using pip:

pip install snips-nlu-parsers

Usage

>>> from snips_nlu_parsers import BuiltinEntityParser
>>> import json
>>> parser = BuiltinEntityParser.build(language="en")
>>> parsing = parser.parse("what will be the weather in three days ?")
>>> print(json.dumps(parsing, indent=2))
[
  {
    "value": "in three days",
    "range": {
      "start": 25,
      "end": 38
    },
    "entity": {
      "kind": "InstantTime",
      "value": "2019-02-24 00:00:00 +01:00",
      "grain": "Day",
      "precision": "Exact"
    },
    "entity_kind": "snips/datetime"
  }
]