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.AnnotatorNamevia Spark NLP Annotators and Transformers i.e.nlp.BertForSequenceClassification- Spark NLP Helper Functions i.e.
nlp.map_annotations() nlp.Fviaimport pyspark.sql.functions as Funder the hoodnlp.Tviaimport pyspark.sql.types as Tunder the hoodnlp.SQLviaimport pyspark.sql as SQLunder the hoodnlp.MLviafrom pyspark import ml as MLunder 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.NerVisualizerfor visualizing prediction outputs of Ner based Spark Pipelinesviz.DependencyParserVisualizerfor visualizing prediction outputs of DependencyParser based Spark Pipelinesviz.RelationExtractionVisualizerfor visualizing prediction outputs of RelationExtraction based Spark Pipelinesviz.EntityResolverVisualizerfor visualizing prediction outputs of EntityResolver based Spark Pipelinesviz.AssertionVisualizerfor 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
Medicalin its name is available, but theMedicalprefix has been omitted. I.e.medical.NerModelmaps tosparknlp_jsl.annotator.MedicalNerModel- This is achieved via
from sparknlp_jsl.annotator import MedicalNerModel as NerModelunder 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
Legalin its name is available, but theLegalprefix has been omitted. I.e.legal.NerModelmaps tosparknlp_jsl.annotator.LegalNerModel- This is achieved via
from sparknlp_jsl.annotator import LegalNerModel as NerModelunder 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
Financein its name is available, but theFinanceprefix has been omitted. I.e.finance.NerModelmaps tosparknlp_jsl.annotator.FinanceNerModel- This is achieved via
from sparknlp_jsl.annotator import FinanceNerModel as NerModelunder the hood.
- This is achieved via
- To see all the imports see the source