Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Packaged GenieScript for Python

GenieScript's core engine is originally built in Java/TypeScript. This is its language extension in Python. The goal of this package is to:

  • Provide an easy installation, almost directly from pip

  • Expose the GenieScript engine as a set of easy-to-use APIs, enabling it to be used in larger Python projects

Installation

  1. Install node in your current environment.

    • GenieScript recommends node >= 18, although it is yet to be tested on earlier nodes. If you have multiple nodes in your environment, we recommend using nvm. After installing it, run (1) nvm install 18, (2) nvm use 18, and finally (3) nvm alias default 18.
  2. Install some required system dependency of pyGenieScript, including:

  3. pip install pyGenieScript

  4. pip install genienlp==0.7.0a4 (because installation of genienlp depends on more libraries, it is not included as a mandatory dependency of pyGenieScript). For Mac M1/M2 users, refer to this installation guide.

Usage

A minimalist example to run the yelp semantic parser

You can use GenieScript to query yelp database in natural language. We have prepared a yelp parser. Here are the steps to run this example:

  1. Open a python REPL process. Do the following:
>>> import pyGenieScript.geniescript
>>> genie = pyGenieScript.geniescript.Genie() # This command installs genie-toolkit and might take a while for the first time
>>> genie.nlu_server('yelp') # This command will download the yelp parser and might take a while for the first time

Tip: If you see Prediction worker had an error: spawn genienlp ENOENT, this means genienlp is not installed correctly.

If successful, the final message you see should be similar to this:

[I 230211 02:15:11 util:299] TransformerSeq2Seq has 139,420,416 parameters

Keep this REPL running, and in a separate terminal, run:

  1. The yelp skill requires you to register an API online and obtain a developer key. Register an account, retrieve the API key, and run:
export YELP_API_KEY=[your key]
  1. Open another python REPL process. Do the following:
>>> import pyGenieScript.geniescript
>>> genie = pyGenieScript.geniescript.Genie() # You should not need to wait now
>>> genie.initialize('localhost', 'yelp') # This sets the semantic parser to be accesible over local server
>>> genie.query("show me a chinese restaurant") # You should see meaningful results returned from Genie
>>> genie.quit() # Shuts down Genie server

Installation FAQ

If you encounter a stall of genie.query() when running for the first time (see here), please cancel the stalled process and run again.

API documentation

Main API documentations are aviliable here.

Metadata

Release files for pyGenieScript 0.0.0b20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyGenieScript 0.0.0b20
File Size Uploaded
pyGenieScript-0.0.0b20.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyGenieScript 0.0.0b20
File Interpreter ABI Platform
pyGenieScript-0.0.0b20-py3-none-any.whl Python 3 none any Details

Total release size: 23.1 kB

Release files / pyGenieScript-0.0.0b20.tar.gz

Download URL pyGenieScript-0.0.0b20.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
75cb41e5440b1612e43521f3b3570a512450e3c6ab221320d9f4f5276a8deaaf
BLAKE2b-256 checksum
How to use checksums
70699f757a8bc956c7a08b6aeca200072fa73adec10ed639ef35ab4984c00e68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / pyGenieScript-0.0.0b20-py3-none-any.whl

Download URL pyGenieScript-0.0.0b20-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb0a288ced7db87e966a409ebc220ccfc3005c3f8dc8a4b80b87527796169bd4
BLAKE2b-256 checksum
How to use checksums
ca44ca43cd65f5d38f4a2843ec318a399c342b29fe5afa53ff0cac036912b939
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page