SlideShare a Scribd company logo
1 of 41
Download to read offline
4/4/2022
1
Como construir chatbots
inteligentes sin morir en el intento
@JordiCabot / @ingdesoftware / @xatkit– jordicabot.com / ingenieriadesoftware.es
Introduction
1
2
4/4/2022
2
About
SOM Research Lab
Software runs the world. Models run the software
3
4
4/4/2022
3
Nuestra misión
Interested in the broad area
of systems and software
engineering, especially
promoting the rigorous use
of software models and
engineering principles in
all software engineering
tasks.
Flickr/clement127
5
6
4/4/2022
4
Context
Can you help us create a chatbot to help
newcomers to write good bug reports on GitHub?
Sure! It’s just a set of questions &
answers, this will be pretty simple!
Narrator It wasn’t.
Once upon a time in 2018 (we were
young and naïve)
7
8
4/4/2022
5
We were asked to build a bot. We ended up
building a bot platform
But at least we’ve
learnt some things
along the way that
today we want to
share with you
3 times so far!
Why you all need to have
some bot building notions
9
10
4/4/2022
6
And more predictions:
- By 2024, consumer retail spend via chatbots worldwide will reach $142 billion—up from just
$2.8 billion in 2019.
Chatbot market is worth over 1 Billion USD
11
12
4/4/2022
7
Chatbots <-> Software engineers
• Software Engineers -> Chatbot
– Chatbots are a new type of software artefact that
we’ll need to consider in our dev projects
• Chatbot -> Software Engineering
– Bots are more and more playing a supportive role in
many SE tasks (e.g. in GH) so better to know how they
work and their limitations
13
14
4/4/2022
8
Hidden Technical debt in Machine Learning Systems - Google -
https://proceedings.neurips.cc/paper/2015/file/86df7dcfd896fcaf2674f757a
2463eba-Paper.pdf
15
16
4/4/2022
9
Core chatbot concepts
What is exactly a Chatbot?
• Bot are software components
• Chatbot = Bot + Chat interface
– Tb llamado asistente digital, asistente
virtual,…
• Voicebot = Chatbot + Voice Interface
Voicebot
Chatbot
Bot
17
18
4/4/2022
10
VoiceBot
• Alexa, Google Assistant ,…
• They all hide a chatbot inside
1. Speech-to-text
2. Process the text as a
chatbot
3. Text-to-speech to reply
Chatbot vs LiveChat
• LiveChat: a person is behind
• They can be combined
– Bot  Person: when the bot doesn’t know how to
answer (or the visitor is specially “interesting”)
– Person  Bot: when no support person is available
or the client is not worth
19
20
4/4/2022
11
Examples of bots
21
22
4/4/2022
12
23
24
4/4/2022
13
Types of chatbots
Types of chatbots
Button-
based (no AI)
Intent-based
Open
questions
Open
domain
25
26
4/4/2022
14
We ignore open-domain bots (e.g. LaMDA)
• They can chat about
everything but
– A complete black-box
– ``Useless’’ for a specific
business
https://mindmatters.ai/2022/03/the-ai-illusion-state-of-the-art-chatbots-arent-what-
they-seem/
Creating a chatbot
1 – Why is it so challeging?
27
28
4/4/2022
15
Software
(bot
part)
NLU
(chat
part)
Complexity of chatbots
Chat
bots
Many pieces to assemble
Input/Output
Messaging channels
External
Platforms
NLU Engine
Events!
29
30
4/4/2022
16
Chatbots are complex software systems
Conversation Logic
Text Processing
External Services
Messaging
Platforms
Deployment
Evolution
Maintenance
Tests
J Cabot, L Burgueño, R Clarisó, G Daniel, J Perianez-
Pascual, R Rodríguez-Echeverría:
Testing challenges for NLP-intensive
bots. BotSE@ICSE 2021: 31-34
Creating a chatbot
2 – The NLP component
31
32
4/4/2022
17
How NLP works in chatbots
Bots and NLP/NLU
• At the core of all AI bots there is a NLU/NLP
engine with two key missions
– Classify the user utterance (i.e. input text) in
one of the intents (set of possible
questions/requests) the bot understands
– Identify the parameters (called « entities »)
from the utterance
33
34
4/4/2022
18
NLP in a chatbot implies
Parameters (entities)
I would like to order a medium pepperoni pizza
Intent
Input text (utterance)
• Understand what the user is trying to ask the bot
• Identify and gather the data in the request that the bot needs to construct
the response
35
36
4/4/2022
19
NLU approaches
• Regular expressions
• Require an almost exact match. Only useful for very concrete cases
• Grammar-based approaches
• Useful for small domains with a very specific vocabulary and constructs
• E.g. Stanford Parser
• Neural Networks - Multiclass classifiers
1. You provide some training sentences for each intent (the "classes" ).
2. The classifier learns from these sentences
3. It assigns any new input text to one of the classes (with %confidence)
Hi
Good morning
Good afternoon
Hello
Morning!
Example: bot that greets you, informs about
the schedule and lets you buy a pizza
Greetings
I’d like to buy a
pizza
I want a pizza
Can I order a
pizza?
Buy
Are you open?
Is it open now?
What are your
opening hours?
At what time do
you start?
Schedule
If a user says, “I would like to order a pizza now” what is the closest intent?
Not that easy when intents start to overlap (e.g. offering a job vs looking
for a job: “can I offer you a job?” vs “do you have any job offer”)
37
38
4/4/2022
20
Entity recognition
• We need to understand the intent but also identify the entities
• Much easier if PizzaType is an enumeration ({ Pepperoni, Veggie, Hawaian ,…})
instead of the any string
ChooseYourPizza
I’d like a PizzaType pizza
I’m taking a PizzaType pizza
I think I’m going for a PizzaType
39
40
4/4/2022
21
Common tricks in NLU Engines
• Stemmers identify the lemma of the word (e.g. to focus on the verb, not on
the tense of the verb for matching purposes)
• Synonyms and paraphrasing are an automatic way to expand the training
sentences
• Entity augmentation also generalize training sentences
• E.g. What’s the weather in Barcelona -> What’s the weather in @city
• Augmentation is possible for a large number of data types and common concepts
(measures, countries, dates,…)
Taking a closer look at the NN
https://github.com/xatkit-bot-platform/xatkit-nlu-server
41
42
4/4/2022
22
The ML model
Even this “simple” arch easily gets over > 100.000 parameters!
Step 1 – From words to vectors of numbers
43
44
4/4/2022
23
Step 2 Embedding -> similar words have
similar vectors
King – man + woman = Queen
Training and prediction
history = model.fit(np.array(context.training_sequences), np.array(context.training_labels),
epochs=configuration.num_epochs, verbose=2)
full_prediction = context.nlp_model.predict(sequence_from_sentence_to_predict)
Tip: Predicting always via the NN is overengineering sometimes
(e.g. Yes/No answers)
45
46
4/4/2022
24
Remember: the SW part of any ML project
And we could go on and on ...
47
48
4/4/2022
25
Beyond intent classification
• Great bots go beyond providing the right answer, e.g.
they could show some empathy
• Several language models (for toxicity detection, for
sentiment analysis, language identification, emoji
support…) can be easily integrated in bots
PRO tip: Monitor your bots
• You will fail to predict:
• What users want to know
• How they express their intentions
• Careful with self-learning
• Filter out what the bot needs to add as training sentences to avoid strange
derivations
49
50
4/4/2022
26
Creating a chatbot
3 – The Software component
What bot building tool should I
use?
51
52
4/4/2022
27
>100 bot platforms
• Rasa, BotPress, Chatfuel, Inbenta, Botsify,
Flow XO, Xatkit…
• And plenty NLP engines: DialogFlow, Lex,
LUIS, Watson, NLP.js
It all depends
• What are your priorities
– Open source?
– Free?
– Programming language of the bot?
– Natural languages (e.g. Catalan)
– Availability of connectors
– On-premises option?
– Plain textual bots or fully functional ones?
– Low-code/ no-code or tech skills?
– Possibility to migrate from one NLP engine to another?
– Monitoring dashboard / reports ?
– …
53
54
4/4/2022
28
Building bots in Xatkit
https://github.com/xatkit-bot-platform
Xatkit’s philosophy: Do not reinvent the wheel
Other solutions
Plenty of great NLU engines
and libraries, let’s not waste
our time building a new one
but take the best of breed
and focus on features to
help you create better bots
Xatkit is a chatbot orchestration platform
55
56
4/4/2022
29
Another reason to avoid strong
coupling to specific NLU/NLP libraries
Xatkit architecture
(write your bot once, run it anywhere)
Chatbot
Designer
Intent Recognition NLU Providers
(platform-specific)
Platform DSL / Libraries
Intent DSL
Xatkit DSL
Chatbot
User
Instant
Messaging
Platforms
Xatkit Runtime
Execution DSL
uses
uses
Platform-independent
chatbot definition
External
Services
Deployment
Configuration
Platform
Designer
G Daniel , J Cabot , L Deruelle, M Derras :
Xatkit: A Multimodal Low-Code Chatbot
Development Framework. IEEE
Access 8: 15332-15346 (2020)
57
58
4/4/2022
30
Xatkit DSL
• Bots are created with the Xatkit DSL offering a chatbot-
specific syntax for creating:
– Intents the bot needs to match
– The behavior to execute in response to the matched intents
• Our DSL aims to combine the benefits of:
– Having a chatbot-specific DSL that facilitates the creation of chatbot
applications by providing higher-level chatbot modeling primitives
– The full power of a general programming language to create any
type of bot, not just simple textual ones
Xatkit DSL
• Should we go for an external DSL or an internal one?
– External one: independent language with its own compiler, editor,…
You control everything
– Internal ones: lives inside another language. You can reuse the host
language but are also constrained by it
• We started with an external one and had to reimplement
everything
In our scenario, Internal DSLs are the way to go (Martin Fowler)
59
60
4/4/2022
31
Our DSL is implemented as a Java Fluent API
• Create bots using your preferred Java editor
– Benefit from all existing Java tooling when developing bots (e.g. debuggers)
– Reuse any Java library for complex bot behaviors
– Intuitive Fluent Interfaces to help you create advanced conversations
– Based on state machine semantics to build any type of bot
Intent DSL example
61
62
4/4/2022
32
Execution DSL example – State
machines
Easy deployments
A Xatkit bot can be packaged as a single jar
with no external dependencies. Just execute
the jar to get the bot up and running
Via a simple configuration file you can
connect your bot with external services, e.g.
NLP Engines and communication channels
63
64
4/4/2022
33
Xatkit is available on GitHub
Advanced topics
65
66
4/4/2022
34
Beyond predefined intents
80/20 - Pareto Rule
• 80% of user utterances will match 20%
of your intents
• Recursive Pareto: 64% (80% of 80%) of
your input utterances will be reduced to
4% (20% of 20%) of your defined intents.
67
68
4/4/2022
35
Open questions -> Plan B in your default fallback
https://haystack.deepset.ai/
BODI (Bots for Open Data) we use text to SQL models to try to
answer a larger variety of questions
No-learn / No-work chatbot
building
69
70
4/4/2022
36
Low-code / no-code
• Many bot platforms try to offer low-code / no-
code interfaces to define bots (e.g. GUIs)
writing less code
• But this is not enough for many non-tech users
Keep in mind: 1 language -> ++notations
No-Learn (e.g. bots from Excel)
71
72
4/4/2022
37
No-Work
• Bots derived from your
db data
– E.g. an eCommerce bot
that answers questions
about your products,
shipping options,…
Multiexperience Development
Platforms (MXDP)
73
74
4/4/2022
38
One app -> Multiple interfaces
Related also to Multimodal AI
E.g.: DALL-E
75
76
4/4/2022
39
E Planas, G Daniel, M Brambilla, J Cabot:
Towards a model-driven approach for
multiexperience AI-based user interfaces. Softw.
Syst. Model. 20(4): 997-1009 (2021)
But this brings plenty of new challenges
• A chatbot that knows where you’re looking at
(e.g. the product in the eCommerce shop) and
takes in that info
• How do you test that the different UIs behave
in a consistent way?
77
78
4/4/2022
40
Exciting times ahead
The LOCOSS project (Low-code
development of smart software)
Traditional
SW model
Smart software model
Data
Smart
back-end
AI quality
properties
Smart
front-end
Quality dashboard
LOCOSS DSLs & Editors LOCOSS infrastructure
Explanations
Domain Knowledge,
Goals & Ethical concerns
provides
receives
Monitoring
Testing
Explainability
specifies
Code
Generation
Local
packages
Cloud
services
AI Platforms
Training component
Code Data Params
Deployment component
ML
Model
79
80
4/4/2022
41
To know more: xatkit.com /
jordicabot.com /
ingenieriadesoftware.es
jcabot@uoc.edu
@xatkit / @JordiCabot / @ingdesoftware
81

More Related Content

Similar to Cómo construir un chatbot inteligente sin morir en el intento

Levelling up in open source
Levelling up in open sourceLevelling up in open source
Levelling up in open sourceJon Spriggs
 
Chatbot Tutorial - Create your first bot with Xatkit
Chatbot Tutorial - Create your first bot with Xatkit Chatbot Tutorial - Create your first bot with Xatkit
Chatbot Tutorial - Create your first bot with Xatkit Jordi Cabot
 
Using Generative AI in the Classroom .pptx
Using Generative AI in the Classroom .pptxUsing Generative AI in the Classroom .pptx
Using Generative AI in the Classroom .pptxJonathanDietz3
 
Will your intranet be replaced with a (chat) bot?
Will your intranet be replaced with a (chat) bot?Will your intranet be replaced with a (chat) bot?
Will your intranet be replaced with a (chat) bot?Thomas Maeder
 
Chatbots Using GPT (Generative Pretrained Transformer)
Chatbots Using GPT (Generative Pretrained Transformer)Chatbots Using GPT (Generative Pretrained Transformer)
Chatbots Using GPT (Generative Pretrained Transformer)Rodeker Davis
 
Chatbots for Brand Representation in Comparison with Traditional Websites
Chatbots for Brand Representation in Comparison with Traditional WebsitesChatbots for Brand Representation in Comparison with Traditional Websites
Chatbots for Brand Representation in Comparison with Traditional WebsitesEducational Technology
 
it-Build-a-Chatbot-Proof-of-Concept-Executive-Brief-V1.pptx
it-Build-a-Chatbot-Proof-of-Concept-Executive-Brief-V1.pptxit-Build-a-Chatbot-Proof-of-Concept-Executive-Brief-V1.pptx
it-Build-a-Chatbot-Proof-of-Concept-Executive-Brief-V1.pptxCarlos Olivares
 
ChatGPT.pdf
ChatGPT.pdfChatGPT.pdf
ChatGPT.pdfdhatura
 
ChatGPT.pdf
ChatGPT.pdfChatGPT.pdf
ChatGPT.pdfdhatura
 
IRJET- Artificial Intelligence Based Chat-Bot
IRJET-  	  Artificial Intelligence Based Chat-BotIRJET-  	  Artificial Intelligence Based Chat-Bot
IRJET- Artificial Intelligence Based Chat-BotIRJET Journal
 
UXPA2019 Not Your Average Chatbot: Using Cognitive Intercept to Improve Infor...
UXPA2019 Not Your Average Chatbot: Using Cognitive Intercept to Improve Infor...UXPA2019 Not Your Average Chatbot: Using Cognitive Intercept to Improve Infor...
UXPA2019 Not Your Average Chatbot: Using Cognitive Intercept to Improve Infor...UXPA International
 
Bot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachBot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachITCamp
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp
 
ChatBot Based Solutions by hizliYOL Technology
ChatBot Based Solutions by hizliYOL TechnologyChatBot Based Solutions by hizliYOL Technology
ChatBot Based Solutions by hizliYOL TechnologyAydin Ozcekic
 

Similar to Cómo construir un chatbot inteligente sin morir en el intento (20)

Levelling up in open source
Levelling up in open sourceLevelling up in open source
Levelling up in open source
 
Chatbot Tutorial - Create your first bot with Xatkit
Chatbot Tutorial - Create your first bot with Xatkit Chatbot Tutorial - Create your first bot with Xatkit
Chatbot Tutorial - Create your first bot with Xatkit
 
Using Generative AI in the Classroom .pptx
Using Generative AI in the Classroom .pptxUsing Generative AI in the Classroom .pptx
Using Generative AI in the Classroom .pptx
 
Will your intranet be replaced with a (chat) bot?
Will your intranet be replaced with a (chat) bot?Will your intranet be replaced with a (chat) bot?
Will your intranet be replaced with a (chat) bot?
 
Chatbots Using GPT (Generative Pretrained Transformer)
Chatbots Using GPT (Generative Pretrained Transformer)Chatbots Using GPT (Generative Pretrained Transformer)
Chatbots Using GPT (Generative Pretrained Transformer)
 
chatgpt.pptx
chatgpt.pptxchatgpt.pptx
chatgpt.pptx
 
Chatbots
ChatbotsChatbots
Chatbots
 
Chatbots for Brand Representation in Comparison with Traditional Websites
Chatbots for Brand Representation in Comparison with Traditional WebsitesChatbots for Brand Representation in Comparison with Traditional Websites
Chatbots for Brand Representation in Comparison with Traditional Websites
 
Whats a Chat bot
Whats a Chat botWhats a Chat bot
Whats a Chat bot
 
Chatbot Technology
Chatbot TechnologyChatbot Technology
Chatbot Technology
 
Realizing AI Conversational Bot
Realizing AI Conversational BotRealizing AI Conversational Bot
Realizing AI Conversational Bot
 
it-Build-a-Chatbot-Proof-of-Concept-Executive-Brief-V1.pptx
it-Build-a-Chatbot-Proof-of-Concept-Executive-Brief-V1.pptxit-Build-a-Chatbot-Proof-of-Concept-Executive-Brief-V1.pptx
it-Build-a-Chatbot-Proof-of-Concept-Executive-Brief-V1.pptx
 
Final presentation on chatbot
Final presentation on chatbotFinal presentation on chatbot
Final presentation on chatbot
 
ChatGPT.pdf
ChatGPT.pdfChatGPT.pdf
ChatGPT.pdf
 
ChatGPT.pdf
ChatGPT.pdfChatGPT.pdf
ChatGPT.pdf
 
IRJET- Artificial Intelligence Based Chat-Bot
IRJET-  	  Artificial Intelligence Based Chat-BotIRJET-  	  Artificial Intelligence Based Chat-Bot
IRJET- Artificial Intelligence Based Chat-Bot
 
UXPA2019 Not Your Average Chatbot: Using Cognitive Intercept to Improve Infor...
UXPA2019 Not Your Average Chatbot: Using Cognitive Intercept to Improve Infor...UXPA2019 Not Your Average Chatbot: Using Cognitive Intercept to Improve Infor...
UXPA2019 Not Your Average Chatbot: Using Cognitive Intercept to Improve Infor...
 
Bot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent EllerbachBot. You said bot? Let build bot then! - Laurent Ellerbach
Bot. You said bot? Let build bot then! - Laurent Ellerbach
 
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
 
ChatBot Based Solutions by hizliYOL Technology
ChatBot Based Solutions by hizliYOL TechnologyChatBot Based Solutions by hizliYOL Technology
ChatBot Based Solutions by hizliYOL Technology
 

More from Facultad de Informática UCM

¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?Facultad de Informática UCM
 
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...Facultad de Informática UCM
 
DRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation ComputersDRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation ComputersFacultad de Informática UCM
 
Tendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura ArmTendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura ArmFacultad de Informática UCM
 
Introduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented ComputingIntroduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented ComputingFacultad de Informática UCM
 
Inteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuroInteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuroFacultad de Informática UCM
 
Design Automation Approaches for Real-Time Edge Computing for Science Applic...
 Design Automation Approaches for Real-Time Edge Computing for Science Applic... Design Automation Approaches for Real-Time Edge Computing for Science Applic...
Design Automation Approaches for Real-Time Edge Computing for Science Applic...Facultad de Informática UCM
 
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...Facultad de Informática UCM
 
Fault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error CorrectionFault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error CorrectionFacultad de Informática UCM
 
Automatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCAutomatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCFacultad de Informática UCM
 
Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...Facultad de Informática UCM
 
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...Facultad de Informática UCM
 
Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.Facultad de Informática UCM
 
Challenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore windChallenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore windFacultad de Informática UCM
 
Evolution and Trends in Edge AI Systems and Architectures for the Internet of...
Evolution and Trends in Edge AI Systems and Architectures for the Internet of...Evolution and Trends in Edge AI Systems and Architectures for the Internet of...
Evolution and Trends in Edge AI Systems and Architectures for the Internet of...Facultad de Informática UCM
 

More from Facultad de Informática UCM (20)

¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?¿Por qué debemos seguir trabajando en álgebra lineal?
¿Por qué debemos seguir trabajando en álgebra lineal?
 
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
TECNOPOLÍTICA Y ACTIVISMO DE DATOS: EL MAPEO COMO FORMA DE RESILIENCIA ANTE L...
 
DRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation ComputersDRAC: Designing RISC-V-based Accelerators for next generation Computers
DRAC: Designing RISC-V-based Accelerators for next generation Computers
 
uElectronics ongoing activities at ESA
uElectronics ongoing activities at ESAuElectronics ongoing activities at ESA
uElectronics ongoing activities at ESA
 
Tendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura ArmTendencias en el diseño de procesadores con arquitectura Arm
Tendencias en el diseño de procesadores con arquitectura Arm
 
Formalizing Mathematics in Lean
Formalizing Mathematics in LeanFormalizing Mathematics in Lean
Formalizing Mathematics in Lean
 
Introduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented ComputingIntroduction to Quantum Computing and Quantum Service Oriented Computing
Introduction to Quantum Computing and Quantum Service Oriented Computing
 
Computer Design Concepts for Machine Learning
Computer Design Concepts for Machine LearningComputer Design Concepts for Machine Learning
Computer Design Concepts for Machine Learning
 
Inteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuroInteligencia Artificial en la atención sanitaria del futuro
Inteligencia Artificial en la atención sanitaria del futuro
 
Design Automation Approaches for Real-Time Edge Computing for Science Applic...
 Design Automation Approaches for Real-Time Edge Computing for Science Applic... Design Automation Approaches for Real-Time Edge Computing for Science Applic...
Design Automation Approaches for Real-Time Edge Computing for Science Applic...
 
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
Estrategias de navegación para robótica móvil de campo: caso de estudio proye...
 
Fault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error CorrectionFault-tolerance Quantum computation and Quantum Error Correction
Fault-tolerance Quantum computation and Quantum Error Correction
 
Automatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCAutomatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPC
 
Type and proof structures for concurrency
Type and proof structures for concurrencyType and proof structures for concurrency
Type and proof structures for concurrency
 
Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...Hardware/software security contracts: Principled foundations for building sec...
Hardware/software security contracts: Principled foundations for building sec...
 
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
Jose carlossancho slidesLa seguridad en el desarrollo de software implementad...
 
Do you trust your artificial intelligence system?
Do you trust your artificial intelligence system?Do you trust your artificial intelligence system?
Do you trust your artificial intelligence system?
 
Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.Redes neuronales y reinforcement learning. Aplicación en energía eólica.
Redes neuronales y reinforcement learning. Aplicación en energía eólica.
 
Challenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore windChallenges and Opportunities for AI and Data analytics in Offshore wind
Challenges and Opportunities for AI and Data analytics in Offshore wind
 
Evolution and Trends in Edge AI Systems and Architectures for the Internet of...
Evolution and Trends in Edge AI Systems and Architectures for the Internet of...Evolution and Trends in Edge AI Systems and Architectures for the Internet of...
Evolution and Trends in Edge AI Systems and Architectures for the Internet of...
 

Recently uploaded

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 

Recently uploaded (20)

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 

Cómo construir un chatbot inteligente sin morir en el intento

  • 1. 4/4/2022 1 Como construir chatbots inteligentes sin morir en el intento @JordiCabot / @ingdesoftware / @xatkit– jordicabot.com / ingenieriadesoftware.es Introduction 1 2
  • 2. 4/4/2022 2 About SOM Research Lab Software runs the world. Models run the software 3 4
  • 3. 4/4/2022 3 Nuestra misión Interested in the broad area of systems and software engineering, especially promoting the rigorous use of software models and engineering principles in all software engineering tasks. Flickr/clement127 5 6
  • 4. 4/4/2022 4 Context Can you help us create a chatbot to help newcomers to write good bug reports on GitHub? Sure! It’s just a set of questions & answers, this will be pretty simple! Narrator It wasn’t. Once upon a time in 2018 (we were young and naïve) 7 8
  • 5. 4/4/2022 5 We were asked to build a bot. We ended up building a bot platform But at least we’ve learnt some things along the way that today we want to share with you 3 times so far! Why you all need to have some bot building notions 9 10
  • 6. 4/4/2022 6 And more predictions: - By 2024, consumer retail spend via chatbots worldwide will reach $142 billion—up from just $2.8 billion in 2019. Chatbot market is worth over 1 Billion USD 11 12
  • 7. 4/4/2022 7 Chatbots <-> Software engineers • Software Engineers -> Chatbot – Chatbots are a new type of software artefact that we’ll need to consider in our dev projects • Chatbot -> Software Engineering – Bots are more and more playing a supportive role in many SE tasks (e.g. in GH) so better to know how they work and their limitations 13 14
  • 8. 4/4/2022 8 Hidden Technical debt in Machine Learning Systems - Google - https://proceedings.neurips.cc/paper/2015/file/86df7dcfd896fcaf2674f757a 2463eba-Paper.pdf 15 16
  • 9. 4/4/2022 9 Core chatbot concepts What is exactly a Chatbot? • Bot are software components • Chatbot = Bot + Chat interface – Tb llamado asistente digital, asistente virtual,… • Voicebot = Chatbot + Voice Interface Voicebot Chatbot Bot 17 18
  • 10. 4/4/2022 10 VoiceBot • Alexa, Google Assistant ,… • They all hide a chatbot inside 1. Speech-to-text 2. Process the text as a chatbot 3. Text-to-speech to reply Chatbot vs LiveChat • LiveChat: a person is behind • They can be combined – Bot  Person: when the bot doesn’t know how to answer (or the visitor is specially “interesting”) – Person  Bot: when no support person is available or the client is not worth 19 20
  • 13. 4/4/2022 13 Types of chatbots Types of chatbots Button- based (no AI) Intent-based Open questions Open domain 25 26
  • 14. 4/4/2022 14 We ignore open-domain bots (e.g. LaMDA) • They can chat about everything but – A complete black-box – ``Useless’’ for a specific business https://mindmatters.ai/2022/03/the-ai-illusion-state-of-the-art-chatbots-arent-what- they-seem/ Creating a chatbot 1 – Why is it so challeging? 27 28
  • 15. 4/4/2022 15 Software (bot part) NLU (chat part) Complexity of chatbots Chat bots Many pieces to assemble Input/Output Messaging channels External Platforms NLU Engine Events! 29 30
  • 16. 4/4/2022 16 Chatbots are complex software systems Conversation Logic Text Processing External Services Messaging Platforms Deployment Evolution Maintenance Tests J Cabot, L Burgueño, R Clarisó, G Daniel, J Perianez- Pascual, R Rodríguez-Echeverría: Testing challenges for NLP-intensive bots. BotSE@ICSE 2021: 31-34 Creating a chatbot 2 – The NLP component 31 32
  • 17. 4/4/2022 17 How NLP works in chatbots Bots and NLP/NLU • At the core of all AI bots there is a NLU/NLP engine with two key missions – Classify the user utterance (i.e. input text) in one of the intents (set of possible questions/requests) the bot understands – Identify the parameters (called « entities ») from the utterance 33 34
  • 18. 4/4/2022 18 NLP in a chatbot implies Parameters (entities) I would like to order a medium pepperoni pizza Intent Input text (utterance) • Understand what the user is trying to ask the bot • Identify and gather the data in the request that the bot needs to construct the response 35 36
  • 19. 4/4/2022 19 NLU approaches • Regular expressions • Require an almost exact match. Only useful for very concrete cases • Grammar-based approaches • Useful for small domains with a very specific vocabulary and constructs • E.g. Stanford Parser • Neural Networks - Multiclass classifiers 1. You provide some training sentences for each intent (the "classes" ). 2. The classifier learns from these sentences 3. It assigns any new input text to one of the classes (with %confidence) Hi Good morning Good afternoon Hello Morning! Example: bot that greets you, informs about the schedule and lets you buy a pizza Greetings I’d like to buy a pizza I want a pizza Can I order a pizza? Buy Are you open? Is it open now? What are your opening hours? At what time do you start? Schedule If a user says, “I would like to order a pizza now” what is the closest intent? Not that easy when intents start to overlap (e.g. offering a job vs looking for a job: “can I offer you a job?” vs “do you have any job offer”) 37 38
  • 20. 4/4/2022 20 Entity recognition • We need to understand the intent but also identify the entities • Much easier if PizzaType is an enumeration ({ Pepperoni, Veggie, Hawaian ,…}) instead of the any string ChooseYourPizza I’d like a PizzaType pizza I’m taking a PizzaType pizza I think I’m going for a PizzaType 39 40
  • 21. 4/4/2022 21 Common tricks in NLU Engines • Stemmers identify the lemma of the word (e.g. to focus on the verb, not on the tense of the verb for matching purposes) • Synonyms and paraphrasing are an automatic way to expand the training sentences • Entity augmentation also generalize training sentences • E.g. What’s the weather in Barcelona -> What’s the weather in @city • Augmentation is possible for a large number of data types and common concepts (measures, countries, dates,…) Taking a closer look at the NN https://github.com/xatkit-bot-platform/xatkit-nlu-server 41 42
  • 22. 4/4/2022 22 The ML model Even this “simple” arch easily gets over > 100.000 parameters! Step 1 – From words to vectors of numbers 43 44
  • 23. 4/4/2022 23 Step 2 Embedding -> similar words have similar vectors King – man + woman = Queen Training and prediction history = model.fit(np.array(context.training_sequences), np.array(context.training_labels), epochs=configuration.num_epochs, verbose=2) full_prediction = context.nlp_model.predict(sequence_from_sentence_to_predict) Tip: Predicting always via the NN is overengineering sometimes (e.g. Yes/No answers) 45 46
  • 24. 4/4/2022 24 Remember: the SW part of any ML project And we could go on and on ... 47 48
  • 25. 4/4/2022 25 Beyond intent classification • Great bots go beyond providing the right answer, e.g. they could show some empathy • Several language models (for toxicity detection, for sentiment analysis, language identification, emoji support…) can be easily integrated in bots PRO tip: Monitor your bots • You will fail to predict: • What users want to know • How they express their intentions • Careful with self-learning • Filter out what the bot needs to add as training sentences to avoid strange derivations 49 50
  • 26. 4/4/2022 26 Creating a chatbot 3 – The Software component What bot building tool should I use? 51 52
  • 27. 4/4/2022 27 >100 bot platforms • Rasa, BotPress, Chatfuel, Inbenta, Botsify, Flow XO, Xatkit… • And plenty NLP engines: DialogFlow, Lex, LUIS, Watson, NLP.js It all depends • What are your priorities – Open source? – Free? – Programming language of the bot? – Natural languages (e.g. Catalan) – Availability of connectors – On-premises option? – Plain textual bots or fully functional ones? – Low-code/ no-code or tech skills? – Possibility to migrate from one NLP engine to another? – Monitoring dashboard / reports ? – … 53 54
  • 28. 4/4/2022 28 Building bots in Xatkit https://github.com/xatkit-bot-platform Xatkit’s philosophy: Do not reinvent the wheel Other solutions Plenty of great NLU engines and libraries, let’s not waste our time building a new one but take the best of breed and focus on features to help you create better bots Xatkit is a chatbot orchestration platform 55 56
  • 29. 4/4/2022 29 Another reason to avoid strong coupling to specific NLU/NLP libraries Xatkit architecture (write your bot once, run it anywhere) Chatbot Designer Intent Recognition NLU Providers (platform-specific) Platform DSL / Libraries Intent DSL Xatkit DSL Chatbot User Instant Messaging Platforms Xatkit Runtime Execution DSL uses uses Platform-independent chatbot definition External Services Deployment Configuration Platform Designer G Daniel , J Cabot , L Deruelle, M Derras : Xatkit: A Multimodal Low-Code Chatbot Development Framework. IEEE Access 8: 15332-15346 (2020) 57 58
  • 30. 4/4/2022 30 Xatkit DSL • Bots are created with the Xatkit DSL offering a chatbot- specific syntax for creating: – Intents the bot needs to match – The behavior to execute in response to the matched intents • Our DSL aims to combine the benefits of: – Having a chatbot-specific DSL that facilitates the creation of chatbot applications by providing higher-level chatbot modeling primitives – The full power of a general programming language to create any type of bot, not just simple textual ones Xatkit DSL • Should we go for an external DSL or an internal one? – External one: independent language with its own compiler, editor,… You control everything – Internal ones: lives inside another language. You can reuse the host language but are also constrained by it • We started with an external one and had to reimplement everything In our scenario, Internal DSLs are the way to go (Martin Fowler) 59 60
  • 31. 4/4/2022 31 Our DSL is implemented as a Java Fluent API • Create bots using your preferred Java editor – Benefit from all existing Java tooling when developing bots (e.g. debuggers) – Reuse any Java library for complex bot behaviors – Intuitive Fluent Interfaces to help you create advanced conversations – Based on state machine semantics to build any type of bot Intent DSL example 61 62
  • 32. 4/4/2022 32 Execution DSL example – State machines Easy deployments A Xatkit bot can be packaged as a single jar with no external dependencies. Just execute the jar to get the bot up and running Via a simple configuration file you can connect your bot with external services, e.g. NLP Engines and communication channels 63 64
  • 33. 4/4/2022 33 Xatkit is available on GitHub Advanced topics 65 66
  • 34. 4/4/2022 34 Beyond predefined intents 80/20 - Pareto Rule • 80% of user utterances will match 20% of your intents • Recursive Pareto: 64% (80% of 80%) of your input utterances will be reduced to 4% (20% of 20%) of your defined intents. 67 68
  • 35. 4/4/2022 35 Open questions -> Plan B in your default fallback https://haystack.deepset.ai/ BODI (Bots for Open Data) we use text to SQL models to try to answer a larger variety of questions No-learn / No-work chatbot building 69 70
  • 36. 4/4/2022 36 Low-code / no-code • Many bot platforms try to offer low-code / no- code interfaces to define bots (e.g. GUIs) writing less code • But this is not enough for many non-tech users Keep in mind: 1 language -> ++notations No-Learn (e.g. bots from Excel) 71 72
  • 37. 4/4/2022 37 No-Work • Bots derived from your db data – E.g. an eCommerce bot that answers questions about your products, shipping options,… Multiexperience Development Platforms (MXDP) 73 74
  • 38. 4/4/2022 38 One app -> Multiple interfaces Related also to Multimodal AI E.g.: DALL-E 75 76
  • 39. 4/4/2022 39 E Planas, G Daniel, M Brambilla, J Cabot: Towards a model-driven approach for multiexperience AI-based user interfaces. Softw. Syst. Model. 20(4): 997-1009 (2021) But this brings plenty of new challenges • A chatbot that knows where you’re looking at (e.g. the product in the eCommerce shop) and takes in that info • How do you test that the different UIs behave in a consistent way? 77 78
  • 40. 4/4/2022 40 Exciting times ahead The LOCOSS project (Low-code development of smart software) Traditional SW model Smart software model Data Smart back-end AI quality properties Smart front-end Quality dashboard LOCOSS DSLs & Editors LOCOSS infrastructure Explanations Domain Knowledge, Goals & Ethical concerns provides receives Monitoring Testing Explainability specifies Code Generation Local packages Cloud services AI Platforms Training component Code Data Params Deployment component ML Model 79 80
  • 41. 4/4/2022 41 To know more: xatkit.com / jordicabot.com / ingenieriadesoftware.es jcabot@uoc.edu @xatkit / @JordiCabot / @ingdesoftware 81