Skip to main content
Pre-release

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

John Snow Labs: State-of-the-art NLP in Python

The John Snow Labs library provides a simple & unified Python API for delivering enterprise-grade natural language processing solutions:

  1. 15,000+ free NLP models in 250+ languages in one line of code. Production-grade, Scalable, trainable, and 100% open-source.
  2. Open-source libraries for Responsible AI (NLP Test), Explainable AI (NLP Display), and No-Code AI (NLP Lab).
  3. 1,000+ healthcare NLP models and 1,000+ legal & finance NLP models with a John Snow Labs license subscription.

Homepage: https://www.johnsnowlabs.com/

Docs & Demos: https://nlp.johnsnowlabs.com/

Features

Powered by John Snow Labs Enterprise-Grade Ecosystem:

  • 🚀 Spark-NLP : State of the art NLP at scale!
  • 🤖 NLU : 1 line of code to conquer NLP!
  • 🕶 Visual NLP : Empower your NLP with a set of eyes!
  • 💊 Healthcare NLP : Heal the world with NLP!
  • ⚖ Legal NLP : Bring justice with NLP!
  • 💲 Finance NLP : Understand Financial Markets with NLP!
  • 🎨 NLP-Display Visualize and Explain NLP!
  • 📊 NLP-Test : Deliver Reliable, Safe and Effective Models!
  • 🔬 NLP-Lab : No-Code Tool to Annotate & Train new Models!

Installation

! pip install johnsnowlabs

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

See the documentation for more details.

Usage

These are examples of getting things done with one line of code. See the General Concepts Documentation for building custom pipelines.

# Example of Named Entity Recognition
nlp.load('ner').predict("Dr. John Snow is an British physician born in 1813")

Returns :

entities entities_class entities_confidence
John Snow PERSON 0.9746
British NORP 0.9928
1813 DATE 0.5841
# Example of Question Answering 
nlp.load('answer_question').predict("What is the capital of Paris")

Returns :

text answer
What is the capital of France Paris
# Example of Sentiment classification
nlp.load('sentiment').predict("Well this was easy!")

Returns :

text sentiment_class sentiment_confidence
Well this was easy! pos 0.999901
nlp.load('ner').viz('Bill goes to New York')

Returns:
ner_viz_opensource For a full overview see the 1-liners Reference and the Workshop.

Use Licensed Products

To use John Snow Labs' paid products like Healthcare NLP, [Visual NLP], [Legal NLP], or [Finance NLP], get a license key and then call nlp.install() to use it:

! pip install johnsnowlabs
# Install paid libraries via a browser login to connect to your account
from johnsnowlabs import nlp
nlp.install()
# Start a licensed session
nlp.start()
nlp.load('en.med_ner.oncology_wip').predict("Woman is on  chemotherapy, carboplatin 300 mg/m2.")

Usage

These are examples of getting things done with one line of code. See the General Concepts Documentation for building custom pipelines.

# visualize entity resolution ICD-10-CM codes 
nlp.load('en.resolve.icd10cm.augmented')
    .viz('Patient with history of prior tobacco use, nausea, nose bleeding and chronic renal insufficiency.')

returns:
ner_viz_opensource

# Temporal Relationship Extraction&Visualization
nlp.load('relation.temporal_events')\
    .viz('The patient developed cancer after a mercury poisoning in 1999 ')

returns: relationv_viz

Helpful Resources

Take a look at the official Johnsnowlabs page page: https://nlp.johnsnowlabs.com for user documentation and examples

Resource Description
General Concepts General concepts in the Johnsnowlabs library
Overview of 1-liners Most common used models and their results
Overview of 1-liners for healthcare Most common used healthcare models and their results
Overview of all 1-liner Notebooks 100+ tutorials on how to use the 1 liners on text datasets for various problems and from various sources like Twitter, Chinese News, Crypto News Headlines, Airline Traffic communication, Product review classifier training,
Connect with us on Slack Problems, questions or suggestions? We have a very active and helpful community of over 2000+ AI enthusiasts putting Johnsnowlabs products to good use
Discussion Forum More indepth discussion with the community? Post a thread in our discussion Forum
Github Issues Report a bug
Custom Installation Custom installations, Air-Gap mode and other alternatives
The nlp.load(<Model>) function Load any model or pipeline in one line of code
The nlp.load(<Model>).predict(data) function Predict on Strings, List of Strings, Numpy Arrays, Pandas, Modin and Spark Dataframes
The nlp.load(<train.Model>).fit(data) function Train a text classifier for 2-Class, N-Classes Multi-N-Classes, Named-Entitiy-Recognition or Parts of Speech Tagging
The nlp.load(<Model>).viz(data) function Visualize the results of Word Embedding Similarity Matrix, Named Entity Recognizers, Dependency Trees & Parts of Speech, Entity Resolution,Entity Linking or Entity Status Assertion
The nlp.load(<Model>).viz_streamlit(data) function Display an interactive GUI which lets you explore and test every model and feature in Johnsowlabs 1-liner repertoire in 1 click.

License

This library is licensed under the Apache 2.0 license. John Snow Labs' paid products are subject to this End User License Agreement.
By calling nlp.install() to add them to your environment, you agree to its terms and conditions.

Metadata

Release files for johnsnowlabs-by-kshitiz 5.2.0rc3

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

Source distribution (sdist)

Source distribution for johnsnowlabs-by-kshitiz 5.2.0rc3
File Size Uploaded
johnsnowlabs-by-kshitiz-5.2.0rc3.tar.gz 97.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for johnsnowlabs-by-kshitiz 5.2.0rc3
File Interpreter ABI Platform
johnsnowlabs_by_kshitiz-5.2.0rc3-py3-none-any.whl Python 3 none any Details

Total release size: 221.0 kB

Release files / johnsnowlabs-by-kshitiz-5.2.0rc3.tar.gz

Download URL johnsnowlabs-by-kshitiz-5.2.0rc3.tar.gz
Size 97.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9ea0d81a7369f52f0f03a1336bb0f3cd4b06b9d1f5e8a9d23e096308d504c87f
BLAKE2b-256 checksum
How to use checksums
452dbbd71d9f7e19203acfc8de9ed5c4f75cc566e3b983a34d1f97b27fa29bac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.2

Release files / johnsnowlabs_by_kshitiz-5.2.0rc3-py3-none-any.whl

Download URL johnsnowlabs_by_kshitiz-5.2.0rc3-py3-none-any.whl
Size 123.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
417d7b80b226047ad8955c11d0fcd8433815744e7980e3a783c42016107a174f
BLAKE2b-256 checksum
How to use checksums
096f1416c346ef2a8da3134db2434c4e27dfd6728e0c77773ae0a6beed40dbbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.2
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