SlideShare a Scribd company logo
Advanced Natural
Language
Processing with
Spark NLP
David Talby
CTO, John Snow Labs
2
Agenda
Introducing Spark NLP
State-of-the-art Accuracy
Speed & Scalability
Ease of Use
Examples
1.
2.
3.
4.
5.
3
Introducing Spark NLP
Most popular
O’Reilly Media
54% share
of healthcare AI teams
use Spark NLP
Gradient Flow
16x growth
In downloads of the
library Since Jan 2020
PyPI Download Stats
NLP library in
the enterprise
What is Spark NLP?
▪ State of the art Natural Language Processing
▪ Production-grade, trainable, and scalable
▪ Open-Source Python, Java & Scala libraries
▪ 1,400+ Pre-trained models & pipelines
▪ Active: 26+ new releases/year since 2017!
Spark NLP in Industry
NLP Industry Survey by Gradient Flow,
an independent data science research & insights company, September 2020
Which NLP libraries does your organization use?
Trusted By
There’s a world of difference between
an academic result and a production system
TRAINABLE &
TUNABLE
100% PRIVATE
EXPLAINABLE
REPRODUCIBLE
HARDWARE
OPTIMIZED
SCALABLE
COMMUNITY &
EDUCATION
8
Spark NLP
Introducing Spark NLP 3
• Massive speedups
[Databricks 7.2 ML GPU on 10 AWS f4dn.large:]
7.9 times faster in calculating BERT–Large
6.5 times faster in calculating BERT-base
3.0 times faster in calculating NER DL
• The latest compute platforms
Spark 3.1, 3.0, 2.4, 2.3
Databricks 8.x, 7.x, 6.x – CPU and GPU
Linux, Max, Windows – local development
Docker – with & without Kubernetes
Hadoop 2.7 and 3.x
Cloudera & Hortonworks
AWS, Azure, and GCP
10
Agenda
Introducing Spark NLP
State-of-the-art Accuracy
Speed & Scalability
Ease of Use
Examples
1.
2.
3.
4.
5.
11
On Accuracy
Biomedical Named
Entity Recognition at Scale
Improving Clinical Document
Understanding on COVID-19
Research with Spark NLP
Accurate Clinical Named
Entity Recognition at Scale
• Obtains new state-of-the-art results
on seven public biomedical benchmarks
without using heavy contextual embeddings,
including:
• BC4CHEMD to 93.72%
(4.1% gain)
• Species800 to 80.91%
(4.6% gain)
• JNLPBA to 81.29% (5.2% gain)
• Production-grade codebase on top of the
Spark NLP library; can scale up for training
and inference in any Spark cluster; GPU
support; Polyglot API
• Improve on the previous best accuracy
benchmarks for assertion status detection
• Recognize 100+ entity types including social
determinants of health, anatomy, risk
factors, and adverse events in addition to
other commonly used clinical and
biomedical entities
• Extract trends and insights:
Most frequent disorders & symptoms and
most common vital signs and EKG findings
from CORD-19
Presented at CADL 2020 (International Workshop
on Computational Aspects of Deep Learning), in
conjunction with ICPR 2020
Presented at SDU (Scientific Document
Understanding) workshop at AAAI 2021
• Establishes new state-of-the-art accuracy on
3 clinical concept extraction challenges:
• 2010 i2b2/VA clinical concept extraction
• 2014 n2c2 de-identification
• 2018 n2c2 medication extraction
• Outperform the accuracy of AWS Medical
Comprehend and Google Cloud Healthcare
API by a large margin (8.9% and 6.7%
respectively)
• Outperform plain Keras implementation
Under review
● “State of the art” means the
best peer-reviewed academic
results
● For example: Best F1 score on
CoNLL-2003 NER
benchmark for a system in
production
● Spark NLP uses a custom
model based on Bi-LSTM +
Char-CNN
+ CRF + Word Embeddings
Accuracy: State-of-the-art Models
Named Entity Recognition
● The best F1 score on CoNLL-2003
NER benchmark for a system in
production by using Spark NLP
● BERT Large model was used to
train our Bi-LSTM + Char-CNN +
CRF model
Accuracy: State-of-the-art Models
Named Entity Recognition
● Everything must work right out of the box
● All the parameters are default
● CoNLL 2003 dataset is used in this
benchmark. The eng.train was used for
training and
the eng.testa was used for evaluating the
model
Accuracy: State-of-the-art Models
Named Entity Recognition
Transformers & Embeddings
Spark NLP: 100+ Word
Embeddings
● BERT
● Small BERT
● BioBERT
● CovidBERT
● ALBERT
● ELECTRA
● XLNet
● ELMO
● GloVe
Accuracy: State-of-the-art Models
Multi-class & Multi-label Text Classifications
● Multi-class text classification to
detect emotions, cyberbullying,
fake news, spams, etc.
● Multi-label text classification to
detect toxic comments, movie
genre, etc.
● Hundreds of pre-tained Word
and Sentence Embeddings
● Language-Agnostic BERT
Sentence Embedding
● Universal Sentence Encoder as
an input for text classifications
Accuracy: State-of-the-art Models
SentimentDL, ClassifierDL, and MultiClassifierDL
● BERT
● Small BERT
● BioBERT
● CovidBERT
● LaBSE
● ALBERT
● ELECTRA
● XLNet
● ELMO
● Universal Sentence
Encoder
● GloVe
● 100 dimensions
● 200
dimensions
● 128 dimensions
● 256
dimensions
● 300
dimensions
● 512 dimensions
● 768
dimensions
● 1024
dimensions
● tfhub_ues
● tfhub_use_lg
● glove_6B_100
● glove_6B_300
● glove_840B_300
● bert_base_cased
● bert_base_uncased
● bert_large_cased
● bert_large_uncased
● bert_multi_uncased
● electra_small_uncased
● elmo
● ...
● 2 classes (positive/negative)
● 3 classes (0, 1, 2)
● 4 classes (Sports, Business,
etc.)
● 5 classes (1.0, 2.0, 3.0, 4.0, 5.0)
● ... 100 classes!
Accuracy: State-of-the-art Models
Language Detection & Identification
● LanguageDetectorDL is a state-of-the-art
TensorFlow/Keras model
● Uses the positions of the characters
● It is around 3 MB to 5 MB
● It has been trained over 8 million Wikipedia
pages
● It has between 97% to 99% accuracy for text
longer than 140 characters
Accuracy: State-of-the-art Models
Context Spell Checker
● Ability to consider OCR specific error
patterns
● Ability to leverage the context
● Ability to preserve and even correct custom
patterns
● Flexibility to incorporate your own custom
patterns
20
Agenda
Introducing Spark NLP
State-of-the-art Accuracy
Speed & Scalability
Ease of Use
Examples
1.
2.
3.
4.
5.
Optimizing Performance
BERT Embeddings
● Transformers are slow!
● They need GPUs
● It depends highly on max sequence
length
Spark NLP 2.6 optimizations:
● Improve the memory consumption by
30%
● Improve performance by more than 70%
with dynamic shape
Performance
BERT Embeddings
● Trade off size, memory, and accuracy
● Tiny BERT
● Mini BERT
● Small BERT
● Medium BERT
● Others…
Example:
● BERT-Tiny is 24x times smaller and
28x times faster than BERT-Base
Performance:
Hardware
● Optimized builds of Spark NLP
for both Intel and Nvidia
● Out-of-the-box optimizations for
Intel (MKL, etc.) and Nvidia
(Spark 3, etc.)
● Ongoing profiling with
engineering teams at both
companies
Scale: Distribution & Parallelism
● Zero code changes to scale a pipeline to any
Spark cluster
● Only natively distributed open-source NLP
library
● Spark provides execution planning, caching,
serialization, and shuffling
● Caveats
● Speedup depends on what you actually do
● Spark configurations matter
● Cluster tuning based on your data is advised
Scale: Distribution & Parallelism
Recognize Entity DL Pipeline
● Amazon full reviews, 15 million
sentences, and
255 million tokens
● Single node, 32G memory & 32 cores
● 10x workers with 32G memory & 16 cores
● The pipeline includes sentence
detection, tokenization, word
embeddings, and NER
Setup:
● Single node is dedicated Dell Server
● 10 Nodes are in Databricks on AWS
Scale: Distribution & Parallelism
BERT Embeddings
● Amazon full reviews, 15 million
sentences, and 255 million tokens
● Single node with 64G memory & 32
cores
● 10x workers with 32G memory & 16 cores
● 128 max sequence length
Setup:
● Single node is dedicated Dell Server
● 10 Nodes are in Databricks on AWS
27
Agenda
Introducing Spark NLP
State-of-the-art Accuracy
Speed & Scalability
Ease of Use
Examples
1.
2.
3.
4.
5.
Easy to Use
Python, Scala, and Java
● Pretrained pipelines
● Pretrained models
● Training your own models
Easy to Use
Pretrained Pipelines
● 100+ pretrained pipelines
● Full support for 13 languages
● Simple and easy to use
● Works online and offline
● Preconfigured
Easy to Use
Pretrained Models
● Hundreds of pretrained models
● Support for 46 languages
● Works online and offline
● Flexible & customized pipelines
● Caveat: some models depend on each
other
Easy to Use
Train your own POS tagging models
● POS() accepts token-tag format
● POS Tagger is based on Perceptron Average
algorithm
● Language-agnostic and supports any
language
Easy to Use
Train your own NER models
● CoNLL 2003 format as input
● Accepts 50+ Word Embeddings
models
● Train on CPU or GPU
● Extended metrics and evaluation
● Built-in validation split with metrics
Easy to Use
Train your own NER models
● BERT with 2 layers & 768 dimensions
● 16 minutes training
● 91% Micro F1 on Dev
● 90% conll_eval on Dev
● Full CoNLL 2003 training dataset
● Google Colab with GPU
Easy to Use
Train your own multi-class classifiers
● Supports up to 100 classes
● Accepts 90+ Word & Sentence Embeddings
models
● Train on CPU or GPU
● Extended metrics and evaluation
● Built-in validation split with metrics
35
Agenda
Introducing Spark NLP
State-of-the-art Accuracy
Speed & Scalability
Ease of Use
Examples
1.
2.
3.
4.
5.
36
Spark NLP for
Healthcare
37
Spark OCR
38
Project creation
Team setup
Tasks creation
Labeling
The Annotation Lab
39
Learn More
Using Spark NLP to build a drug
discovery knowledge graph for Covid-19
Vishnu Vettrivel & Alexander Thomas
Founder & Principal Data Scientist at Wisecube
NLP in Healthcare:
Challenges & Opportunities
Ganesh Thodikulam
Executive Director, Kaiser Permanente
A Unified CV, OCR, and NLP for
Scalable Document Understanding
Text Analytics and its Applications
in the Pharma Industry
Harsha Gurulingappa, Ph.D.
Text Analytics Product Owner at Merck
NLP in Oncology Real World Data:
Opportunities to develop a true learning
healthcare system
Patrick Beukema, Ph.D.
Senior ML Engineer, DocuSign
Automated & Explainable Deep
Learning for Clinical Language
Understanding at Roche
Vishakha Sharma, Ph.D.
Principal Data Scientist, Roche
George A. Komatsoulis, Ph.D.
Chief of Bioinformatics at CancerLinQ
40
Thank you!
© 2015-2021 John Snow Labs Inc. All rights reserved. The John Snow Labs logo is a trademarks of John Snow Labs Inc. The included information is for informational purposes only and represents the current
view of John Snow Labs as of the date of this presentation. Since John Snow Labs must respond to changing market conditions, it should not be interpreted to be a commitment on its part, and John Snow Labs
cannot guarantee the accuracy of any information provided after the date of this presentation. John Snow Labs makes no warranties, express
or statutory, as to the information in this presentation.
demo.johnsnowlabs.com
nlp.johnsnowlabs.com
Live demos:
Get Started:

More Related Content

PPTX
Introduction to NoSQL
PDF
Cassandra Database
PPTX
Introduction To HBase
PPTX
Natural language processing and transformer models
PPTX
(The life of a) Data engineer
PPTX
An Overview of Apache Cassandra
PDF
Overview of big data in cloud computing
PPT
Design and implementation of Clinical Databases using openEHR
Introduction to NoSQL
Cassandra Database
Introduction To HBase
Natural language processing and transformer models
(The life of a) Data engineer
An Overview of Apache Cassandra
Overview of big data in cloud computing
Design and implementation of Clinical Databases using openEHR

What's hot (20)

PPTX
Text Classification
PDF
Introduction to HBase
PDF
Smart Data Slides: Machine Learning - Case Studies
PPTX
Machine Learning - Dataset Preparation
PPTX
Apache hive introduction
PPTX
Data Science
PDF
Bertelsmann: BeTrend – Building a Trend Aggregation Machine.pdf
PDF
Unified Big Data Processing with Apache Spark (QCON 2014)
PDF
Data Security at Scale through Spark and Parquet Encryption
PPTX
Hate speech detection using machine learning
PDF
Intro to Neo4j and Graph Databases
PPTX
Locality sensitive hashing
PPTX
FAIR Data-centric Information Architecture.pptx
PDF
Azure Synapse Analytics
PDF
Introdution to Dataops and AIOps (or MLOps)
PDF
Optimizing Hive Queries
PDF
Recurrent Neural Networks, LSTM and GRU
PDF
Introduction to Cassandra
PPTX
Cloud Computing & Big Data
PPTX
Stock Market Prediction
Text Classification
Introduction to HBase
Smart Data Slides: Machine Learning - Case Studies
Machine Learning - Dataset Preparation
Apache hive introduction
Data Science
Bertelsmann: BeTrend – Building a Trend Aggregation Machine.pdf
Unified Big Data Processing with Apache Spark (QCON 2014)
Data Security at Scale through Spark and Parquet Encryption
Hate speech detection using machine learning
Intro to Neo4j and Graph Databases
Locality sensitive hashing
FAIR Data-centric Information Architecture.pptx
Azure Synapse Analytics
Introdution to Dataops and AIOps (or MLOps)
Optimizing Hive Queries
Recurrent Neural Networks, LSTM and GRU
Introduction to Cassandra
Cloud Computing & Big Data
Stock Market Prediction
Ad

Similar to Advanced Natural Language Processing with Apache Spark NLP (20)

PPTX
From Data Science to MLOps
PDF
Scaling AI in production using PyTorch
PDF
Building A Product Assortment Recommendation Engine
PPTX
Google cloud Study Jam 2023.pptx
PDF
Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)
PDF
Cloud Native Application Integration With APIs
PDF
PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...
PDF
"Different software evolutions from Start till Release in PHP product" Oleksa...
PDF
The Data Science Process - Do we need it and how to apply?
PPTX
Deploying ML models in the enterprise
DOCX
Zakir_Hussain_cv
PPTX
Scale machine learning deployment
DOC
Cv of manjunath kudari
PDF
RubiOne: Apache Spark as the Backbone of a Retail Analytics Development Envir...
PDF
Dagster @ R&S MNT
PPTX
Tracing-for-fun-and-profit.pptx
PPTX
Tips and Tricks for Toad
PDF
Preparing for Neo - Singapore OutSystems User Group October 2022 Meetup
DOC
Soma_Mishra_Resume
PPTX
Architecting an Open Source AI Platform 2018 edition
From Data Science to MLOps
Scaling AI in production using PyTorch
Building A Product Assortment Recommendation Engine
Google cloud Study Jam 2023.pptx
Intel Parallel Studio XE 2016 網路開發工具包新版本功能介紹(現已上市,歡迎詢價)
Cloud Native Application Integration With APIs
PHPFrameworkDay 2020 - Different software evolutions from Start till Release ...
"Different software evolutions from Start till Release in PHP product" Oleksa...
The Data Science Process - Do we need it and how to apply?
Deploying ML models in the enterprise
Zakir_Hussain_cv
Scale machine learning deployment
Cv of manjunath kudari
RubiOne: Apache Spark as the Backbone of a Retail Analytics Development Envir...
Dagster @ R&S MNT
Tracing-for-fun-and-profit.pptx
Tips and Tricks for Toad
Preparing for Neo - Singapore OutSystems User Group October 2022 Meetup
Soma_Mishra_Resume
Architecting an Open Source AI Platform 2018 edition
Ad

More from Databricks (20)

PPTX
DW Migration Webinar-March 2022.pptx
PPTX
Data Lakehouse Symposium | Day 1 | Part 1
PPT
Data Lakehouse Symposium | Day 1 | Part 2
PPTX
Data Lakehouse Symposium | Day 2
PPTX
Data Lakehouse Symposium | Day 4
PDF
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
PDF
Democratizing Data Quality Through a Centralized Platform
PDF
Learn to Use Databricks for Data Science
PDF
Why APM Is Not the Same As ML Monitoring
PDF
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
PDF
Stage Level Scheduling Improving Big Data and AI Integration
PDF
Simplify Data Conversion from Spark to TensorFlow and PyTorch
PDF
Scaling your Data Pipelines with Apache Spark on Kubernetes
PDF
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
PDF
Sawtooth Windows for Feature Aggregations
PDF
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
PDF
Re-imagine Data Monitoring with whylogs and Spark
PDF
Raven: End-to-end Optimization of ML Prediction Queries
PDF
Processing Large Datasets for ADAS Applications using Apache Spark
PDF
Massive Data Processing in Adobe Using Delta Lake
DW Migration Webinar-March 2022.pptx
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 4
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
Democratizing Data Quality Through a Centralized Platform
Learn to Use Databricks for Data Science
Why APM Is Not the Same As ML Monitoring
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
Stage Level Scheduling Improving Big Data and AI Integration
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Sawtooth Windows for Feature Aggregations
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Re-imagine Data Monitoring with whylogs and Spark
Raven: End-to-end Optimization of ML Prediction Queries
Processing Large Datasets for ADAS Applications using Apache Spark
Massive Data Processing in Adobe Using Delta Lake

Recently uploaded (20)

PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
STERILIZATION AND DISINFECTION-1.ppthhhbx
PPTX
Introduction-to-Cloud-ComputingFinal.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PDF
Optimise Shopper Experiences with a Strong Data Estate.pdf
PPTX
Supervised vs unsupervised machine learning algorithms
PDF
Business Analytics and business intelligence.pdf
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PDF
Transcultural that can help you someday.
PPTX
Leprosy and NLEP programme community medicine
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PDF
Mega Projects Data Mega Projects Data
PDF
[EN] Industrial Machine Downtime Prediction
PDF
.pdf is not working space design for the following data for the following dat...
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
PPTX
Database Infoormation System (DBIS).pptx
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Data_Analytics_and_PowerBI_Presentation.pptx
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
STERILIZATION AND DISINFECTION-1.ppthhhbx
Introduction-to-Cloud-ComputingFinal.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Optimise Shopper Experiences with a Strong Data Estate.pdf
Supervised vs unsupervised machine learning algorithms
Business Analytics and business intelligence.pdf
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Transcultural that can help you someday.
Leprosy and NLEP programme community medicine
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Mega Projects Data Mega Projects Data
[EN] Industrial Machine Downtime Prediction
.pdf is not working space design for the following data for the following dat...
Capcut Pro Crack For PC Latest Version {Fully Unlocked 2025}
Database Infoormation System (DBIS).pptx
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb

Advanced Natural Language Processing with Apache Spark NLP

  • 1. Advanced Natural Language Processing with Spark NLP David Talby CTO, John Snow Labs
  • 2. 2 Agenda Introducing Spark NLP State-of-the-art Accuracy Speed & Scalability Ease of Use Examples 1. 2. 3. 4. 5.
  • 3. 3 Introducing Spark NLP Most popular O’Reilly Media 54% share of healthcare AI teams use Spark NLP Gradient Flow 16x growth In downloads of the library Since Jan 2020 PyPI Download Stats NLP library in the enterprise
  • 4. What is Spark NLP? ▪ State of the art Natural Language Processing ▪ Production-grade, trainable, and scalable ▪ Open-Source Python, Java & Scala libraries ▪ 1,400+ Pre-trained models & pipelines ▪ Active: 26+ new releases/year since 2017!
  • 5. Spark NLP in Industry NLP Industry Survey by Gradient Flow, an independent data science research & insights company, September 2020 Which NLP libraries does your organization use?
  • 7. There’s a world of difference between an academic result and a production system TRAINABLE & TUNABLE 100% PRIVATE EXPLAINABLE REPRODUCIBLE HARDWARE OPTIMIZED SCALABLE COMMUNITY & EDUCATION
  • 9. Introducing Spark NLP 3 • Massive speedups [Databricks 7.2 ML GPU on 10 AWS f4dn.large:] 7.9 times faster in calculating BERT–Large 6.5 times faster in calculating BERT-base 3.0 times faster in calculating NER DL • The latest compute platforms Spark 3.1, 3.0, 2.4, 2.3 Databricks 8.x, 7.x, 6.x – CPU and GPU Linux, Max, Windows – local development Docker – with & without Kubernetes Hadoop 2.7 and 3.x Cloudera & Hortonworks AWS, Azure, and GCP
  • 10. 10 Agenda Introducing Spark NLP State-of-the-art Accuracy Speed & Scalability Ease of Use Examples 1. 2. 3. 4. 5.
  • 11. 11 On Accuracy Biomedical Named Entity Recognition at Scale Improving Clinical Document Understanding on COVID-19 Research with Spark NLP Accurate Clinical Named Entity Recognition at Scale • Obtains new state-of-the-art results on seven public biomedical benchmarks without using heavy contextual embeddings, including: • BC4CHEMD to 93.72% (4.1% gain) • Species800 to 80.91% (4.6% gain) • JNLPBA to 81.29% (5.2% gain) • Production-grade codebase on top of the Spark NLP library; can scale up for training and inference in any Spark cluster; GPU support; Polyglot API • Improve on the previous best accuracy benchmarks for assertion status detection • Recognize 100+ entity types including social determinants of health, anatomy, risk factors, and adverse events in addition to other commonly used clinical and biomedical entities • Extract trends and insights: Most frequent disorders & symptoms and most common vital signs and EKG findings from CORD-19 Presented at CADL 2020 (International Workshop on Computational Aspects of Deep Learning), in conjunction with ICPR 2020 Presented at SDU (Scientific Document Understanding) workshop at AAAI 2021 • Establishes new state-of-the-art accuracy on 3 clinical concept extraction challenges: • 2010 i2b2/VA clinical concept extraction • 2014 n2c2 de-identification • 2018 n2c2 medication extraction • Outperform the accuracy of AWS Medical Comprehend and Google Cloud Healthcare API by a large margin (8.9% and 6.7% respectively) • Outperform plain Keras implementation Under review
  • 12. ● “State of the art” means the best peer-reviewed academic results ● For example: Best F1 score on CoNLL-2003 NER benchmark for a system in production ● Spark NLP uses a custom model based on Bi-LSTM + Char-CNN + CRF + Word Embeddings Accuracy: State-of-the-art Models Named Entity Recognition
  • 13. ● The best F1 score on CoNLL-2003 NER benchmark for a system in production by using Spark NLP ● BERT Large model was used to train our Bi-LSTM + Char-CNN + CRF model Accuracy: State-of-the-art Models Named Entity Recognition
  • 14. ● Everything must work right out of the box ● All the parameters are default ● CoNLL 2003 dataset is used in this benchmark. The eng.train was used for training and the eng.testa was used for evaluating the model Accuracy: State-of-the-art Models Named Entity Recognition
  • 15. Transformers & Embeddings Spark NLP: 100+ Word Embeddings ● BERT ● Small BERT ● BioBERT ● CovidBERT ● ALBERT ● ELECTRA ● XLNet ● ELMO ● GloVe
  • 16. Accuracy: State-of-the-art Models Multi-class & Multi-label Text Classifications ● Multi-class text classification to detect emotions, cyberbullying, fake news, spams, etc. ● Multi-label text classification to detect toxic comments, movie genre, etc. ● Hundreds of pre-tained Word and Sentence Embeddings ● Language-Agnostic BERT Sentence Embedding ● Universal Sentence Encoder as an input for text classifications
  • 17. Accuracy: State-of-the-art Models SentimentDL, ClassifierDL, and MultiClassifierDL ● BERT ● Small BERT ● BioBERT ● CovidBERT ● LaBSE ● ALBERT ● ELECTRA ● XLNet ● ELMO ● Universal Sentence Encoder ● GloVe ● 100 dimensions ● 200 dimensions ● 128 dimensions ● 256 dimensions ● 300 dimensions ● 512 dimensions ● 768 dimensions ● 1024 dimensions ● tfhub_ues ● tfhub_use_lg ● glove_6B_100 ● glove_6B_300 ● glove_840B_300 ● bert_base_cased ● bert_base_uncased ● bert_large_cased ● bert_large_uncased ● bert_multi_uncased ● electra_small_uncased ● elmo ● ... ● 2 classes (positive/negative) ● 3 classes (0, 1, 2) ● 4 classes (Sports, Business, etc.) ● 5 classes (1.0, 2.0, 3.0, 4.0, 5.0) ● ... 100 classes!
  • 18. Accuracy: State-of-the-art Models Language Detection & Identification ● LanguageDetectorDL is a state-of-the-art TensorFlow/Keras model ● Uses the positions of the characters ● It is around 3 MB to 5 MB ● It has been trained over 8 million Wikipedia pages ● It has between 97% to 99% accuracy for text longer than 140 characters
  • 19. Accuracy: State-of-the-art Models Context Spell Checker ● Ability to consider OCR specific error patterns ● Ability to leverage the context ● Ability to preserve and even correct custom patterns ● Flexibility to incorporate your own custom patterns
  • 20. 20 Agenda Introducing Spark NLP State-of-the-art Accuracy Speed & Scalability Ease of Use Examples 1. 2. 3. 4. 5.
  • 21. Optimizing Performance BERT Embeddings ● Transformers are slow! ● They need GPUs ● It depends highly on max sequence length Spark NLP 2.6 optimizations: ● Improve the memory consumption by 30% ● Improve performance by more than 70% with dynamic shape
  • 22. Performance BERT Embeddings ● Trade off size, memory, and accuracy ● Tiny BERT ● Mini BERT ● Small BERT ● Medium BERT ● Others… Example: ● BERT-Tiny is 24x times smaller and 28x times faster than BERT-Base
  • 23. Performance: Hardware ● Optimized builds of Spark NLP for both Intel and Nvidia ● Out-of-the-box optimizations for Intel (MKL, etc.) and Nvidia (Spark 3, etc.) ● Ongoing profiling with engineering teams at both companies
  • 24. Scale: Distribution & Parallelism ● Zero code changes to scale a pipeline to any Spark cluster ● Only natively distributed open-source NLP library ● Spark provides execution planning, caching, serialization, and shuffling ● Caveats ● Speedup depends on what you actually do ● Spark configurations matter ● Cluster tuning based on your data is advised
  • 25. Scale: Distribution & Parallelism Recognize Entity DL Pipeline ● Amazon full reviews, 15 million sentences, and 255 million tokens ● Single node, 32G memory & 32 cores ● 10x workers with 32G memory & 16 cores ● The pipeline includes sentence detection, tokenization, word embeddings, and NER Setup: ● Single node is dedicated Dell Server ● 10 Nodes are in Databricks on AWS
  • 26. Scale: Distribution & Parallelism BERT Embeddings ● Amazon full reviews, 15 million sentences, and 255 million tokens ● Single node with 64G memory & 32 cores ● 10x workers with 32G memory & 16 cores ● 128 max sequence length Setup: ● Single node is dedicated Dell Server ● 10 Nodes are in Databricks on AWS
  • 27. 27 Agenda Introducing Spark NLP State-of-the-art Accuracy Speed & Scalability Ease of Use Examples 1. 2. 3. 4. 5.
  • 28. Easy to Use Python, Scala, and Java ● Pretrained pipelines ● Pretrained models ● Training your own models
  • 29. Easy to Use Pretrained Pipelines ● 100+ pretrained pipelines ● Full support for 13 languages ● Simple and easy to use ● Works online and offline ● Preconfigured
  • 30. Easy to Use Pretrained Models ● Hundreds of pretrained models ● Support for 46 languages ● Works online and offline ● Flexible & customized pipelines ● Caveat: some models depend on each other
  • 31. Easy to Use Train your own POS tagging models ● POS() accepts token-tag format ● POS Tagger is based on Perceptron Average algorithm ● Language-agnostic and supports any language
  • 32. Easy to Use Train your own NER models ● CoNLL 2003 format as input ● Accepts 50+ Word Embeddings models ● Train on CPU or GPU ● Extended metrics and evaluation ● Built-in validation split with metrics
  • 33. Easy to Use Train your own NER models ● BERT with 2 layers & 768 dimensions ● 16 minutes training ● 91% Micro F1 on Dev ● 90% conll_eval on Dev ● Full CoNLL 2003 training dataset ● Google Colab with GPU
  • 34. Easy to Use Train your own multi-class classifiers ● Supports up to 100 classes ● Accepts 90+ Word & Sentence Embeddings models ● Train on CPU or GPU ● Extended metrics and evaluation ● Built-in validation split with metrics
  • 35. 35 Agenda Introducing Spark NLP State-of-the-art Accuracy Speed & Scalability Ease of Use Examples 1. 2. 3. 4. 5.
  • 38. 38 Project creation Team setup Tasks creation Labeling The Annotation Lab
  • 39. 39 Learn More Using Spark NLP to build a drug discovery knowledge graph for Covid-19 Vishnu Vettrivel & Alexander Thomas Founder & Principal Data Scientist at Wisecube NLP in Healthcare: Challenges & Opportunities Ganesh Thodikulam Executive Director, Kaiser Permanente A Unified CV, OCR, and NLP for Scalable Document Understanding Text Analytics and its Applications in the Pharma Industry Harsha Gurulingappa, Ph.D. Text Analytics Product Owner at Merck NLP in Oncology Real World Data: Opportunities to develop a true learning healthcare system Patrick Beukema, Ph.D. Senior ML Engineer, DocuSign Automated & Explainable Deep Learning for Clinical Language Understanding at Roche Vishakha Sharma, Ph.D. Principal Data Scientist, Roche George A. Komatsoulis, Ph.D. Chief of Bioinformatics at CancerLinQ
  • 40. 40 Thank you! © 2015-2021 John Snow Labs Inc. All rights reserved. The John Snow Labs logo is a trademarks of John Snow Labs Inc. The included information is for informational purposes only and represents the current view of John Snow Labs as of the date of this presentation. Since John Snow Labs must respond to changing market conditions, it should not be interpreted to be a commitment on its part, and John Snow Labs cannot guarantee the accuracy of any information provided after the date of this presentation. John Snow Labs makes no warranties, express or statutory, as to the information in this presentation. demo.johnsnowlabs.com nlp.johnsnowlabs.com Live demos: Get Started: