The John Snow Labs Python library gives you a clean and easy way to structure your Python projects. The very first line of a project should be:
from johnsnowlabs import *
This imports all licensed and open source Python modules installed from other John Snow Labs Products, as well as many handy utility imports.
The following Functions, Classes and Modules will available in the global namespace
The nlp Module
nlp
module with classes and methods from Spark NLP like nlp.BertForSequenceClassification
and nlp.map_annotations()
nlp.AnnotatorName
via Spark NLP Annotators and Transformers i.e.nlp.BertForSequenceClassification
- Spark NLP Helper Functions i.e.
nlp.map_annotations()
nlp.F
viaimport pyspark.sql.functions as F
under the hoodnlp.T
viaimport pyspark.sql.types as T
under the hoodnlp.SQL
viaimport pyspark.sql as SQL
under the hoodnlp.ML
viafrom pyspark import ml as ML
under the hood- To see all the imports see the source
The jsl Module
jsl
module with the following methods
nlp.install()
for installing John Snow Labs libraries and managing your licenses, more info herenlp.load()
for predicting with any the 10k+ pretrained models in 1 line of code or training new ones, using the nlu.load() method under the hoodnlp.start()
for starting a Spark Session with access to features, more info herenlp.viz()
for visualizing predictions with any of the 10k+ pretrained models using nlu.viz() under the hoodnlp.viz_streamlit()
and other `nlp.viz_streamlit_xyz for using any of the 10k+ pretrained models in 0 lines of code with an interactive Streamlit GUI and re-usable and stackable Streamlit Componentsnlp.to_pretty_df()
for predicting on raw strings getting a nicely structures Pandas DF from a Spark Pipeline using nlu.to_pretty_df() under the hood
The viz Module
viz
module with classes from Spark NLP Display
viz.NerVisualizer
for visualizing prediction outputs of Ner based Spark Pipelinesviz.DependencyParserVisualizer
for visualizing prediction outputs of DependencyParser based Spark Pipelinesviz.RelationExtractionVisualizer
for visualizing prediction outputs of RelationExtraction based Spark Pipelinesviz.EntityResolverVisualizer
for visualizing prediction outputs of EntityResolver based Spark Pipelinesviz.AssertionVisualizer
for visualizing prediction outputs of Assertion based Spark Pipelines
The ocr Module
ocr
module with annotator classes and methods from Spark OCR like ocr.VisualDocumentClassifier
and `ocr.helpful_method()
- Pipeline Components i.e.
ocr.ImageToPdf
- Table Recognizers i.e.
ocr.ImageTableDetector
- Visual Document Understanding i.e.
ocr.VisualDocumentClassifier
- Object detectors i.e.
ocr.ImageHandwrittenDetector
- Enums, Structures and helpers i.e.
ocr.Color
- To see all the imports see the source
The medical Module
medical
module with annotator classes and methods from Spark NLP for Medicine like medical.RelationExtractionDL
and medical.profile()
- Medical Annotators , i.e.
medical.DeIdentification
- Training Methods i.e.
medical.AnnotationToolJsonReader
- Evaluation Methods, i.e.
medical.NerDLEvaluation
- NOTE: Any class which has
Medical
in its name is available, but theMedical
prefix has been omitted. I.e.medical.NerModel
maps tosparknlp_jsl.annotator.MedicalNerModel
- This is achieved via
from sparknlp_jsl.annotator import MedicalNerModel as NerModel
under the hood.
- This is achieved via
- To see all the imports see the source
The legal Module
legal
module with annotator classes and methods from Spark NLP for Legal like legal.RelationExtractionDL
and legal.profile()
- Legal Annotators , i.e.
legal.DeIdentification
- Training Methods i.e.
legal.AnnotationToolJsonReader
- Evaluation Methods, i.e.
legal.NerDLEvaluation
- NOTE: Any class which has
Legal
in its name is available, but theLegal
prefix has been omitted. I.e.legal.NerModel
maps tosparknlp_jsl.annotator.LegalNerModel
- This is achieved via
from sparknlp_jsl.annotator import LegalNerModel as NerModel
under the hood.
- This is achieved via
- To see all the imports see the source
The finance Module
finance
module with annotator classes and methods from Spark NLP for Finance like finance.RelationExtractionDL
and finance.profile()
- Finance Annotators , i.e.
finance.DeIdentification
- Training Methods i.e.
finance.AnnotationToolJsonReader
- Evaluation Methods, i.e.
finance.NerDLEvaluation
- NOTE: Any class which has
Finance
in its name is available, but theFinance
prefix has been omitted. I.e.finance.NerModel
maps tosparknlp_jsl.annotator.FinanceNerModel
- This is achieved via
from sparknlp_jsl.annotator import FinanceNerModel as NerModel
under the hood.
- This is achieved via
- To see all the imports see the source