Installation

 

To install the johnsnowlabs Python library and all of John Snow Labs open source libraries, just run

pip install johnsnowlabs

To quickly test the installation, you can run in your Shell:

python -c "from johnsnowlabs import nlp;print(nlp.load('emotion').predict('Wow that easy!'))"

or in Python:

from  johnsnowlabs import nlp
nlp.load('emotion').predict('Wow that easy!')

when using Annotator based pipelines, use nlp.start() to start up your session

from johnsnowlabs import nlp
nlp.start()
pipe = nlp.Pipeline(stages=
[
    nlp.DocumentAssembler().setInputCol('text').setOutputCol('doc'),
    nlp.Tokenizer().setInputCols('doc').setOutputCol('tok')
])
nlp.to_nlu_pipe(pipe).predict('That was easy')

for alternative installation options see Custom Installation

Last updated