SlideShare une entreprise Scribd logo
1  sur  24
Building an enterprise Natural Language Search
Engine with ElasticSearch and Facebook’s DrQA
Louis Baligand, Debmalya Biswas
Berlin Buzzwords, 17 June 2019
Enterprise Architecture
PMI INFORMATION SERVICES 2016
About
2
https://github.com/philipmorrisintl
Debmalya Biswas
Louis Baligand
“Forrester defines cognitive search and knowledge discovery solutions as
A new generation of enterprise search solutions that employ AI
technologies such as natural language processing and machine learning
to ingest, understand, organize, and query digital content from multiple
data sources.
3
““ The average interaction worker spends
[...] nearly 20 percent (of the workweek)
looking for internal information.”
-MGI Report, 2012.
4
Half (54%) of global information workers said, "My work
gets interrupted because I can't find or get access to
information I need to complete my tasks" a few times a
month or more often. -Forrester Data Global Business
Technographics Devices And Security Workforce Survey, 2016.
PMI INFORMATION SERVICES 2016
Enterprise Search vs. Web Search
6
Enterprise Search Web Searchvs.
Multiple content types
Limited tagging/metadata management
Role-based content trimming
Small amount of content
Single source (web pages)
Large investments in SEO (*)
(*): Search Engine Optimization
No visibility restrictions (public pages)
Enormous amount of content
No team in charge of Search Experience Search xxperience as core business
Employees are the end-users WWW users
PMI INFORMATION SERVICES 2016
Natural Language Search (NLS)
7
Knowledge Graph
PMI INFORMATION SERVICES 2016
Chatbots and Natural Language Search
Natural Language Search
(Neural Networks)
 Works on documents.
 Users can ask any question
from the documents.
 Both the documents and
questions are passed through
the same Neural Network,
producing the matching
answer.
Intent based Chatbots
(Statistical Methods)
 Requires Q&A knowledge.
 Able to scale with respect to
question variants by
applying Statististical
Clustering Methods, e.g. tf-
idf, Bag-of-Words - to
cluster question variants
into ‘intents’.
(Rules based) FAQs
.
 Works only for specific
hardcoded questions.
 The only way to scale with
respect to question
variants, is to extend the
knowledgebase by
manually adding variants of
a question.
“How do I replace the heating
component of my iQoS?”
=
“Tell me how to change the
heating component of my iQoS”
<Q>
how replace
heating
component
iQoS
<Q>
how change
heating
component
iQoS
Same Intent
#repairIQOS
Document
data base
Neural
Network
<Q>
Neural
Network
(Offline)
(Real-time)
<A>
PMI INFORMATION SERVICES 2016
Chatbots and Natural Language Search (2)
3- tier strategy:
 A Chatbot with its pre-
defined Q&A set remains the
entry point – think of it as
the 1st line of defense.
 If the bot encounters a user
query which cannot be
mapped to one of its pre-
configured intents, it
performs a NLS over its KB.
This is the 2nd line of
defense.
 If the user is not satisfied
even with search results, plan
for a final handover to a live
agent.
Ref: “Chatbots & Natural Language Search: 2 sides of
the same coin?” (link)
PMI INFORMATION SERVICES 2016
• End-user searching for
products (not answer)
• Filter-Oriented
• Rates, Review
10
Positioning vs e-commerce search
PMI INFORMATION SERVICES 2016
Philip Morris’ Use
case: Operator
Trainings
• Hundreds to thousands of operators
• Long manuals with specific terminology
• A 1min downtime of a machine would
lead to 20,000 cigarettes unmade
• Typical Full text Search (Boolean search,
no relevancy score)
• Document Management System
Manually classified
• On-boarding difficulty
11
PMI INFORMATION SERVICES 2016
Example of fine-grained results
12
Q. How many knives are there on the drums?
PMI INFORMATION SERVICES 2016
Question Answering?
• Squad Dataset: a reference in
Question Answering
• 100,000+ Q&A on Wikipedia
articles
• State of the art is beating
Human Performance
14
PMI INFORMATION SERVICES 2016
DrQA Overview
• Facebook AI Research, ACL
2017, Reading Wikipedia to
answer Open-Domain
Questions.
• Open source, BSD License
https://github.com/facebookr
esearch/DrQA
• Pre-trained model available
15
https://github.com/facebookresearch/DrQA
PMI INFORMATION SERVICES 2016
DrQA Overview
16
Bigram
TFIDF
Bi-direct.
RNN
PMI INFORMATION SERVICES 2016
DrQA is easy to use on your own corpus!
17
$ pythonbuild_db.py /path/to/data /path/to/saved/db.db
$ pythonbuild_tfidf.py /path/to/doc/db /path/to/output/dir
0.06 0.02
0.03 0.08
Terms
Docs
$ pythoninteractive.py –reader-modelmultitask.mdl –retriever-modelpath/to/tfidf –doc-db path/to/saved/db.db
>>>process('Whatis theanswertolife,the universe,andeverything?’)
Top Predictions:
+------+--------+---------------------------------------------------+--------------+-----------+
| Rank| Answer| Doc | AnswerScore|DocScore|
+------+--------+---------------------------------------------------+--------------+-----------+
| 1 | 42 | PhrasesfromThe Hitchhiker'sGuide tothe Galaxy | 47242 | 141.26 |
+------+--------+---------------------------------------------------+--------------+-----------+
Pre-trained model open sourced
PMI INFORMATION SERVICES 2016
DrQA to answer Operator’s questions?
18
• Java toolkit to extract text + metadata from DOCX, PPT, XLS, PDF, JPEG, etc…
• Apache Software Foundation
• OCR
PMI INFORMATION SERVICES 2016
DrQA to answer Operator’s questions?
19
https://github.com/facebookresearch/DrQA
P@5: 76%
• Not a voice assistant
• End user needs at least ~95%
• Full control on the retriever
• First stage to prioritize
PMI INFORMATION SERVICES 2016
Introducing Elasticsearch
• Open source distributed
• Highly scalable
• RESTful API on top of Lucene capabilities
• Support for Full Text search (best of bread)
• Easy to configure + extend
• Seamlessly manage conflicts
• Active community & popular
21
PMI INFORMATION SERVICES 2016
Integrating Elasticsearch to DrQA’s pipeline
22
Index
PMI INFORMATION SERVICES 2016
Integrating Elasticsearch to DrQA’s pipeline
23
>>>fromdrqa.pipeline importDrQA
>>>fromdrqa.retrieverimportElasticDocRanker
>>>model= DrQA(reader_model=‘reader_model.mdl’,
ranker_config={'class':ElasticDocRanker,
'options':{'elastic_url':'127.0.0.1:9200’,
'elastic_index':'mini’, 'elastic_fields':'content’,
'elastic_field_doc_name':['file','filename’],
'elastic_field_content': 'content’}})
>>>model.process(’Howthe tensioningoftheV-belts shouldbe done?’)
Directly point to your server hosting Elastic Enable to search in any fields, e.g. uni-grams, bi-
grams, title, metadata, etc…
PMI INFORMATION SERVICES 2016
The pipeline performance
24
P@5: 76% 84%
P@5 ref.: 78%
(DrQA)
F1 score: 42%
F1 score ref.: 79%
(DrQA)
• DrQA span +- 10 tokens: 94% of 1st result contains true answer
PMI INFORMATION SERVICES 2016
Take aways
 Address pain points by combining
Document Retrieval with Question
Answering
 If not answered, it will provide much
more granular insights of the data
 User elicitation & user experience: a
top down approach
 End user does not know what to ask
25
PMI INFORMATION SERVICES 2016
Future work – Extend pipeline with BERT*
 A general-purpose architecture to train models for multiple NLP tasks (sentiment analysis, etc…)
 State of the art for SQuAD
 Open source, published in Oct. 2018 by Google AI Research
 High memory required: GPU with at least 12GB of RAM (Base model)
 Enable to multi-language queries
26
*https://arxiv.org/abs/1810.04805, https://github.com/google-research/bert
• Add one layer to compute Pstart(“token”) & Pend(“token”) for each tokens
• Find the best pair by maximizing Pstart(“token1”) * Pend(“token2”)
Thank you.

Contenu connexe

Tendances

Applications and approaches_to_object_or
Applications and approaches_to_object_orApplications and approaches_to_object_or
Applications and approaches_to_object_or
Salim Uçar
 
Strata 2017 (San Jose): Building a healthy data ecosystem around Kafka and Ha...
Strata 2017 (San Jose): Building a healthy data ecosystem around Kafka and Ha...Strata 2017 (San Jose): Building a healthy data ecosystem around Kafka and Ha...
Strata 2017 (San Jose): Building a healthy data ecosystem around Kafka and Ha...
Shirshanka Das
 

Tendances (20)

Digital transformation and AI @Edge
Digital transformation and AI @EdgeDigital transformation and AI @Edge
Digital transformation and AI @Edge
 
State of the State: What’s Happening in the Database Market?
State of the State: What’s Happening in the Database Market?State of the State: What’s Happening in the Database Market?
State of the State: What’s Happening in the Database Market?
 
Vijayananda Mohire-dissertation-abstract
Vijayananda Mohire-dissertation-abstractVijayananda Mohire-dissertation-abstract
Vijayananda Mohire-dissertation-abstract
 
Cognos Data Module Architectures & Use Cases
Cognos Data Module Architectures & Use CasesCognos Data Module Architectures & Use Cases
Cognos Data Module Architectures & Use Cases
 
Applications and approaches_to_object_or
Applications and approaches_to_object_orApplications and approaches_to_object_or
Applications and approaches_to_object_or
 
Driven by data - Why we need a Modern Enterprise Data Analytics Platform
Driven by data - Why we need a Modern Enterprise Data Analytics PlatformDriven by data - Why we need a Modern Enterprise Data Analytics Platform
Driven by data - Why we need a Modern Enterprise Data Analytics Platform
 
On24 oracle-machine-learning-platform-12-feb-2020-webcast
On24 oracle-machine-learning-platform-12-feb-2020-webcastOn24 oracle-machine-learning-platform-12-feb-2020-webcast
On24 oracle-machine-learning-platform-12-feb-2020-webcast
 
Phoenix Data Conference - Big Data Analytics for IoT 11/4/17
Phoenix Data Conference - Big Data Analytics for IoT 11/4/17Phoenix Data Conference - Big Data Analytics for IoT 11/4/17
Phoenix Data Conference - Big Data Analytics for IoT 11/4/17
 
Hadoop Integration with Microstrategy
Hadoop Integration with Microstrategy Hadoop Integration with Microstrategy
Hadoop Integration with Microstrategy
 
The Evolution of Metadata: LinkedIn's Story [Strata NYC 2019]
The Evolution of Metadata: LinkedIn's Story [Strata NYC 2019]The Evolution of Metadata: LinkedIn's Story [Strata NYC 2019]
The Evolution of Metadata: LinkedIn's Story [Strata NYC 2019]
 
How data modelling helps serve billions of queries in millisecond latency wit...
How data modelling helps serve billions of queries in millisecond latency wit...How data modelling helps serve billions of queries in millisecond latency wit...
How data modelling helps serve billions of queries in millisecond latency wit...
 
Unified Information Governance, Powered by Knowledge Graph
Unified Information Governance, Powered by Knowledge GraphUnified Information Governance, Powered by Knowledge Graph
Unified Information Governance, Powered by Knowledge Graph
 
"Data Annotation at Scale: Pitfalls and Solutions," a Presentation from Intel
"Data Annotation at Scale: Pitfalls and Solutions," a Presentation from Intel"Data Annotation at Scale: Pitfalls and Solutions," a Presentation from Intel
"Data Annotation at Scale: Pitfalls and Solutions," a Presentation from Intel
 
Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...
Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...
Delivering Large Scale Real-time Graph Analytics with Dell Infrastructure and...
 
Strata 2017 (San Jose): Building a healthy data ecosystem around Kafka and Ha...
Strata 2017 (San Jose): Building a healthy data ecosystem around Kafka and Ha...Strata 2017 (San Jose): Building a healthy data ecosystem around Kafka and Ha...
Strata 2017 (San Jose): Building a healthy data ecosystem around Kafka and Ha...
 
SqlSaturday#699 Power BI - Create a dashboard from zero to hero
SqlSaturday#699 Power BI - Create a dashboard from zero to heroSqlSaturday#699 Power BI - Create a dashboard from zero to hero
SqlSaturday#699 Power BI - Create a dashboard from zero to hero
 
Citizen Data Science Training using KNIME
Citizen Data Science Training using KNIMECitizen Data Science Training using KNIME
Citizen Data Science Training using KNIME
 
The "Big Data" Ecosystem at LinkedIn
The "Big Data" Ecosystem at LinkedInThe "Big Data" Ecosystem at LinkedIn
The "Big Data" Ecosystem at LinkedIn
 
Data science with python certification training course with
Data science with python certification training course withData science with python certification training course with
Data science with python certification training course with
 
Predictive maintenance withsensors_in_utilities_
Predictive maintenance withsensors_in_utilities_Predictive maintenance withsensors_in_utilities_
Predictive maintenance withsensors_in_utilities_
 

Similaire à Building an enterprise Natural Language Search Engine with ElasticSearch and Facebook’s DrQA

Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Yael Garten
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
MongoDB
 

Similaire à Building an enterprise Natural Language Search Engine with ElasticSearch and Facebook’s DrQA (20)

BigData Analysis
BigData AnalysisBigData Analysis
BigData Analysis
 
KDD 2019 IADSS Workshop - Research Updates from Usama Fayyad & Hamit Hamutcu
KDD 2019 IADSS Workshop - Research Updates from Usama Fayyad & Hamit HamutcuKDD 2019 IADSS Workshop - Research Updates from Usama Fayyad & Hamit Hamutcu
KDD 2019 IADSS Workshop - Research Updates from Usama Fayyad & Hamit Hamutcu
 
Big Data Driven Solutions to Combat Covid' 19
Big Data Driven Solutions to Combat Covid' 19Big Data Driven Solutions to Combat Covid' 19
Big Data Driven Solutions to Combat Covid' 19
 
Denodo Platform 7.0: What's New?
Denodo Platform 7.0: What's New?Denodo Platform 7.0: What's New?
Denodo Platform 7.0: What's New?
 
Webinar: NoSQL as the New Normal
Webinar: NoSQL as the New NormalWebinar: NoSQL as the New Normal
Webinar: NoSQL as the New Normal
 
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
Building a healthy data ecosystem around Kafka and Hadoop: Lessons learned at...
 
Pinterest - Big Data Machine Learning Platform at Pinterest
Pinterest - Big Data Machine Learning Platform at PinterestPinterest - Big Data Machine Learning Platform at Pinterest
Pinterest - Big Data Machine Learning Platform at Pinterest
 
3 Reasons Data Virtualization Matters in Your Portfolio
3 Reasons Data Virtualization Matters in Your Portfolio3 Reasons Data Virtualization Matters in Your Portfolio
3 Reasons Data Virtualization Matters in Your Portfolio
 
Webinar: Scaling MongoDB
Webinar: Scaling MongoDBWebinar: Scaling MongoDB
Webinar: Scaling MongoDB
 
(R17A0528) BIG DATA ANALYTICS.pdf
(R17A0528) BIG DATA ANALYTICS.pdf(R17A0528) BIG DATA ANALYTICS.pdf
(R17A0528) BIG DATA ANALYTICS.pdf
 
(R17A0528) BIG DATA ANALYTICS.pdf
(R17A0528) BIG DATA ANALYTICS.pdf(R17A0528) BIG DATA ANALYTICS.pdf
(R17A0528) BIG DATA ANALYTICS.pdf
 
High-performance database technology for rock-solid IoT solutions
High-performance database technology for rock-solid IoT solutionsHigh-performance database technology for rock-solid IoT solutions
High-performance database technology for rock-solid IoT solutions
 
Using a Semantic and Graph-based Data Catalog in a Modern Data Fabric
Using a Semantic and Graph-based Data Catalog in a Modern Data FabricUsing a Semantic and Graph-based Data Catalog in a Modern Data Fabric
Using a Semantic and Graph-based Data Catalog in a Modern Data Fabric
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
 
Secrets of Enterprise Data Mining: SQL Saturday Oregon 201411
Secrets of Enterprise Data Mining: SQL Saturday Oregon 201411Secrets of Enterprise Data Mining: SQL Saturday Oregon 201411
Secrets of Enterprise Data Mining: SQL Saturday Oregon 201411
 
Analytical Innovation: How to Build the Next Generation Data Platform
Analytical Innovation: How to Build the Next Generation Data PlatformAnalytical Innovation: How to Build the Next Generation Data Platform
Analytical Innovation: How to Build the Next Generation Data Platform
 
Webinar: Faster Big Data Analytics with MongoDB
Webinar: Faster Big Data Analytics with MongoDBWebinar: Faster Big Data Analytics with MongoDB
Webinar: Faster Big Data Analytics with MongoDB
 
Big Data Evolution
Big Data EvolutionBig Data Evolution
Big Data Evolution
 
Marvin Platform – Potencializando equipes de Machine Learning
Marvin Platform – Potencializando equipes de Machine LearningMarvin Platform – Potencializando equipes de Machine Learning
Marvin Platform – Potencializando equipes de Machine Learning
 
Pratical Deep Dive into the Semantic Web - #smconnect
Pratical Deep Dive into the Semantic Web - #smconnectPratical Deep Dive into the Semantic Web - #smconnect
Pratical Deep Dive into the Semantic Web - #smconnect
 

Plus de Debmalya Biswas

Privacy Policies Change Management for Smartphones
Privacy Policies Change Management for SmartphonesPrivacy Policies Change Management for Smartphones
Privacy Policies Change Management for Smartphones
Debmalya Biswas
 

Plus de Debmalya Biswas (13)

Constraints Enabled Autonomous Agent Marketplace: Discovery and Matchmaking
Constraints Enabled Autonomous Agent Marketplace: Discovery and MatchmakingConstraints Enabled Autonomous Agent Marketplace: Discovery and Matchmaking
Constraints Enabled Autonomous Agent Marketplace: Discovery and Matchmaking
 
Responsible Generative AI Design Patterns
Responsible Generative AI Design PatternsResponsible Generative AI Design Patterns
Responsible Generative AI Design Patterns
 
Sustainable & Composable Generative AI
Sustainable & Composable Generative AISustainable & Composable Generative AI
Sustainable & Composable Generative AI
 
Data-Driven (Reinforcement Learning-Based) Control
Data-Driven (Reinforcement Learning-Based) ControlData-Driven (Reinforcement Learning-Based) Control
Data-Driven (Reinforcement Learning-Based) Control
 
Regulating Generative AI - LLMOps pipelines with Transparency
Regulating Generative AI - LLMOps pipelines with TransparencyRegulating Generative AI - LLMOps pipelines with Transparency
Regulating Generative AI - LLMOps pipelines with Transparency
 
MLOps for Compositional AI
MLOps for Compositional AIMLOps for Compositional AI
MLOps for Compositional AI
 
A Privacy Framework for Hierarchical Federated Learning
A Privacy Framework for Hierarchical Federated LearningA Privacy Framework for Hierarchical Federated Learning
A Privacy Framework for Hierarchical Federated Learning
 
Edge AI Framework for Healthcare Applications
Edge AI Framework for Healthcare ApplicationsEdge AI Framework for Healthcare Applications
Edge AI Framework for Healthcare Applications
 
Privacy Preserving Chatbot Conversations
Privacy Preserving Chatbot ConversationsPrivacy Preserving Chatbot Conversations
Privacy Preserving Chatbot Conversations
 
Reinforcement Learning based HVAC Optimization in Factories
Reinforcement Learning based HVAC Optimization in FactoriesReinforcement Learning based HVAC Optimization in Factories
Reinforcement Learning based HVAC Optimization in Factories
 
Delayed Rewards in the context of Reinforcement Learning based Recommender ...
Delayed Rewards in the context of Reinforcement Learning based Recommender ...Delayed Rewards in the context of Reinforcement Learning based Recommender ...
Delayed Rewards in the context of Reinforcement Learning based Recommender ...
 
Privacy-Preserving Outsourced Profiling
Privacy-Preserving Outsourced ProfilingPrivacy-Preserving Outsourced Profiling
Privacy-Preserving Outsourced Profiling
 
Privacy Policies Change Management for Smartphones
Privacy Policies Change Management for SmartphonesPrivacy Policies Change Management for Smartphones
Privacy Policies Change Management for Smartphones
 

Dernier

Dernier (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 

Building an enterprise Natural Language Search Engine with ElasticSearch and Facebook’s DrQA

  • 1. Building an enterprise Natural Language Search Engine with ElasticSearch and Facebook’s DrQA Louis Baligand, Debmalya Biswas Berlin Buzzwords, 17 June 2019 Enterprise Architecture
  • 2. PMI INFORMATION SERVICES 2016 About 2 https://github.com/philipmorrisintl Debmalya Biswas Louis Baligand
  • 3. “Forrester defines cognitive search and knowledge discovery solutions as A new generation of enterprise search solutions that employ AI technologies such as natural language processing and machine learning to ingest, understand, organize, and query digital content from multiple data sources. 3
  • 4. ““ The average interaction worker spends [...] nearly 20 percent (of the workweek) looking for internal information.” -MGI Report, 2012. 4 Half (54%) of global information workers said, "My work gets interrupted because I can't find or get access to information I need to complete my tasks" a few times a month or more often. -Forrester Data Global Business Technographics Devices And Security Workforce Survey, 2016.
  • 5. PMI INFORMATION SERVICES 2016 Enterprise Search vs. Web Search 6 Enterprise Search Web Searchvs. Multiple content types Limited tagging/metadata management Role-based content trimming Small amount of content Single source (web pages) Large investments in SEO (*) (*): Search Engine Optimization No visibility restrictions (public pages) Enormous amount of content No team in charge of Search Experience Search xxperience as core business Employees are the end-users WWW users
  • 6. PMI INFORMATION SERVICES 2016 Natural Language Search (NLS) 7 Knowledge Graph
  • 7. PMI INFORMATION SERVICES 2016 Chatbots and Natural Language Search Natural Language Search (Neural Networks)  Works on documents.  Users can ask any question from the documents.  Both the documents and questions are passed through the same Neural Network, producing the matching answer. Intent based Chatbots (Statistical Methods)  Requires Q&A knowledge.  Able to scale with respect to question variants by applying Statististical Clustering Methods, e.g. tf- idf, Bag-of-Words - to cluster question variants into ‘intents’. (Rules based) FAQs .  Works only for specific hardcoded questions.  The only way to scale with respect to question variants, is to extend the knowledgebase by manually adding variants of a question. “How do I replace the heating component of my iQoS?” = “Tell me how to change the heating component of my iQoS” <Q> how replace heating component iQoS <Q> how change heating component iQoS Same Intent #repairIQOS Document data base Neural Network <Q> Neural Network (Offline) (Real-time) <A>
  • 8. PMI INFORMATION SERVICES 2016 Chatbots and Natural Language Search (2) 3- tier strategy:  A Chatbot with its pre- defined Q&A set remains the entry point – think of it as the 1st line of defense.  If the bot encounters a user query which cannot be mapped to one of its pre- configured intents, it performs a NLS over its KB. This is the 2nd line of defense.  If the user is not satisfied even with search results, plan for a final handover to a live agent. Ref: “Chatbots & Natural Language Search: 2 sides of the same coin?” (link)
  • 9. PMI INFORMATION SERVICES 2016 • End-user searching for products (not answer) • Filter-Oriented • Rates, Review 10 Positioning vs e-commerce search
  • 10. PMI INFORMATION SERVICES 2016 Philip Morris’ Use case: Operator Trainings • Hundreds to thousands of operators • Long manuals with specific terminology • A 1min downtime of a machine would lead to 20,000 cigarettes unmade • Typical Full text Search (Boolean search, no relevancy score) • Document Management System Manually classified • On-boarding difficulty 11
  • 11. PMI INFORMATION SERVICES 2016 Example of fine-grained results 12 Q. How many knives are there on the drums?
  • 12. PMI INFORMATION SERVICES 2016 Question Answering? • Squad Dataset: a reference in Question Answering • 100,000+ Q&A on Wikipedia articles • State of the art is beating Human Performance 14
  • 13. PMI INFORMATION SERVICES 2016 DrQA Overview • Facebook AI Research, ACL 2017, Reading Wikipedia to answer Open-Domain Questions. • Open source, BSD License https://github.com/facebookr esearch/DrQA • Pre-trained model available 15 https://github.com/facebookresearch/DrQA
  • 14. PMI INFORMATION SERVICES 2016 DrQA Overview 16 Bigram TFIDF Bi-direct. RNN
  • 15. PMI INFORMATION SERVICES 2016 DrQA is easy to use on your own corpus! 17 $ pythonbuild_db.py /path/to/data /path/to/saved/db.db $ pythonbuild_tfidf.py /path/to/doc/db /path/to/output/dir 0.06 0.02 0.03 0.08 Terms Docs $ pythoninteractive.py –reader-modelmultitask.mdl –retriever-modelpath/to/tfidf –doc-db path/to/saved/db.db >>>process('Whatis theanswertolife,the universe,andeverything?’) Top Predictions: +------+--------+---------------------------------------------------+--------------+-----------+ | Rank| Answer| Doc | AnswerScore|DocScore| +------+--------+---------------------------------------------------+--------------+-----------+ | 1 | 42 | PhrasesfromThe Hitchhiker'sGuide tothe Galaxy | 47242 | 141.26 | +------+--------+---------------------------------------------------+--------------+-----------+ Pre-trained model open sourced
  • 16. PMI INFORMATION SERVICES 2016 DrQA to answer Operator’s questions? 18 • Java toolkit to extract text + metadata from DOCX, PPT, XLS, PDF, JPEG, etc… • Apache Software Foundation • OCR
  • 17. PMI INFORMATION SERVICES 2016 DrQA to answer Operator’s questions? 19 https://github.com/facebookresearch/DrQA P@5: 76% • Not a voice assistant • End user needs at least ~95% • Full control on the retriever • First stage to prioritize
  • 18. PMI INFORMATION SERVICES 2016 Introducing Elasticsearch • Open source distributed • Highly scalable • RESTful API on top of Lucene capabilities • Support for Full Text search (best of bread) • Easy to configure + extend • Seamlessly manage conflicts • Active community & popular 21
  • 19. PMI INFORMATION SERVICES 2016 Integrating Elasticsearch to DrQA’s pipeline 22 Index
  • 20. PMI INFORMATION SERVICES 2016 Integrating Elasticsearch to DrQA’s pipeline 23 >>>fromdrqa.pipeline importDrQA >>>fromdrqa.retrieverimportElasticDocRanker >>>model= DrQA(reader_model=‘reader_model.mdl’, ranker_config={'class':ElasticDocRanker, 'options':{'elastic_url':'127.0.0.1:9200’, 'elastic_index':'mini’, 'elastic_fields':'content’, 'elastic_field_doc_name':['file','filename’], 'elastic_field_content': 'content’}}) >>>model.process(’Howthe tensioningoftheV-belts shouldbe done?’) Directly point to your server hosting Elastic Enable to search in any fields, e.g. uni-grams, bi- grams, title, metadata, etc…
  • 21. PMI INFORMATION SERVICES 2016 The pipeline performance 24 P@5: 76% 84% P@5 ref.: 78% (DrQA) F1 score: 42% F1 score ref.: 79% (DrQA) • DrQA span +- 10 tokens: 94% of 1st result contains true answer
  • 22. PMI INFORMATION SERVICES 2016 Take aways  Address pain points by combining Document Retrieval with Question Answering  If not answered, it will provide much more granular insights of the data  User elicitation & user experience: a top down approach  End user does not know what to ask 25
  • 23. PMI INFORMATION SERVICES 2016 Future work – Extend pipeline with BERT*  A general-purpose architecture to train models for multiple NLP tasks (sentiment analysis, etc…)  State of the art for SQuAD  Open source, published in Oct. 2018 by Google AI Research  High memory required: GPU with at least 12GB of RAM (Base model)  Enable to multi-language queries 26 *https://arxiv.org/abs/1810.04805, https://github.com/google-research/bert • Add one layer to compute Pstart(“token”) & Pend(“token”) for each tokens • Find the best pair by maximizing Pstart(“token1”) * Pend(“token2”)

Notes de l'éditeur

  1. This includes PMI taking part in the open source community. Check out our github to see the highly popular repos we have contributed to.
  2. According to a report from McKinsey, workers spend 20% percent of their time looking for internal information ...
  3. According to a report from McKinsey, workers spend 20% percent of their time looking for internal information ...
  4. Content The amount of content stored in PMI is ridiculously small compared to what Google crawls everyday. It should therefore be an advantage for PMI Enterprise Search. Traffic While from an infrastructure side, handling more traffic is more challenging, it actually offers more possibilities to capture data related to search queries that can be further used to train machine-learning algorithms to optimize the search experience (e.g. suggest / auto-complete queries and boost related most relevant pages). Google holds a huge advantage on that front. Content Sources At PMI, content is fragmented and stored in many locations. This creates difficulties to implement content crawlers that expose content in different ways (APIs, flat files + DB for meta-data etc.). On the Google side, only one type of content is actually crawled: Web pages (including all attached images etc.). Scale is larger but the variety smaller. Information Management At PMI, there are currently no strong practices around information architecture and management. Therefore, all types of information are mixed, irrespective of their business value for PMI, and relevance for the users. On the Google side, companies invest large amounts of resources into SEO and gain proper visibility in search results Security In an enterprise, access to documents / information are controlled to ensure compliance and protection of sensitive data. This poses a challenge when crawling sources which use ACLs to control access, since those ACLs must be imported to filter out search results that some users should not see. Google only works with public content, which completely removes that constraint. Search Experience Google’s core business relies on effective search and targeted advertisements. They hire the best engineers to work on AI to constantly adjust the quality of the search results. At PMI, there is no such team (even small scale) that is tasked to monitor and continuously improve search relevance. Also, from a skill perspective, it is unrealistic to think it is possible to get even close to Google.