SlideShare a Scribd company logo
1 of 46
Download to read offline
Machine Learning Applied -
Contextual Chatbots Coding,
Oracle JET andTensorFlow
Andrejus Baranovskis, CEO andTechnical Expert, Red Samurai Consulting
Oracle ACE Director and Oracle Groundbreaker Ambassador
Oracle ExpertsTeam
ADF, JET, ORACLE FUSION, ORACLE CLOUD, MACHINE LEARNING
Oracle PaaS Partner Community Award for Outstanding Java Cloud
Service Contribution 2017
Session Goal
HowTo BuildYour Own Machine Learning Chatbot
AGENDA
• Technical Architecture
• Solution WalkThrough
• Machine Learning Introduction
• Implementation Points
TECHNICAL ARCHITECTURE
Machine Learning Chatbot Context Communication Chatbot UI
Classification Chatbot messaging
Oracle JET
Chatbot Custom application logic
Generic listener
Oracle JET
CHATBOT CONTEXT
• Chatbot framework needs a structure in which conversational intents are
defined (this can be JSON file)
• Conversational intent contains:
• tag (unique name)
• patterns (sentence patterns for neural network text classifier)
• responses (one will be used as a response)
SOLUTION WALKTHROUGH
GENTLE INTRODUCTIONTO MACHINE
LEARNING
LEARNING AND INFERENCE
Training data Feature vector Learning algorithm Model
Test data Feature vector Model Prediction
KEY PARAMETERS
• Cost Function - score for each candidate parameter, shows sum of
errors in predicting.The higher the cost, the worse the model
parameters will be
• Epoch - each step of looping through all data to update the model
parameters
• Learning rate - the size of the learning step
REGRESSION
Regression
algorithm
Input Output
Continuous
Continuous
Discrete
REGRESSION EXAMPLE
w - parameter to be found usingTensorFlow
CLASSIFICATION
f{x}
Input Output
DiscreteContinuous
Discrete
Classifier
CLASSIFICATION EXAMPLE
Linear boundary line learned from the training data - equal probability for both groups
WHYTENSORFLOW?
• TensorFlow has become the tool of choice to implement machine
learning solutions
• Developed by Google and supported by its flourishing community
• Gives a way to easily implement industry-standard code
CLASSIFICATION IMPLEMENTATION
STEP 1: PREPARING DATA
• Tokenise patterns into array of words
• Lower case and stem all words. Example: Pharmacy => pharm.
Attempt to represent related words
• Create list of classes - intents
• Create list of documents - combination between list of patterns and
list of intents
STEP 1: PREPARING DATA
STEP 2: PREPARINGTENSORFLOW INPUT
• [X: [0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, ...N],Y: [0, 0, 1, 0, 0, 0, ...M]]
• [X: [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, ...N],Y: [0, 0, 0, 1, 0, 0, ...M]]
• Array representing pattern with 0/1. N = vocabulary size. 1 when
word position in vocabulary is matching word from pattern
• Array representing intent with 0/1. M = number of intents. 1 when
intent position in list of intents/classes is matching current intent
STEP 2: PREPARINGTENSORFLOW INPUT
STEP 3:TRAINING NEURAL NETWORK
• Use tflearn - deep learning library featuring a higher-level API forTensorFlow
• Define X input shape - equal to word vocabulary size
• Define two layers with 8 hidden neurones - optimal for text classification task
(based on experiments)
• DefineY input shape - equal to number of intents
• Apply regression to find the best equation parameters
STEP 3:TRAINING NEURAL NETWORK
• Define Deep Neural Network model (DNN)
• Run model.fit to construct classification model. Provide X/Y inputs,
number of epochs and batch size
• Per each epoch, multiple operations are executed to find optimal
model parameters to classify future input converted to array of 0/1
STEP 3:TRAINING NEURAL NETWORK
• Batch size:
• Smaller batch size requires less memory. Especially important for datasets
with large vocabulary
• Typically networks train faster with smaller batches.Weights and network
parameters are updated after each propagation
• The smaller the batch the less accurate estimate of the gradient (function
which describes the data) could be
STEP 3:TRAINING NEURAL NETWORK
STEP 4: INITIAL MODELTESTING
• Tokenise input sentence - split it into array of words
• Create bag of words (array with 0/1) for the input sentence - array
equal to the size of vocabulary, with 1 for each word found in input
sentence
• Run model.predict with given bag of words array, this will return
probability for each intent
STEP 4: INITIAL MODELTESTING
STEP 5: REUSETRAINED MODEL
• For better reusability, it is recommended to create separate
TensorFlow notebook, to handle classification requests
• We can reuse previously created DNN model, by loading it with
TensorFlow pickle
STEP 5: REUSETRAINED MODEL
STEP 6:TEXT CLASSIFICATION
• Define REST interface, so that function will be accessible outside
TensorFlow
• Convert incoming sentence into bag of words array and run
model.predict
• Consider results with probability higher than 0.25 to filter noise
• Return multiple identified intents (if any), together with assigned probability
STEP 6:TEXT CLASSIFICATION
IMPLEMENTATION POINTS
QUESTIONS
CONTACTS
• Andrejus Baranovskis (https://andrejusb.blogspot.com)
• Email: abaranovskis@redsamuraiconsulting.com
• Twitter: @andrejusb
• LinkedIn: https://www.linkedin.com/in/andrejus-baranovskis-251b392
• Web: http://redsamuraiconsulting.com
REFERENCES
• Source Code - https://github.com/abaranovskis-redsamurai/shenzhen
• Contextual Chatbot inTensorFlow - https://bit.ly/2pFbTw4
• TensorFlow Book - http://tensorflowbook.com/

More Related Content

What's hot

The vector space model
The vector space modelThe vector space model
The vector space modelpkgosh
 
Text classification with Weka
Text classification with WekaText classification with Weka
Text classification with WekaMilad Alshomary
 
On Semi-Supervised Learning and Beyond
On Semi-Supervised Learning and BeyondOn Semi-Supervised Learning and Beyond
On Semi-Supervised Learning and BeyondEunjeong (Lucy) Park
 
2015 07-tuto1-phrase mining
2015 07-tuto1-phrase mining2015 07-tuto1-phrase mining
2015 07-tuto1-phrase miningjins0618
 
Text classification-php-v4
Text classification-php-v4Text classification-php-v4
Text classification-php-v4Glenn De Backer
 
ClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLGeorge Simov
 
MaxEnt (Loglinear) Models - Overview
MaxEnt (Loglinear) Models - OverviewMaxEnt (Loglinear) Models - Overview
MaxEnt (Loglinear) Models - Overviewananth
 
Text classification using Text kernels
Text classification using Text kernelsText classification using Text kernels
Text classification using Text kernelsDev Nath
 
Understanding the Machine Learning Algorithms
Understanding the Machine Learning AlgorithmsUnderstanding the Machine Learning Algorithms
Understanding the Machine Learning AlgorithmsRupak Roy
 
slides
slidesslides
slidesbutest
 
Boolean,vector space retrieval Models
Boolean,vector space retrieval Models Boolean,vector space retrieval Models
Boolean,vector space retrieval Models Primya Tamil
 
Topic Pages. From articles to answers.
Topic Pages. From articles to answers.Topic Pages. From articles to answers.
Topic Pages. From articles to answers.Deep Kayal
 
An Overview of Naïve Bayes Classifier
An Overview of Naïve Bayes Classifier An Overview of Naïve Bayes Classifier
An Overview of Naïve Bayes Classifier ananth
 
Machine Learning Comparative Analysis - Part 1
Machine Learning Comparative Analysis - Part 1Machine Learning Comparative Analysis - Part 1
Machine Learning Comparative Analysis - Part 1Kaniska Mandal
 

What's hot (20)

The vector space model
The vector space modelThe vector space model
The vector space model
 
Text classification with Weka
Text classification with WekaText classification with Weka
Text classification with Weka
 
On Semi-Supervised Learning and Beyond
On Semi-Supervised Learning and BeyondOn Semi-Supervised Learning and Beyond
On Semi-Supervised Learning and Beyond
 
Term weighting
Term weightingTerm weighting
Term weighting
 
2015 07-tuto1-phrase mining
2015 07-tuto1-phrase mining2015 07-tuto1-phrase mining
2015 07-tuto1-phrase mining
 
Text classification-php-v4
Text classification-php-v4Text classification-php-v4
Text classification-php-v4
 
ClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureMLClassifyingIssuesFromSRTextAzureML
ClassifyingIssuesFromSRTextAzureML
 
MaxEnt (Loglinear) Models - Overview
MaxEnt (Loglinear) Models - OverviewMaxEnt (Loglinear) Models - Overview
MaxEnt (Loglinear) Models - Overview
 
Ai group-seminar-2013 nbc
Ai group-seminar-2013 nbcAi group-seminar-2013 nbc
Ai group-seminar-2013 nbc
 
Text classification using Text kernels
Text classification using Text kernelsText classification using Text kernels
Text classification using Text kernels
 
Understanding the Machine Learning Algorithms
Understanding the Machine Learning AlgorithmsUnderstanding the Machine Learning Algorithms
Understanding the Machine Learning Algorithms
 
slides
slidesslides
slides
 
[ppt]
[ppt][ppt]
[ppt]
 
Boolean,vector space retrieval Models
Boolean,vector space retrieval Models Boolean,vector space retrieval Models
Boolean,vector space retrieval Models
 
Java -lec-6
Java -lec-6Java -lec-6
Java -lec-6
 
Tries
TriesTries
Tries
 
Topic Pages. From articles to answers.
Topic Pages. From articles to answers.Topic Pages. From articles to answers.
Topic Pages. From articles to answers.
 
An Overview of Naïve Bayes Classifier
An Overview of Naïve Bayes Classifier An Overview of Naïve Bayes Classifier
An Overview of Naïve Bayes Classifier
 
Ir models
Ir modelsIr models
Ir models
 
Machine Learning Comparative Analysis - Part 1
Machine Learning Comparative Analysis - Part 1Machine Learning Comparative Analysis - Part 1
Machine Learning Comparative Analysis - Part 1
 

Similar to Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow

Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlowMachine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlowandrejusb
 
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...Big Data Spain
 
Оформление пайплайна в NLP проекте​, Виталий Радченко. 22 июня, 2019
Оформление пайплайна в NLP проекте​, Виталий Радченко. 22 июня, 2019Оформление пайплайна в NLP проекте​, Виталий Радченко. 22 июня, 2019
Оформление пайплайна в NLP проекте​, Виталий Радченко. 22 июня, 2019Mail.ru Group
 
NLP and Deep Learning for non_experts
NLP and Deep Learning for non_expertsNLP and Deep Learning for non_experts
NLP and Deep Learning for non_expertsSanghamitra Deb
 
Rasa NLU and ML Interpretability
Rasa NLU and ML InterpretabilityRasa NLU and ML Interpretability
Rasa NLU and ML Interpretabilityztopol
 
Demystifying NLP Transformers: Understanding the Power and Architecture behin...
Demystifying NLP Transformers: Understanding the Power and Architecture behin...Demystifying NLP Transformers: Understanding the Power and Architecture behin...
Demystifying NLP Transformers: Understanding the Power and Architecture behin...NILESH VERMA
 
DLT UNIT-3.docx
DLT  UNIT-3.docxDLT  UNIT-3.docx
DLT UNIT-3.docx0567Padma
 
Machine Learning for Software Maintainability
Machine Learning for Software MaintainabilityMachine Learning for Software Maintainability
Machine Learning for Software MaintainabilityValerio Maggio
 
LLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team StructureAggregage
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Saurabh Kaushik
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBLisa Roth, PMP
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB
 
Neural Models for Information Retrieval
Neural Models for Information RetrievalNeural Models for Information Retrieval
Neural Models for Information RetrievalBhaskar Mitra
 
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...Lucidworks
 
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech TalksA Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech TalksAmazon Web Services
 
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech TalksA Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech TalksAmazon Web Services
 
Introduction to tensorflow
Introduction to tensorflowIntroduction to tensorflow
Introduction to tensorflowviraj Salunkhe
 
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB
 

Similar to Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow (20)

Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlowMachine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow
 
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
TENSORFLOW: ARCHITECTURE AND USE CASE - NASA SPACE APPS CHALLENGE by Gema Par...
 
Оформление пайплайна в NLP проекте​, Виталий Радченко. 22 июня, 2019
Оформление пайплайна в NLP проекте​, Виталий Радченко. 22 июня, 2019Оформление пайплайна в NLP проекте​, Виталий Радченко. 22 июня, 2019
Оформление пайплайна в NLP проекте​, Виталий Радченко. 22 июня, 2019
 
presentation.ppt
presentation.pptpresentation.ppt
presentation.ppt
 
NLP and Deep Learning for non_experts
NLP and Deep Learning for non_expertsNLP and Deep Learning for non_experts
NLP and Deep Learning for non_experts
 
Rasa NLU and ML Interpretability
Rasa NLU and ML InterpretabilityRasa NLU and ML Interpretability
Rasa NLU and ML Interpretability
 
Demystifying NLP Transformers: Understanding the Power and Architecture behin...
Demystifying NLP Transformers: Understanding the Power and Architecture behin...Demystifying NLP Transformers: Understanding the Power and Architecture behin...
Demystifying NLP Transformers: Understanding the Power and Architecture behin...
 
Deep Learning for Machine Translation
Deep Learning for Machine TranslationDeep Learning for Machine Translation
Deep Learning for Machine Translation
 
DLT UNIT-3.docx
DLT  UNIT-3.docxDLT  UNIT-3.docx
DLT UNIT-3.docx
 
Machine Learning for Software Maintainability
Machine Learning for Software MaintainabilityMachine Learning for Software Maintainability
Machine Learning for Software Maintainability
 
LLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team Structure
 
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2 Engineering Intelligent NLP Applications Using Deep Learning – Part 2
Engineering Intelligent NLP Applications Using Deep Learning – Part 2
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
 
Neural Models for Information Retrieval
Neural Models for Information RetrievalNeural Models for Information Retrieval
Neural Models for Information Retrieval
 
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
Implementing Conceptual Search in Solr using LSA and Word2Vec: Presented by S...
 
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech TalksA Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
 
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech TalksA Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
A Deeper Dive into Apache MXNet - March 2017 AWS Online Tech Talks
 
Introduction to tensorflow
Introduction to tensorflowIntroduction to tensorflow
Introduction to tensorflow
 
MongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB World 2019: Fast Machine Learning Development with MongoDB
MongoDB World 2019: Fast Machine Learning Development with MongoDB
 

More from andrejusb

Machine Learning Applied - Tabular Dataset Models and Sentiment Analysis
Machine Learning Applied - Tabular Dataset Models and Sentiment AnalysisMachine Learning Applied - Tabular Dataset Models and Sentiment Analysis
Machine Learning Applied - Tabular Dataset Models and Sentiment Analysisandrejusb
 
JavaScript Development on Steroids with Oracle Visual Builder
JavaScript Development on Steroids with Oracle Visual BuilderJavaScript Development on Steroids with Oracle Visual Builder
JavaScript Development on Steroids with Oracle Visual Builderandrejusb
 
Reliable, Fast, Engaging Offline-First Architecture for JavaScript Applications
 Reliable, Fast, Engaging Offline-First Architecture for JavaScript Applications Reliable, Fast, Engaging Offline-First Architecture for JavaScript Applications
Reliable, Fast, Engaging Offline-First Architecture for JavaScript Applicationsandrejusb
 
Microservice Approach for Web Development with Micro Frontends
Microservice Approach for Web Development with Micro FrontendsMicroservice Approach for Web Development with Micro Frontends
Microservice Approach for Web Development with Micro Frontendsandrejusb
 
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and Tensorflow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorflowMachine Learning Applied - Contextual Chatbots Coding, Oracle JET and Tensorflow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and Tensorflowandrejusb
 
Oracle Development Cloud Service
Oracle Development Cloud ServiceOracle Development Cloud Service
Oracle Development Cloud Serviceandrejusb
 
Oracle Java Cloud Service: How to Estimate Production System Performance
Oracle Java Cloud Service: How to Estimate Production System PerformanceOracle Java Cloud Service: How to Estimate Production System Performance
Oracle Java Cloud Service: How to Estimate Production System Performanceandrejusb
 
Essential Kit for Oracle JET Programming
Essential Kit for Oracle JET ProgrammingEssential Kit for Oracle JET Programming
Essential Kit for Oracle JET Programmingandrejusb
 
Oracle JET and ADF BC REST Production Experience with Oracle Java Cloud
Oracle JET and ADF BC REST Production Experience with Oracle Java CloudOracle JET and ADF BC REST Production Experience with Oracle Java Cloud
Oracle JET and ADF BC REST Production Experience with Oracle Java Cloudandrejusb
 
Offline Web with Oracle JET
Offline Web with Oracle JETOffline Web with Oracle JET
Offline Web with Oracle JETandrejusb
 
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...andrejusb
 
Forms, ADF and JET a Non-Aggression Pact
Forms, ADF and JET a Non-Aggression PactForms, ADF and JET a Non-Aggression Pact
Forms, ADF and JET a Non-Aggression Pactandrejusb
 
Oracle JET CRUD and ADF BC REST
Oracle JET CRUD and ADF BC RESTOracle JET CRUD and ADF BC REST
Oracle JET CRUD and ADF BC RESTandrejusb
 
Oracle JET and WebSocket
Oracle JET and WebSocketOracle JET and WebSocket
Oracle JET and WebSocketandrejusb
 
Oracle Alta UI Patterns for Enterprise Applications and Responsive UI Support
Oracle Alta UI Patterns for Enterprise Applications and Responsive UI SupportOracle Alta UI Patterns for Enterprise Applications and Responsive UI Support
Oracle Alta UI Patterns for Enterprise Applications and Responsive UI Supportandrejusb
 
ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14andrejusb
 
Data Caching Strategies for Oracle Mobile Application Framework
Data Caching Strategies for Oracle Mobile Application FrameworkData Caching Strategies for Oracle Mobile Application Framework
Data Caching Strategies for Oracle Mobile Application Frameworkandrejusb
 
ADF Development Survival Kit
ADF Development Survival KitADF Development Survival Kit
ADF Development Survival Kitandrejusb
 
ADF Anti-Patterns: Dangerous Tutorials
ADF Anti-Patterns: Dangerous TutorialsADF Anti-Patterns: Dangerous Tutorials
ADF Anti-Patterns: Dangerous Tutorialsandrejusb
 

More from andrejusb (19)

Machine Learning Applied - Tabular Dataset Models and Sentiment Analysis
Machine Learning Applied - Tabular Dataset Models and Sentiment AnalysisMachine Learning Applied - Tabular Dataset Models and Sentiment Analysis
Machine Learning Applied - Tabular Dataset Models and Sentiment Analysis
 
JavaScript Development on Steroids with Oracle Visual Builder
JavaScript Development on Steroids with Oracle Visual BuilderJavaScript Development on Steroids with Oracle Visual Builder
JavaScript Development on Steroids with Oracle Visual Builder
 
Reliable, Fast, Engaging Offline-First Architecture for JavaScript Applications
 Reliable, Fast, Engaging Offline-First Architecture for JavaScript Applications Reliable, Fast, Engaging Offline-First Architecture for JavaScript Applications
Reliable, Fast, Engaging Offline-First Architecture for JavaScript Applications
 
Microservice Approach for Web Development with Micro Frontends
Microservice Approach for Web Development with Micro FrontendsMicroservice Approach for Web Development with Micro Frontends
Microservice Approach for Web Development with Micro Frontends
 
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and Tensorflow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorflowMachine Learning Applied - Contextual Chatbots Coding, Oracle JET and Tensorflow
Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and Tensorflow
 
Oracle Development Cloud Service
Oracle Development Cloud ServiceOracle Development Cloud Service
Oracle Development Cloud Service
 
Oracle Java Cloud Service: How to Estimate Production System Performance
Oracle Java Cloud Service: How to Estimate Production System PerformanceOracle Java Cloud Service: How to Estimate Production System Performance
Oracle Java Cloud Service: How to Estimate Production System Performance
 
Essential Kit for Oracle JET Programming
Essential Kit for Oracle JET ProgrammingEssential Kit for Oracle JET Programming
Essential Kit for Oracle JET Programming
 
Oracle JET and ADF BC REST Production Experience with Oracle Java Cloud
Oracle JET and ADF BC REST Production Experience with Oracle Java CloudOracle JET and ADF BC REST Production Experience with Oracle Java Cloud
Oracle JET and ADF BC REST Production Experience with Oracle Java Cloud
 
Offline Web with Oracle JET
Offline Web with Oracle JETOffline Web with Oracle JET
Offline Web with Oracle JET
 
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
End-to-End Cloud: Oracle Java Cloud, Oracle Mobile Cloud Service, Oracle MAF,...
 
Forms, ADF and JET a Non-Aggression Pact
Forms, ADF and JET a Non-Aggression PactForms, ADF and JET a Non-Aggression Pact
Forms, ADF and JET a Non-Aggression Pact
 
Oracle JET CRUD and ADF BC REST
Oracle JET CRUD and ADF BC RESTOracle JET CRUD and ADF BC REST
Oracle JET CRUD and ADF BC REST
 
Oracle JET and WebSocket
Oracle JET and WebSocketOracle JET and WebSocket
Oracle JET and WebSocket
 
Oracle Alta UI Patterns for Enterprise Applications and Responsive UI Support
Oracle Alta UI Patterns for Enterprise Applications and Responsive UI SupportOracle Alta UI Patterns for Enterprise Applications and Responsive UI Support
Oracle Alta UI Patterns for Enterprise Applications and Responsive UI Support
 
ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14ADF Mythbusters UKOUG'14
ADF Mythbusters UKOUG'14
 
Data Caching Strategies for Oracle Mobile Application Framework
Data Caching Strategies for Oracle Mobile Application FrameworkData Caching Strategies for Oracle Mobile Application Framework
Data Caching Strategies for Oracle Mobile Application Framework
 
ADF Development Survival Kit
ADF Development Survival KitADF Development Survival Kit
ADF Development Survival Kit
 
ADF Anti-Patterns: Dangerous Tutorials
ADF Anti-Patterns: Dangerous TutorialsADF Anti-Patterns: Dangerous Tutorials
ADF Anti-Patterns: Dangerous Tutorials
 

Recently uploaded

原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样AS
 
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理AS
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理F
 
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样AS
 
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Dewi Agency
 
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptxA LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptxthinamazinyo
 
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样AS
 
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformonhackersuli
 
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27APNIC
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书F
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理F
 
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsrahman018755
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样AS
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.krishnachandrapal52
 
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxResearch Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxi191686
 

Recently uploaded (20)

原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样
 
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
 
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
 
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
 
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptxA LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
 
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
 
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
[Hackersuli] Élő szövet a fémvázon: Python és gépi tanulás a Zeek platformon
 
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
 
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
一比一原版(毕业证书)新西兰怀特克利夫艺术设计学院毕业证原件一模一样
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxResearch Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
 

Machine Learning Applied - Contextual Chatbots Coding, Oracle JET and TensorFlow

  • 1. Machine Learning Applied - Contextual Chatbots Coding, Oracle JET andTensorFlow Andrejus Baranovskis, CEO andTechnical Expert, Red Samurai Consulting Oracle ACE Director and Oracle Groundbreaker Ambassador
  • 2. Oracle ExpertsTeam ADF, JET, ORACLE FUSION, ORACLE CLOUD, MACHINE LEARNING Oracle PaaS Partner Community Award for Outstanding Java Cloud Service Contribution 2017
  • 3. Session Goal HowTo BuildYour Own Machine Learning Chatbot
  • 4. AGENDA • Technical Architecture • Solution WalkThrough • Machine Learning Introduction • Implementation Points
  • 6. Machine Learning Chatbot Context Communication Chatbot UI Classification Chatbot messaging Oracle JET
  • 7. Chatbot Custom application logic Generic listener Oracle JET
  • 8. CHATBOT CONTEXT • Chatbot framework needs a structure in which conversational intents are defined (this can be JSON file) • Conversational intent contains: • tag (unique name) • patterns (sentence patterns for neural network text classifier) • responses (one will be used as a response)
  • 10.
  • 12. LEARNING AND INFERENCE Training data Feature vector Learning algorithm Model Test data Feature vector Model Prediction
  • 13. KEY PARAMETERS • Cost Function - score for each candidate parameter, shows sum of errors in predicting.The higher the cost, the worse the model parameters will be • Epoch - each step of looping through all data to update the model parameters • Learning rate - the size of the learning step
  • 15. REGRESSION EXAMPLE w - parameter to be found usingTensorFlow
  • 17. CLASSIFICATION EXAMPLE Linear boundary line learned from the training data - equal probability for both groups
  • 18. WHYTENSORFLOW? • TensorFlow has become the tool of choice to implement machine learning solutions • Developed by Google and supported by its flourishing community • Gives a way to easily implement industry-standard code
  • 20. STEP 1: PREPARING DATA • Tokenise patterns into array of words • Lower case and stem all words. Example: Pharmacy => pharm. Attempt to represent related words • Create list of classes - intents • Create list of documents - combination between list of patterns and list of intents
  • 22. STEP 2: PREPARINGTENSORFLOW INPUT • [X: [0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, ...N],Y: [0, 0, 1, 0, 0, 0, ...M]] • [X: [0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, ...N],Y: [0, 0, 0, 1, 0, 0, ...M]] • Array representing pattern with 0/1. N = vocabulary size. 1 when word position in vocabulary is matching word from pattern • Array representing intent with 0/1. M = number of intents. 1 when intent position in list of intents/classes is matching current intent
  • 24. STEP 3:TRAINING NEURAL NETWORK • Use tflearn - deep learning library featuring a higher-level API forTensorFlow • Define X input shape - equal to word vocabulary size • Define two layers with 8 hidden neurones - optimal for text classification task (based on experiments) • DefineY input shape - equal to number of intents • Apply regression to find the best equation parameters
  • 25. STEP 3:TRAINING NEURAL NETWORK • Define Deep Neural Network model (DNN) • Run model.fit to construct classification model. Provide X/Y inputs, number of epochs and batch size • Per each epoch, multiple operations are executed to find optimal model parameters to classify future input converted to array of 0/1
  • 26. STEP 3:TRAINING NEURAL NETWORK • Batch size: • Smaller batch size requires less memory. Especially important for datasets with large vocabulary • Typically networks train faster with smaller batches.Weights and network parameters are updated after each propagation • The smaller the batch the less accurate estimate of the gradient (function which describes the data) could be
  • 28. STEP 4: INITIAL MODELTESTING • Tokenise input sentence - split it into array of words • Create bag of words (array with 0/1) for the input sentence - array equal to the size of vocabulary, with 1 for each word found in input sentence • Run model.predict with given bag of words array, this will return probability for each intent
  • 29. STEP 4: INITIAL MODELTESTING
  • 30. STEP 5: REUSETRAINED MODEL • For better reusability, it is recommended to create separate TensorFlow notebook, to handle classification requests • We can reuse previously created DNN model, by loading it with TensorFlow pickle
  • 32. STEP 6:TEXT CLASSIFICATION • Define REST interface, so that function will be accessible outside TensorFlow • Convert incoming sentence into bag of words array and run model.predict • Consider results with probability higher than 0.25 to filter noise • Return multiple identified intents (if any), together with assigned probability
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 45. CONTACTS • Andrejus Baranovskis (https://andrejusb.blogspot.com) • Email: abaranovskis@redsamuraiconsulting.com • Twitter: @andrejusb • LinkedIn: https://www.linkedin.com/in/andrejus-baranovskis-251b392 • Web: http://redsamuraiconsulting.com
  • 46. REFERENCES • Source Code - https://github.com/abaranovskis-redsamurai/shenzhen • Contextual Chatbot inTensorFlow - https://bit.ly/2pFbTw4 • TensorFlow Book - http://tensorflowbook.com/