Metadata-Version: 2.0
Name: snips-nlu-parsers
Version: 0.2.2
Summary: Python wrapper of the snips-nlu-parsers Rust crate
Home-page: UNKNOWN
Author: Adrien Ball
Author-email: adrien.ball@snips.ai
License: Apache 2.0
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Dist: future (<0.18,>=0.16)
Requires-Dist: pathlib (<2.0,>=1.0); python_version < "3.4"

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

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

--------------------------------------
Linux x86 / MacOS (>= 10.11) / Windows
--------------------------------------

Wheels and source distribution are available for Python2.7 as well as Python >= 3.4

.. code-block:: bash

    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:

.. code-block:: bash

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


You will also need the python lib ``setuptools_rust``:

.. code-block:: bash

    pip install setuptools_rust

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

.. code-block:: bash

    pip install snips-nlu-parsers


Usage
-----

.. code-block:: python

   >>> 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"
     }
   ]


