Installation

 

0. Super Quickstart on Google Colab or Kaggle

If you work on a fresh Notebook on Kaggle or Google colab, you can just copy paste the following commands into your first cell which will automatically setup Java, nlu and import nlu, so you are good to go right away!

import os
! apt-get update -qq > /dev/null   
# Install java
! apt-get install -y openjdk-8-jdk-headless -qq > /dev/null
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
os.environ["PATH"] = os.environ["JAVA_HOME"] + "/bin:" + os.environ["PATH"]
! pip install nlu
import nlu

You can test it out right away with :

nlu.load('emotion').predict('wow that was easy')

1. Get Prerequisites (Java 8)

You only need to configure Java 8 on your machine and are good to go! Unless you are on Windows, which requires 1 additional step.

0. Super Quickstart on Google Collab or Kaggle

If you work on a fresh Notebook on Kaggle or Google collab, you can just copy paste the following commands into your first cell which will automatically setup Java, nlu and import nlu, so you are good to go right way!

import os
! apt-get update -qq > /dev/null   
# Install java
! apt-get install -y openjdk-8-jdk-headless -qq > /dev/null
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
os.environ["PATH"] = os.environ["JAVA_HOME"] + "/bin:" + os.environ["PATH"]
! pip install nlu
import nlu

You can test it out right away with :

nlu.load('emotion').predict('wow that was easy')

1. Get Prerequisites (Java 8)

You only need to configure Java 8 on your machine and are good to go! Unless you are on Windows, which requires 1 additional step.

Setup Java in Google Collab or Kaggle

If you work in a Kaggle or Collab Notebook you can simply configure Java by running the following code in a cell

import os
! apt-get update -qq > /dev/null   
# Install java
! apt-get install -y openjdk-8-jdk-headless -qq > /dev/null
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
os.environ["PATH"] = os.environ["JAVA_HOME"] + "/bin:" + os.environ["PATH"]

Verify Java 8 works

# should be Java 8 (Oracle or OpenJDK)
java -version

1.1 Get Windows Specific Prerequisites (winutils.exe)

1.1 Get Windows Specific Prerequisites (winutils.exe)

This is only required for Windows usesr.

  1. Download winutils.exe
  2. Create folder C:\winutils\bin
  3. Copy winutils.exe inside C:\winutils\bin
  4. Set environment variable HADOOP_HOME to C:\winutils

2. Install NLU package

# Install Spark NLU from PyPI
pip install nlu

3. Verify that NLU is working properly

Launch a Python shell an run a simple script.
On Windows you need to launch your shell as admim

import nlu
nlu.load('sentiment').predict('Why is NLU so awesome? Because of the sauce!')

# 3. Verify that NLU is working properly
Launch a Python shell an run a simple script.         
**On Windows you need to launch your shell as admim**

```python
import nlu
nlu.load('sentiment').predict('Why is NLU is awesome? Because of the sauce!')

Supported data types

Supported data types

NLU supports currently the following data formats :

  • Pandas Dataframes
  • Spark Dataframes
  • Modin with Dask backend
  • Modin with Ray backend
  • 1-D Numpy arrays of Strings
  • Strings
  • Arrays of Strings

Troubleshoot

Troubleshoot

  • On Arch based distributions like Manjaro you might encounter an error because of missing libffi.so.6.
    With yay libffi6 you can resolve this error.

Join our Slack channel

Join our channel, to ask for help and share your feedback. Developers and users can help each other get started here.

NLU Slack

Where to go next

If you want to get your hands dirty with some NLU work, check out the Examples page Detailed information about NLU APIs, concepts, components and more can be found on the following pages :

Last updated