Lecture-28 - ChatBot Using OpenAI Streamlit
Lecture-28 - ChatBot Using OpenAI Streamlit
Exciting! we are diving in code and showing you the its structure
today. During the coding we would tell you about ethics, rules of
coding, mindset and approach. We would present it in generic form so
that it may help you in case in doing any form of coding. It must keep
in mind that even after having vast experience of 10 or 20 years, you
will always find difficult the code that is written by others. It is
the patience that needs to be practiced at that time. Take some time
and let the brain absorb that code. You will see that code after some
time would look like technical love letter to you. To day we are going
to start the coding round of hackathon.
Although, the concept of NLP exists more than two decades, but
revolution in this area has evolved during the last two quarters. The
areas like NLP, ChatGPT, ChatBot etc are among the top searches of
Upwork which are being discussed in our lectures. These areas can play
their role in economy. Chatbot is one of these enabling technologies.
Chatbot can be applied at the areas where there is customer
interaction like reception, customer care and in many other areas. It
is most suitable to ask, what are the areas where chatbot could not be
applied? Difficult to find these areas. Every organization, business
and commerce require chatBot not only for the external interface but
also for framing the internal policies their employees have to follow,
for developing systems through which employees will communicate with
each other. For facilitating all business needs of the organizations,
chatBot is the revolutionary technology.
Previously chatBots were utilized in customer services, now due to
their application in vast areas, we say it SuperBots. In the past for
making any type of decision related to expansion of business,
financial goals, strategical goals, technical expansion, HR, a
meeting with department heads, HR heads, Accountants and CFOs etc was
called for taking inputs from them in order to reach a decision of
strategic nature. So, in order to make a strategic decision input from
5 to 6 experienced or experts was required. Input from them was based
on textual data of their relevant field or department. So if the input
is related to textual data than why humans are between input and
decision making? Let us replace SuperBot with humans which will take
input from the textual data and will help in making the best strategic
decisions. We all know that human decisions are biased but not is in
case of technological decisions which give you accuracy. That’s why we
say that ChatBot is the technology everyone needs.
Toay’s lecture will not make you expert in chatBot. We will over view
the its structure, its connectivity with front end, how APIs are
called, how cods are deployed, how communications are made, how packed
are passed, how information is passed on, how information is
retrieved.
Prepared by: Tahir Mahmood 0321-5111997, What up 0312-8536439
2
user and response generated from AI. Now third thing which is role of
chatBot would also be included in it.
Remember chaBot is like a machine and knows nothing except what is fed
into it. So we have to remind it about its identity and function it
has to perform and keep building its memory about the scenario of
discussion.
We are defining its name as you are AI mentor. The name given to it
would exactly be reflected in the behavior while generating the
output. This is the basic working to start the prompt and by analyzing
its output more checks would be applied to Do’s and Not to Do’s for
improving its performance.
Now stage wise instructions to the ChatBot for controlling the prompt
has been given as follow: These are called guard waves.
So there is system message and have complete prompt which will act as
prompt base knowledge upon which behaviour of prompt will depend.
Now zinlongest function will comprise user past messages and messages
generated by AI, a loop comprising two variables human_message and
AI_message will be applied. Human_message will relate to past messages
and AI message variable will relate to message generated by AI