Where Can Buy Building An Enterprise Chatbot: Work With Protected Enterprise Data Using Open Source Frameworks Abhishek Singh Ebook With Cheap Price
Where Can Buy Building An Enterprise Chatbot: Work With Protected Enterprise Data Using Open Source Frameworks Abhishek Singh Ebook With Cheap Price
com
https://textbookfull.com/product/building-an-enterprise-
chatbot-work-with-protected-enterprise-data-using-open-
source-frameworks-abhishek-singh/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/reinforcement-learning-with-open-ai-
tensorflow-and-keras-using-python-1st-edition-abhishek-nandy/
textboxfull.com
https://textbookfull.com/product/data-simplification-taming-
information-with-open-source-tools-1st-edition-berman/
textboxfull.com
https://textbookfull.com/product/building-enterprise-iot-
applications-1st-edition-chandrasekar-vuppalapati/
textboxfull.com
https://textbookfull.com/product/beginning-ejb-in-java-ee-8-building-
applications-with-enterprise-javabeans-jonathan-wetherbee/
textboxfull.com
GeoServer beginner s guide share geospatial data using
open source standards Second Edition. Edition Iacovella
https://textbookfull.com/product/geoserver-beginner-s-guide-share-
geospatial-data-using-open-source-standards-second-edition-edition-
iacovella/
textboxfull.com
https://textbookfull.com/product/data-simplification-taming-
information-with-open-source-tools-first-edition-online-ausg-berman/
textboxfull.com
https://textbookfull.com/product/practical-data-science-with-sap-
machine-learning-techniques-for-enterprise-data-1st-edition-greg-foss/
textboxfull.com
Building an
Enterprise Chatbot
Work with Protected Enterprise Data
Using Open Source Frameworks
—
Abhishek Singh
Karthik Ramasubramanian
Shrey Shivam
Building an Enterprise
Chatbot
Work with Protected
Enterprise Data Using Open
Source Frameworks
Abhishek Singh
Karthik Ramasubramanian
Shrey Shivam
Building an Enterprise Chatbot: Work with Protected Enterprise Data
Using Open Source Frameworks
v
Table of Contents
vi
Table of Contents
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
Transition�����������������������������������������������������������������������������������������������������223
State Machine���������������������������������������������������������������������������������������������224
Building a Custom Chatbot for an Insurance Use Case�������������������������������������230
Creating the Intents�������������������������������������������������������������������������������������233
IrisConfiguration������������������������������������������������������������������������������������������243
Managing State�������������������������������������������������������������������������������������������271
Exposing a REST Service�����������������������������������������������������������������������������273
Adding a Service Endpoint��������������������������������������������������������������������������277
Summary����������������������������������������������������������������������������������������������������������278
x
Table of Contents
Index�������������������������������������������������������������������������������������������������377
xi
About the Authors
Abhishek Singh is on a mission to profess
the de facto language of this millennium, the
numbers. He is on a journey to bring machines
closer to humans, for a better and more
beautiful world by generating opportunities
with artificial intelligence and machine
learning. He leads a team of data science
professionals solving pressing problems in
food security, cyber security, natural disasters,
healthcare, and many more areas, all with the
help of data and technology. Abhishek is in
the process of bringing smart IoT devices to smaller cities in India so that
people can leverage technology for the betterment of life.
He has worked with colleagues from many parts of the United States,
Europe, and Asia, and strives to work with more people from various
backgrounds. In seven years at big corporations, he has stress-tested
the assets of U.S. banks at Deloitte, solved insurance pricing models at
Prudential, made telecom experiences easier for customers at Celcom,
and created core SaaS data products at Probyto. He is now creating data
science opportunities with his team of young minds.
He actively participates in analytics-related thought leadership,
authoring, public speaking, meetups, and training in data science. He is a
staunch supporter of responsible use of AI to remove biases and fair use of
AI for a better society.
Abhishek completed his MBA from IIM Bangalore, a B.Tech. in
Mathematics and Computing from IITGuwahati, and has a PG Diploma in
Cyber Law from NALSAR University, Hyderabad.
xiii
About the Authors
xiv
About the Authors
xv
About the Technical Reviewer
Santanu Pattanayak currently works at
GE, Digital as a Staff Data Scientist and
is the author of Pro Deep Learning with
TensorFlow - A Mathematical Approach to
Advanced Artificial Intelligence in Python. He
has 12 years of overall work experience with
8 years of experience in the data analytics/
data science field. He also has a background
in development and database technologies.
Prior to joining GE, Santanu worked at
companies such as RBS, Capgemini, and
IBM. He graduated with a degree in Electrical Engineering from Jadavpur
University, Kolkata and is an avid math enthusiast. Santanu is currently
pursuing a master’s degree in Data Science from Indian Institute of
Technology (IIT), Hyderabad. He also devotes time to data science
hackathons and Kaggle competitions where he ranks within the top 500
across the globe. Santanu was born and brought up in West Bengal, India
and currently resides in Bangalore, India with his wife.
xvii
Acknowledgments
We are grateful to our teachers at various universities and their continued
support in our professional lives.
Abhishek Singh thanks his colleagues at Probyto who inspire him to
write impactful content for better use of AI for public use; the idea of this
book evolved through discussions with his colleagues and his work in the
EU market. A special mention goes to his parents, Mr. Charan Singh and
Mrs. Jayawati, for their intriguing insights on how to think about general
human use of AI. Their support and demand for the simplistic design of
solutions using AI-generated data inspires his day-to-day design of data
products.
Karthik is immensely grateful to his parents, Mr. S Ramasubramanian
and Mrs. Kanchana, for their unwavering support throughout his life
and during the development of this book. This book was made possible
by hundreds of researchers who shared their life’s work as open-source
offerings. He thanks all such researchers who make this world better and
passionately share their work with everyone. Lastly, a large part of his work
and success comes from his mentors and colleagues from work, where he
continuously learns and improves.
Shrey is hugely grateful to his parents, Mr. Vijay Pratap Singh and Mrs.
Bharti Singh, for their love, care, and sacrifice in helping him fulfill his
dreams. He expresses gratitude to his uncle, Mr. Tarun Singh, for being
a pillar of strength. Shrey also thanks his past and current colleagues,
including Dipesh Singh and Jaspinder Singh Virdee, for their continuous
encouragement and support in taking up challenging and innovative ideas
to execution.
xix
Acknowledgments
Finally, this book would not have been possible without the support of
the Apress team: Aditee, Celestin, Matthew, and the production support
staff. We also acknowledge and thank our Technical Reviewer (TR) for their
critical reviews that helped to make the book even better.
xx
Introduction
There are numerous frameworks and propriety off-the-shelf chatbot
offerings, but most do not clearly map out the much-needed control
of data by an organization. Often the propriety offerings take an
organization’s private data for training on the cloud and provide the
outcome as a model. In this book, we will focus on data privacy and
control over the development process. The chatbot that you will learn how
to develop could be completely built in-house using open-source JAVA
frameworks and NLP libraries in Python.
The beginning of the book helps you understand the processes in
the banking industry and delves into identifying the sources of data to
mine for the intent from customer queries. The second part focuses on
natural language processing, understanding, and generation, which
are demonstrated using Python. These three concepts are the core
components of a chatbot. In the final part, you take up the development of
a chatbot called IRIS using open-source frameworks written in JAVA.
The following are the key topics this book offers:
xxi
Introduction
xxii
CHAPTER 1
Processes in
the Banking and
Insurance Industries
According to Darwin’s On the Origin of Species, it is not the most
intellectual of the species that survives; it is not the strongest that survives;
the species that survives is the one that is best able to adapt and adjust to
the changing environment in which it finds itself. The same analogy can
apply to enterprises and their survival opportunities in the 21st century. In
this digital era, it is of utmost importance for enterprises to adapt to the
latest trends and technology advancements. With this book, we intend to
prepare you with an emerging skill of building chatbots in the financial
services domain, with a specific use case of an insurance agent (replicable
to a bank assistant as well).
2
Chapter 1 Processes in the Banking and Insurance Industries
Insurance
• Health
• Vehicle
• Travel
• Home
• Corporate
• Others
3
Chapter 1 Processes in the Banking and Insurance Industries
for accidents, travel insurance for flight delays, and so on. The established
insurance companies offer multiple products to customers and institutions
as per their needs. Some of these products have standard features, where
some insurance companies can create custom deals as per client needs, for
instance covering the risk of severe weather during a significant event. The
key differentiator between a good and bad insurer is how diligently and
accurately it can measure the risk involved in the underlying events.
Banking services, on the other hand, do not cover uncertain risk,
but they work in economic activities of a financial nature. Banking has
also evolved to be of many types, serving different purposes for different
commercial entities. However, the basic premise of banking remains as a
broker between lenders and borrowers. The spread between lending and
borrowing rates is also called a spread, and the bank manages to create
economic activities in the system.
Figure 1-3 depicts a fundamental framework of a bank or a banking
company.
4
Chapter 1 Processes in the Banking and Insurance Industries
interest rate. In the example in Figure 1-3, a lender deposits $10,000 into
the bank and receives 2% interest (i.e., $200), while the bank lends $10,000
to the borrower at 9% interest (i.e., gaining $900 in the transaction). The
spread of 7% (i.e., 900-200=700) is the income for bank, which it can use to
run operations and create new products.
Like insurance, banks have also evolved to provide various services for
different types of customers and entities. Figure 1-4 is basic classification
of types of banks. It is a not an exhaustive list of the types of banks and
banking services. However, they are the primary type of banks.
Within the scope of this book, we will point out the typical process for
an end customer for accessing financial service. The customer for a retail
bank and life insurance company are the same, except for a few cases.
This makes it easier to illustrate how insurance company touchpoints with
customers are similar to those for banking customers. Once we set up the
generic nature of these touchpoints, we will move ahead with the chatbot
build process.
5
Chapter 1 Processes in the Banking and Insurance Industries
Feedback
Customer-
focused
Customer drives
continuous
leadership centricity improvement
6
Chapter 1 Processes in the Banking and Insurance Industries
7
Chapter 1 Processes in the Banking and Insurance Industries
8
Chapter 1 Processes in the Banking and Insurance Industries
1
www.grandviewresearch.com/press-release/global-chatbot-market
9
Chapter 1 Processes in the Banking and Insurance Industries
10
Discovering Diverse Content Through
Random Scribd Documents
are very valuable for some kinds of medical work. The application of
these currents is quite painless, and but for the strange-looking
apparatus the patient probably would not know that anything unusual
was taking place. To some extent the effect maybe said to be not
unlike that of a powerful tonic. Insomnia and other troubles due to
disordered nerves are quickly relieved, and even such obstinate
complaints as neuritis and crippling rheumatism have been cured.
The treatment is also of great value in certain forms of heart trouble.
By increasing the strength of the high frequency currents the tissues
actually may be destroyed, and this power is utilized for
exterminating malignant growths, such as lupus or cancer.
The heat produced by a current of electricity is made use of in
cauterizing. The burner is a loop of platinum wire, shaped according
to the purpose for which it is intended, and it is used at a dull red
heat. Very tiny electric incandescent lamps, fitted in long holders of
special shape, are largely used for examining the throat and the
various cavities of the body.
In the Finsen light treatment electric light is used for a very
different purpose. The spectrum of white light consists of the colours
red, orange, yellow, green, blue, indigo, and violet. Just beyond the
violet end of the spectrum are the ultra-violet rays. Ultra-violet light
consists of waves of light which are so short as to be quite invisible
to the eye, and Dr. N. R. Finsen, a Danish physician, made the
discovery that this light is capable of destroying bacterial germs. In
the application of ultra-violet rays to medical work, artificial light is
used in preference to sunlight; for though the latter contains ultra-
violet light, a great deal of it is absorbed in passing through the
atmosphere. Besides this, the sun sends out an immense amount of
radiant heat, and this has to be filtered out before the light can be
used. The usual source of light is the electric arc, and the arc is
much richer in ultra-violet rays if it is formed between electrodes of
iron, instead of the usual carbon rods. The light, which, in addition to
the ultra-violet rays, includes the blue, indigo, and violet parts of the
spectrum, is passed along a tube something like that of a telescope,
and is focused by means of a double lens, consisting of two separate
plates of quartz. Glass cannot be used for the lens, because it is
opaque to the extreme ultra-violet rays. A constant stream of water is
passed between the two plates forming the lens, and this filters out
the heat rays, which are not wanted. In some forms of Finsen lamp
an electric spark is used as the source of light, in place of the arc.
The most important application of the Finsen light is in the cure
of the terribly disfiguring disease called lupus. This is a form of
tuberculosis of the skin, and it is produced by the same deadly
microbe which, when it attacks the lungs, causes consumption. In all
but extreme cases the Finsen light effects a remarkable cure. A
number of applications are necessary, each of half an hour or more;
and after a time the disease begins to disappear, leaving soft, normal
skin. The exact action of the light rays is a disputed point. Finsen
himself believed that the ultra-violet rays attacked and exterminated
the microbe, but a later theory is that the rays stimulate the tissues to
such an extent that they are enabled to cure themselves. As early as
the year 1899 Finsen had employed his light treatment in 350 cases
of lupus, and out of this number only five cases were unsuccessful.
The ultra-violet rays are said to have a very beneficial effect
upon the teeth. Experiments carried out in Paris, using a mercury
vapour lamp as the source of light, show that discoloured teeth are
whitened and given a pearly lustre by these rays, at the same time
being sterilized so that they do not easily decay. The Röntgen rays
are used for the treatment of lupus, and more particularly for deeper
growths, such as tumours and cancers, for which the Finsen rays are
useless, owing to their lack of penetrating power. The action of these
two kinds of rays appears to be similar, but the X-rays are much the
more active of the two.
Electricity is often applied to the body through water, in the form
of the hydro-electric bath, and such baths are used in the treatment
of different kinds of paralysis. Electric currents are used too for
conveying drugs into the tissues of the body. This is done when it is
desired to concentrate the drug at some particular point, and it has
been found that chemicals can be forced into the tissues for a
considerable distance.
Dr. Nagelschmidt, a great authority on medical electricity, has
suggested the use of electricity for weight reducing. In the ordinary
way superfluous flesh is got rid of by a starvation diet coupled with
exercise, but in many cases excessively stout people are troubled
with heart disorders and asthma, so that it is almost impossible for
them to undergo the necessary muscular exertion. By the application
of electric currents, however, the beneficial effects of the gentle
exercise may be produced without any exertion on the part of the
patient, and an hour’s treatment is said to result in a decrease in
weight of from 200 to 800 grammes, or roughly 7 to 27 ounces.
CHAPTER XXVI
OZONE
The petrol motor, which to-day is busily engaged all over the world in
driving thousands upon thousands of self-propelled vehicles or
automobiles, belongs to the important class of internal-combustion
engines. Combustion means the operation of burning, and an
internal-combustion engine is one in which the motive power is
produced by the combustion of a highly explosive mixture of gases.
In the ordinary petrol motor this mixture consists of petrol and air,
and it is made by means of a device called a “carburetter.” By
suction, a quantity of petrol is forced through a jet with a very fine
nozzle, so that it is reduced to an extremely fine spray. A certain
proportion of air is allowed to enter, and the mixture passes into the
cylinder. Here it is compressed by the rising piston so that it
becomes more and more heated, and at the right point it is ignited.
Combustion takes place with such rapidity that it takes the form of an
explosion, and the energy produced in this way drives forward the
piston, which turns the crank-shaft and so communicates motion to
the driving-wheels.
The part played by electricity in this process is confined to the
ignition of the compressed charge of petrol and air. This may be
done in two ways; by means of an accumulator and a small induction
coil, or by means of a dynamo driven by the engine. At one time the
first method was employed exclusively, but to-day it is used as a rule
only for starting the car engine, the second or magneto method
being used when the engine has started up.
In accumulator ignition the low-tension current from the
accumulator passes through an induction coil, and is thus
transformed to high-tension current. This current goes through a
sparking plug, which is fixed in the head of the cylinder. The sparking
plug contains two metal points separated by a tiny air gap of from
about 1/30 to 1/50 inch. This gap provides the only possible path for
the high-tension current, so that the latter leaps across it in the form
of a spark. The spark is arranged to take place when the piston is at
the top of its stroke, that is, when the explosive mixture is at its
maximum compression, and the heat of the spark ignites the
mixture, the resulting explosion forcing down the piston with great
power. In practice it is found better as a rule to cause the spark to
pass very slightly before the piston reaches the extreme limit of its
stroke. The reason of this is that the process of igniting and
exploding the charge occupies an appreciable, though of course
exceedingly small amount of time. Immediately on reaching the top
of its stroke the piston begins to descend again, and if the spark and
the top of the stroke coincide in time the explosion does not take
place until the piston has moved some little distance down the
cylinder, and so a certain amount of power is lost. By having the
spark a little in advance of the piston, the explosion occurs at the
instant when the piston begins to return, and so the full force of the
explosion is utilized.
In magneto ignition the current is supplied by a small dynamo.
This generates alternating current, and it is driven by the car engine.
The current is at first at low pressure, and it has to be transformed to
high-tension current in order to produce the spark. There are two
methods of effecting this transformation. One is by turning the
armature of the dynamo into a sort of induction coil, by giving it two
separate windings, primary and secondary; so that the dynamo
delivers high-tension current directly. The other method is to send
the low-tension current through one or more transformer coils, just
as in accumulator ignition. Accumulators can give current only for a
certain limited period, and they are liable consequently to run down
at inconvenient times and places. They also have the defect of
undergoing a slight leakage of current even when they are not in
use. Magneto ignition has neither of these drawbacks, and on
account of its superior reliability it has come into universal use.
In the working of quarries and mines of various kinds, and also in
large engineering undertakings, blasting plays a prominent part.
Under all conditions blasting is a more or less dangerous business,
and it has been the cause of very many serious accidents to the men
engaged in carrying it out. Many of these accidents are due to the
carelessness resulting from long familiarity with the work, but apart
from this the danger lies principally in uncertainty in exploding the
charge. Sometimes the explosion occurs sooner than expected, so
that the men have not time to get away to a safe distance. Still more
deadly is the delayed explosion. After making the necessary
arrangements the men retire out of danger, and await the explosion.
This does not take place at the expected time, and after waiting a
little longer the men conclude that the ignition has failed, and return
to put matters right. Then the explosion takes place, and the men are
killed instantly or at least seriously injured. Although it is impossible
to avoid altogether dangers of this nature, the risk can be reduced to
the minimum by igniting the explosives by electricity.
Electrical shot firing may be carried out in different ways,
according to circumstances. The current is supplied either by a
dynamo or by a battery, and the firing is controlled from a
switchboard placed at a safe distance from the point at which the
charge is to be exploded, the connexions being made by long
insulated wires. The actual ignition is effected by a hot spark, as in
automobile ignition, or by an electric detonator or fuse. Explosives
such as dynamite cannot be fired by simple ignition, but require to be
detonated. This is effected by a detonator consisting of a small cup-
shaped tube, made of ebonite or other similar material. The wires
conveying the current project into this tube, and are connected by a
short piece of very fine wire having a high resistance. Round this
wire is packed a small quantity of gun-cotton, and beyond, in a sort
of continuation of the tube, is placed an extremely explosive
substance called “fulminate of mercury,” the whole arrangement
being surrounded by the dynamite to be fired. When all is ready the
man at the switchboard manipulates a switch, and the current
passes to the detonator and forces its way through the resistance of
the thin connecting wire. This wire becomes sufficiently hot to ignite
the gun-cotton, and so explode the fulminate of mercury. The
explosion is so violent that the dynamite charge is detonated, and
the required blasting carried out. Gunpowder and similar explosives
do not need to be detonated, and so a simple fuse is used. Electric
fuses are much the same as detonators, except that the tube
contains gunpowder instead of fulminate of mercury, this powder
being ignited through an electrically heated wire in the same way.
These electrical methods do away with the uncertainty of the slow-
burning fuses formerly employed, which never could be relied upon
with confidence.
Enormous quantities of explosives are now used in blasting on a
large scale, where many tons of hard rock have to be removed. One
of the most striking blasting feats was the blowing up of Flood Island,
better known as Hell Gate. This was a rocky islet, about 9 acres in
extent, situated in the East River, New York. It was a continual
menace to shipping, and after many fine vessels had been wrecked
upon it the authorities decided that it should be removed. The rock
was bored and drilled in all directions, the work taking more than a
year to complete; and over 126 tons of explosives were filled into the
borings. The exploding was carried out by electricity, and the mighty
force generated shattered nearly 300,000 cubic yards of solid rock.
CHAPTER XXVIII
ELECTRO-CULTURE
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com