Exploring AI for Healthcare: From NLP to Transformers
PROJECT 4 AI HEALTH CARE SESSION 2
Estimated read time: 1:20
Learn to use AI like a Pro
Get the latest AI workflows to boost your productivity and business performance, delivered weekly by expert consultants. Enjoy step-by-step guides, weekly Q&A sessions, and full access to our AI workflow archive.
Summary
The session is led by Tech Saksham in Gujarat, focusing on AI in healthcare, particularly with Natural Language Processing (NLP) and Transformer models. Through a detailed walkthrough, participants learn about the structure and significance of models like RNN, LSTM, and particularly Transformers, which overcome limitations of previous systems by processing entire sequences quickly and effectively using self-attention mechanisms. The session is interactive, encouraging note-taking and independent exploration to strengthen understanding and application of these technologies in developing AI-powered health care assistants.
Highlights
Learned the evolution from RNN and LSTM to Transformers, focusing on overcoming slow processing and limited memory issues ⚙️
Interactive session with practical advice on preparing for interviews and enhancing resumes 💼
Step-by-step guidance on creating environments and understanding library installations for AI projects 🛠️
Deep dive into the mechanics of self-attention in Transformers and the significance of query, key, and value vectors 🔑
Encouragement to write and share articles on platforms like Medium to build professional visibility and confidence ✍️
Key Takeaways
Understand the NLP basics and Transformer architecture to leverage AI in healthcare 🏥
Interactivity and hands-on experience are key—keep a notebook ready for notes and ideas 📓
Transformers have revolutionized NLP with faster and more efficient processing of sequences 🚀
Self-attention mechanisms are crucial for focusing on important parts of the data 🔍
The practical task involves developing a chatbot using pre-trained models from Hugging Face 🤖
Overview
In this comprehensive session, Tech Saksham elucidates the ABCs of NLP and Transformer models for aspiring AI professionals. Participants are guided through the intricacies of Transformer architecture, which enhances the efficiency of processing language data, crucially needed in AI-driven healthcare systems.
The session emphasizes the importance of practical learning and encourages participants to take detailed notes, explore further, and write articles to solidify their understanding. Hugging Face's pre-trained models are highlighted as resources to craft effective AI solutions.
Real-world applications are underscored, with Transformers being pivotal in developing sophisticated chatbots capable of nuanced understanding and response generation. This learning experience is tailored to equip attendees with the skills necessary for creating impactful AI healthcare applications.
Chapters
00:00 - 20:00: Introduction to NLP and Transformers In this chapter, the instructor introduces the basics of Natural Language Processing (NLP) and the concept of Transformers. The instructor recalls that in the last class, a model was used, possibly without complete understanding of its functionality. The aim of this chapter is to explain the architecture of the Transformer model in detail. This session is planned to last for one hour.
20:00 - 40:00: Tokenization and NLP Processes This chapter introduces tokenization and natural language processing (NLP) processes. The speaker encourages participants to actively engage with the material by taking notes, emphasizing that the topics are complex and cannot be fully covered in a single session. The goal is to provide participants with a foundational understanding and inspire further research into the discussed concepts.
40:00 - 60:00: Stemming and Lemmatization This chapter emphasizes the importance of understanding core concepts in Natural Language Processing (NLP), specifically focusing on stemming and lemmatization. It advises students to prepare notes on these concepts, as interviewers are more likely to inquire about the fundamental workings of NLP—such as Transformers and encoder-decoder mechanisms—rather than the specifics of a final model.
60:00 - 80:00: Stop Word Removal and Text to Numbers The chapter focuses on the concept of Stop Word Removal and converting text to numerical values within the context of transformers. It also discusses the architecture of transformers and the self-attention mechanism, emphasizing the need for clarity in understanding these concepts. The instructor plans to spend an hour explaining these topics to provide a foundational understanding. Learners are encouraged to further explore and understand these concepts independently. Additionally, the session will include addressing any doubts or questions.
80:00 - 100:00: Introduction to Transformers and Architecture The chapter 'Introduction to Transformers and Architecture' introduces readers to the key concepts and tools needed to work with transformer models and their architecture. It addresses common queries about project execution, creating and managing TensorFlow environments, and the importance of using different models in practical applications. Interns are encouraged to independently work on various models beyond the class hours, highlighting the hands-on approach of the learning process.
100:00 - 120:00: Encoder and Self-Attention Mechanism This chapter introduces the encoder and self-attention mechanism, starting with practical guidance on obtaining models from Hugging Face and transferring them into projects for hands-on learning. The speaker emphasizes the importance of understanding the architecture of transformers, despite the rapid advancements in technology, such as Deep Seek.
120:00 - 140:00: Decoder and Positional Encoding The chapter provides an introductory overview of the 'Transformers' technology, which forms the foundational knowledge for understanding further concepts. Emphasis is placed on starting from the basics, particularly in the context of an internship or foundational education program. The discussion hints at advanced topics like deep learning and ChatGPT models but focuses on the Transformers basics. Future exploration is indicated with a planned 'Ask Me Anything' session to delve into more complex topics, ensuring the current session remains on track with the chapter's theme.
140:00 - 160:00: Softmax and Word Prediction The chapter "Softmax and Word Prediction" begins with a brief housekeeping discussion about ensuring that all participants can see the screen clearly. It implies a continuation from previous discussions and sets the stage for the topic of softmax and word prediction. However, the transcript cuts off, limiting the available details for a full summary.
160:00 - 180:00: Practical Session: Environment Setup and Coding This chapter covers a practical coding session focused on setting up the environment necessary for coding. The instructor confirms that their screen is visible to all participants before proceeding.
180:00 - 200:00: Streamlit Application and Model Explanation In this chapter, the discussion revolves around the development of an AI-powered healthcare assistant. The focus is on exploring foundational knowledge before delving into model specifics. The participants in the conversation seem enthusiastic and are preparing to discuss detailed aspects of the model after setting the groundwork.
PROJECT 4 AI HEALTH CARE SESSION 2 Transcription
00:00 - 00:30 okay so today basically I'll be teaching you some basics of NLP uh and uh the concept of Transformer because even last class you would have seen us Jer would have I think he would have taken the model right model he would have used some model uh at that point of time you might have not understood what is this model doing what is this Transformer model doing you're importing Transformer so we'll be learning the architecture of Transformer for 1 hour we will be
00:30 - 01:00 looking the theoretical part and understanding what is happening behind uh I request everyone of you to keep a notebook Side by and write the concepts might be in detail we won't go that these concepts are quite big ones it's not something which can be done in one hour but I'll be giving a gist of that so that you can also give a research on those topics so in this one hour write down the topics do not simply Set uh it'll be very informative and all the topics which I'm telling go back and
01:00 - 01:30 revise those Concepts and make a notes out of it the reason why I'm saying is when you put this resume in your uh this internship in your resume interviewer is not going to ask you the final model he's not going to ask you show me the model which you have created no he will be asking you what how is NLP working what are the different things in NLP those Concepts regarding NLP he'll be asking your Transformer he'll be asking encoder decoder what what are how is
01:30 - 02:00 Transformer working what is the architecture of it what is self attention mechanism so you should be very specific about answering these questions when you when you've done this project that's the reason I'll be taking one hour to explain all these things not in a detail manner but I'll make you understand and make make you give a gist of understanding of what is happening it's your duty to go back and learn these Concepts okay and in the next 1 hour I will be showing you clearing you all your um uh doubts
02:00 - 02:30 regarding uh all your doubts regarding uh how to do the project and how to create AA all your tensor flow not uploading all these things will be cleared with creating an environment and further there is a task for you uh it won't since this is an internship this won't be ending with this class hours only you guys have to work on different models I will be using one model here you guys have to use different models I
02:30 - 03:00 will tell you where to get the models you'll get it from hugging face how to transer it and take the model and do your project okay so that will be completely hands-on experience for you okay so slowly let's start uh yeah I know deep seek everything is coming up guys every day there's a new thing coming up okay so uh but the basic thing is all the Transformers you should know the architecture so this deep seek which you guys are saying the technology behind
03:00 - 03:30 the base knowledge foundational concept is Transformers that's it's built on the technology of Transformers okay so let's uh let's slowly you you guys are doing a foundation it's a internship which is let's start from the basic uh okay yeah all those deep seek and chat GPT model thing uh we'll do it in the ask me because otherwise it will go outside of our topic right we'll be tomorrow we have ask me anything session
03:30 - 04:00 in that we'll be discussing about all these things okay so let's start guys now in the middle please make sure that with the candidate that whether the screen is visible sure sure sure okay because again you need to start from beginning yesterday we had
04:00 - 04:30 guys is my screen visible see yes okay I
04:30 - 05:00 can I get 2 three s and so that I'll start yes okay good great yes great great okay so we are doing this AI power health care assistant so let's let's look for some basic uh knowledge and before before going to a model uh okay
05:00 - 05:30 the agenda for this class is I'll be completing today uh the concepts of NLP two Transformers three introducing to hugging phas models okay and uh that the that would be the theoretical part and then we will go into uh to see the Practical one okay so let's start in the meantime I won't be looking
05:30 - 06:00 into uh I'll be continuously teaching because there are 200 students you might having having doubts when you're having doubts write it in your notebook keep it keep it in the side uh you yourself can answer it when I finish the session okay so do not uh keep on putting the doubts as such in the question bar because I won't be seeing it now when I'm teaching you you'll be cleared with everything if you have doubts that's great we will look into the last so let's start with uh what is
06:00 - 06:30 NLP you all know you would have been knowing now that NLP is natural language processing and U it is the field of AI that helps computer understand analyze and generate human language right so if a human says can you tell me the symptoms of a disease which your AI chatboard will do so the chatboard gives yes common symptoms of diabetes include frequent urination increased th thirst and fatigue or some other tiredness all
06:30 - 07:00 this will be there but how how does the chat B understand our question and generate a correct response uh right how is it able to do it so it has uh the three process which takes place one is text processing where you cleaning your the for the text analysis uh second is feature extraction where we convert the words into numerical form and three is model training using machine learning or deep learning to make the predictions that is how the NLP is bu bu being built
07:00 - 07:30 and in your project here we are not doing anything building in NLP we not doing NLP building we are using a pre-trained model okay we using a pre-trained model where it can generate because on Transformer technology but it's very important to know how NLP is working so let me break into step by step how the uh NLP process takes place so the first step which is known as tokenization I request you to all write these things things and uh make a notes
07:30 - 08:00 of it and what is tokenization tokenization it is a process of splitting a sentence into words which is known as you you split the sentence into words which is also known as tokens okay sometimes we even split the words okay using word splitter we can even use split the words but in general uh we split the sentence into words and if I give an example uh like if you have an input sentence that
08:00 - 08:30 the patient the patient has high fever and sore Thro okay so if this is uh the sentence after tokenization what happens is that it converts into the patient
08:30 - 09:00 has each word gets higher fever and sore throat so this step is what what you call tokenization process where every word every word in a sentence is divided and made into tokens and this step is crucial because it allows the AI to understand individual words instead of an entire block of
09:00 - 09:30 text okay clear about what is tokenization that's what tokenization is and you have your second step which is stemming and LZ stemming and lemmatization so basically step and lization is reducing words to their base
09:30 - 10:00 forms okay uh what basically doeses these methods kind of reduce words to their root form to avoid treating similar words differently uh like for example if you have a word known as running the stemming process converts into run run uh it's not a mistake I've written NN I'll tell you why I have
10:00 - 10:30 written NN caring gets converted into car better gets converted into bet this is what stemming does and do you think it's correct can if if I have a word better and after stemming I'm getting a word bet do you think it's uh it's right uh will the model be able to bet is a
10:30 - 11:00 different word itself but that's a root form which is being created so what stemming does stemming reduces words to their base form by chopping off prefix prefixes or suffixes so it doesn't really it doesn't have a vocabulary and it doesn't make sometimes sensible words but it reduces it if you take eating it converts into eat eaten it converts into eat
11:00 - 11:30 right so some of the words it turns into meaningful words but sometimes it turns into unmeaningful words stemming that's one of the disadvantage of stemming but this stemming operation Works in a very fast manner you can do models very fast when when you're working on stemming process but uh so where where do you think stemming can be used when it when it's creating root words but uh but the root words are not meaningful which
11:30 - 12:00 applications do you think that stemming will be more useful one is customer sentimental analysis like imagine if I want to uh get to know the mood of the reviewer uh from Amazon or Facebook what is the review you they'll be getting prod products will be getting almost one lakh to two lak reviews at that point I want to know what is the uh what is the is it a positive review is it a negative review right for
12:00 - 12:30 at that situations I do not require meaningful words also uh I can I can categorize one huge sentence if it's a disappointment sentence it can be categorized in the form of negative review in that situations in customer segmentation I can use the concept of stemming right and where to use lemmatization one second
12:30 - 13:00 let me change the new slide and you have LZ but before LZ I'll just tell you about what is the algorithm used in the case of stemming in the algorithm used just pter stemmer uh and from you if you want to use it in Python you can just from nltk nltk is the library which you use for NLP operations and from nltk do stem you need to import pter stemmer and once uh
13:00 - 13:30 uh you can just you can just try yourself from uh nltk nltk do stem uh you need to import P stemmer import pter stemmer uh see that s is capital letter and you insert a variable stemmer is equal to Port stemmer and just try uh
13:30 - 14:00 print stemmer dot stem and the word running just check what is going to come it'll it'll give output as run so this is where uh you can you can practically check it also might be some small mistakes out would run writing when you write it uh in your python code uh you can you can you can see that how the stemming operation is taking place
14:00 - 14:30 okay then the next process is lemmatization and in liation it uses a dictionary to find the actual root word which is also known as LMA which provides kind of an accurate results right so basically it has a it has a inbuilt dictionary in it and it produce produces meaningful words if running is running the word
14:30 - 15:00 running is uh lzed instead of stemmed it gives an output run and for caring instead of car it gives care so that's the advantage of lamez and one of the algorithms which we use for lization is word net lemon
15:00 - 15:30 izer so similarly how you did here you can import from nltk stem import word net litier and uh make a variable known as litier and word net lizer and use the same running uh print litier dolti running uh you can get run so now you'll be asking you why already lization is there why are we sometimes doing stemming the reason is Le uh
15:30 - 16:00 lemmatization lization is more accurate and this question which I asked you lization steming it's a frequent question when you apply for AI ml engineering jobs okay when they ask about when you write in your resume about NLP that you have done the libraries which you have learned is nltk this is a sh short question which is asked most of the time uh what is the difference between limitation stemming and then they'll ask you why are you using stemming uh sometimes even when it is bad so
16:00 - 16:30 litiz is it is more accurate but it is slower and stemming is faster but sometimes incorrect so that's why you need to uh sometimes you need to use lization so tell me in medical chatboard should I use use lemmatization or stemming if I'm
16:30 - 17:00 making my own model imagine I'm making my own model using medical data set i'm scrapping a lot of uh uh uh I'm scrapping a lot of papers lot of web web articles Wikipedia articles which is better lization right I'm getting l oh there are some students who are telling steming so medical data set it's better to use LZ because you need clear output you need you can't guess it like
17:00 - 17:30 customer reviews right so here in our AI chatbot uh in we are not using any lization because we using pre-train model but if you're creating one model we will be using lization rather than steming okay clear about it clear the difference about lemmatization and struming so let's move forward and keep your ears and mind open things cannot be repeated as we have a very short session uh
17:30 - 18:00 okay if time permits guys I will surely repeat everything that's not a problem for me at all and handwriting uh it's the pen and my handwriting is not that great also that's why I asked you keep your notebook when I'm speaking and writing you can also write with me okay then the step three which is there is stop word remove
18:00 - 18:30 removal or filtering out stop for REM removal or it's all filtering out unimportant words so basically stop words are common words like is the and a that do not add much meaning to your sentence okay these are verbs which are used which do not add much uh uh meaning to the sentence so if the sentence is like the patient has a fever and a
18:30 - 19:00 headache okay I have a sentence like that and if I use uh stop words stop for removal what happens I'll be removing the a has and a so it'll be having only patient fever headache right so basically this process is used for that for so that the chatbot has focus on the important words that's why stop word removal is
19:00 - 19:30 another important process in your NLP okay and uh you have in your nltk uh as nltk Corpus I think it's Corpus itself in your nltk Corpus you can import uh import Stop wordss you can import stopwords and uh you can import even word word tokenize and uh this can be used
19:30 - 20:00 to one this is for tokenizing the word and then to remove the stop words okay so it will you can uh you can filter the words from from the text which you whatever text you're writing uh if I give you an example let me just write it if I have a text that the patient has a fever and a headache or something like that I have and uh first I create the tokens uh writing word
20:00 - 20:30 tokenize if the text there's a text like this which is there I'll write word tokenize text and then I create the filtered words that is my important words which are there so I can use a for Loop uh like I for I and tokens if I do lower not in not in the stop wordss uh then uh print okay if I use this uh statement I can
20:30 - 21:00 get the filtered words in my from my text so that's where stop words is used I hope you're getting it okay you can try it just write down this you can try it afterwards uh in your python it's there okay so once stop wordss are also removed you have the next step step four which is
21:00 - 21:30 converting text to numbers okay and to do this you have different methods one is bag of words word to W cosine similarity
21:30 - 22:00 TF IDF which is also known as term frequency inverse uh document frequency term frequency inverse document frequency so you have TF IDF some uh these These are the common methods which are used to convert the text to numbers why are we doing this because computers do not understand words they understand numbers so we need to convert text into numerical format before using the Deep learning our ml models
22:00 - 22:30 right and I'll be teaching you I'll be I'll be explaining you TF IDF because it's this is little bit confusing to understand all the methods it's your task today to learn about these methods word to bag of words and also it is not only important to learn about this what it does why the other things have come up there is some disadvantage of bag of words because it
22:30 - 23:00 doesn't take semantic meaning so that's the reason ver to has come what does word ver to do what does tfidf do what does cosine similarity do I want all of you to make it because these are very very important questions your interview you will have when you submit when you put your this internship as your internship report okay so you need to learn about this I'll be giving you an explanation of tfidf and as the term itself says this
23:00 - 23:30 formula is term frequency that is TF into inverse document frequency IDF okay and what does term frequency mean term frequency is how
23:30 - 24:00 often word appears in a document that's what your term frequency gives you and you have IDF which is inverse document frequency what it does is it gives uh it gives less importance it gives less importance to common words uh it gives
24:00 - 24:30 less importance to common words for example what are common words that is the E and it gives more importance it not only gives less importance it also gives more importance
24:30 - 25:00 two unique words and how does it do I'll give you with an example so that it'll be very easy to understand okay U which word will I choose okay let me uh let me take something about disease only if in your disease data set I have diabetes and imagine it
25:00 - 25:30 appears three times in a medical article so what is uh the definition of TF what is TF how often a word appears in a document so if if diabetes is uh shown three times in a medical article then TF is how much TF is three am I right okay uh I'm
25:30 - 26:00 not able to see your answering but still I believe that you're getting the answer it appears three times in if diabetes is appeared three times in medical article then the TF is three and if diabetes appears uh only two out of th000 documents in this case the
26:00 - 26:30 IDF is very high why because what does IDF IDF it gives less importance to common words and more importance to Unique words if I get if I have diabetes 2 out of thousand documents I have diabetes words only repeating two times isn't that my IDF very high yeah it has to be high so my TF IDF score is the combination TF IDF score
26:30 - 27:00 is high and which means that diabetes is an diabetes is an important word are you [Music] clear okay so if if you want to uh if this concept you want to see it in Python it's very simple you need to import uh uh you need to import TF IDF
27:00 - 27:30 vectorizer uh just write it down and do a research about it TF IDF vectorizer okay that you need to import it and write a text and use this vectorizer TF IDF vectorizer and uh just try it out what happens take a small text okay and just write out and it will you will see how rare but important words get more priority in that uh in
27:30 - 28:00 the text which you have given okay do a give a try and the next is once TF IDF is done you're almost completed right you're almost uh done with uh the NLP tasks in your NLP what are the tasks in involved all that uh steps are involved you converted the words into numbers
28:00 - 28:30 also where TF IDF gives the rating how important the word is okay so let me brief about what are the steps we went to we did tokenization in this tokenization no before this tokenization you should also see that your text is in lower case lower case or in upper case because machine learning model there a tendency that the upper if it is in
28:30 - 29:00 the mixed format it has a tendency that the upper case will get more importance so first is to convert all your text into lower case or everything into upper case then you tokenize it where you split text into words then you do stemming stemming I'll write versus not R
29:00 - 29:30 stemming versus LZ LZ it's your control what to choose and it reduces words to their base form then you have stop word removal the where you filter
29:30 - 30:00 out common words and after you've stop words remote you convert into this one tfidf and finds important words and in this tfidf there are I I said in this process of converting numerical there are many uh things there are many other methods back of words uh you need to you need to learn about everything bag of words uh you need to learn about word to word to is one of the most popular one
30:00 - 30:30 learn about cosign similarity and you have another task you learned now NLP Basics so it's your time to write an article in medium anyone heard about medium medium is a platform where you can write your articles and when you have a role like a data science when you want to be a data scientist and get into jobs as a fresher it's very it's very competitive very tough I would say you guys are all in your engineering period
30:30 - 31:00 so write maximum articles projects do projects also do good projects like this which you're doing right now a good project at the same time write articles which are almost related to your project you might be thinking I'm not writing anything special or something it doesn't mind you need not do anything anything extraordinary for getting a job it might be small small simple simple tasks so please uh take some time today
31:00 - 31:30 itself it doesn't take much time you can you whatever you have learned today in a simple words write an article in medium you can use the help of chat GPT that is fine I want you to learn and once you write an article you find you find when you write an article see that uh you're writing it in the most simple words so that a Layman also can understand when he reads it who has never who doesn't doesn't have anything idea about what is NLP so how do you do it you can give example of projects and with this project position you can write this
31:30 - 32:00 article and uh after doing it if you find it it's very good I want to post it put the post you start putting uh putting it out in LinkedIn okay and that's regarding NLP now let's move into another uh concept which is wait a second I'll just look into question
32:00 - 32:30 answers you'll get uh you'll get all stoper this one I'm telling that same thing sahil uh it's not vast okay a few suggestions don't think anything is vast or something uh right make it very simple and if you learn it everything is very small you're doing this project in this project I'm telling you I'm I'm I'm
32:30 - 33:00 giving you all the topics which an interviewer can ask you I'm giving you every other topic which an interviewer can ask you when you when you showcase this project in your resume all right what are the types of questions you can I'm giving you all the topics you it's your duty to learn now and make a notes out of it okay it's simple write this is the project I'm doing now write all the concepts which are there and learn it and learn it it's very simple do you think these concept Concepts which I told you now is it
33:00 - 33:30 tough uh TF IDF is uh see model is tfidf is not the model uh TF IDF vectorizer is the model you need to import TF IDF vectorizer tfidf is a concept which is used there is word to W also so I'm that's why I'm suggesting you learn all the B bag of words word to W what is the difference between that these are some of the interview questions also being asked okay does it sound simple is it tough guys can you share these slides after session are you able to understand my
33:30 - 34:00 handwriting even if you if I share it's not going to help you a lot you'll be confused with my handwriting okay good good good great okay now let's move to Transformer and uh Transformer guys it's a very uh very V subject okay but I will be explaining you in half an hour with more most important things with example so I have I have made it in the very
34:00 - 34:30 simple manner so that you guys can understand and if you find it interested interesting or you motivated please please please take 3 days 4 days do research learn about it very very very important because everything whatever is happening the foundation now is the Transformer okay and in this section the in this uh I'll take almost 25 minutes uh I'll break down how Transformers work
34:30 - 35:00 focusing on encoder decoder structure and uh little bit about self attention mechanism in the most simplest ways possible okay so before we study about something it's very important to know why why do we need a Transformer and why Transformer became popular for that you need to learn about RN lstm because before Transformers we use
35:00 - 35:30 traditional NLP models like RNN which is recurrent neural network which is good for sequential data but it's very slow and you have lstm long shortterm memory which improved memory but still struggled with long sentences it had memory capacity but uh what happens is that when you have long sentences it is not able to remember that previous word that it is not able to connect with the word for example I'll give you a small
35:30 - 36:00 example the thing is uh just imagine a sentence the cat sat on the mat because it was tired doesn't it represent cat you can understand it because you know the language can my model understand right that it is a cat it can be it can
36:00 - 36:30 be sat also so how that how to bring that importance that cat is it and it is not sat or Matt this cat this it is represented by cat how that importance feature is going to come that is when Transformers came into importance and that's where the self attention everything you need to know about self attention all those articles came up it's a very interesting in thing and the reason why Transformers came
36:30 - 37:00 into popular is because RNN recurrent neural networks uh was not uh it was very slow it used to give a sequence but it was not g starting we hadn then Uhn is artificial neural network then recurrent neural networks came where it gave memory then you have lstm then it came Transformer so now we can't we won't be able to study all this now we'll be directly going to Transformer and these models this RNN and lstm this
37:00 - 37:30 model process words one by one slow and hard to remember long-term dependencies getting it it will it will produce one by one the next word the next word and it's not able to remember the previous some something which is there two three sentences back and it is not able to remember the that's why you call it is not able to remember the long term
37:30 - 38:00 dependencies and to solve this problem the solution was the Transformer model which was introduced by in 2017 uh 2017 or 18 uh 2017 uh by um it's a wasani and so many people and it was introduced you can all look into the article it's a very famous article attention is all you
38:00 - 38:30 need this this is the article which was being written where the concept of Transformers was and all your chat GPT open AI everything came after working on this Transformers okay so basically it is a process uh it processes the entire sentence at once instead of word by word making it faster and kind of more efficient that's what a Transformer does and let me go in depth
38:30 - 39:00 about what is Transformer and what is a architecture okay let's start so you understood why why Transformers came into picture now let's understand what is the architecture behind it basically it has encoder and a decoder encoder it reads the input sentence and understands it that's what
39:00 - 39:30 encoder does and decoder it generates correct response based on based on based on the understanding based on understanding it generates correct response that's what decoder does and encoder reads the input
39:30 - 40:00 sentence and understands it okay so for example let's take an example I know you do not understood this anything reads the input sentence and understands what does it mean there's no meaning until unless examples are there it's not very simple let me give you an example let me take this medical chatbot scenario itself and I give an I give an input what are the symptoms of
40:00 - 40:30 covid-19 and uh you know so in this Artic architecture I told there is an encoder decoder and I am giving an input that what are the symptoms of covid-19 right so the encoder what it does encoder understands and processes the
40:30 - 41:00 sentence and decoder generates an accurate response so that's what it does encoder will understand and process the sentence of what have written how it is done I'll show you the all the mechanism will come decoder it generates an accurate response uh like what what would their response common symptoms include fever cuff and shortness of breath
41:00 - 41:30 something like that right that's what uh the decoder will do sorry this is decoder this response will be by decoder encoder will understand the sentence and decoder will produce this uh uh this one how does it do it I'll show you first step of encoder
41:30 - 42:00 converting words into numbers that is also known as embeddings since computers don't understand words we first convert them into numbers using word embedding that is what I when I told you in the start that TF IDF almost similar to that
42:00 - 42:30 so I want you guys to research a little about what is this also what is word emitting how it works I will give you the output here how word embedding happens a little about little bit vectors you have to know uh you have to know how vectors it will be converted to zero one how this numbers are being generated so little bit do a research about word eming and uh I will just give you an output of how
42:30 - 43:00 converting words into numbers will happen that is after embedding after embedding of that sentence that covid-19 symptoms include include any what is the sentence which I have written covid okay yeah any sentence uh it gets embedded and it makes in the format of 1.2 0.5 minus 0.8 2.1 0.9 any number okay I'm just giving
43:00 - 43:30 random numbers it takes a process and does this uh after embedding these numbers are generated okay uh about this you to learn when you learn about word to no when you learn about word to you will get to understand how this numbers are being generated it takes the semantic meaning semantic meaning okay these words will come when you learn about it it takes semantic meaning it makes
43:30 - 44:00 relationship and it gives these numbers numbers to the words okay so that a meaning is generated between those words in the sentence that's the that's the reason these numericals are seen like this and once you embed the numbers once the embedding is done then there is a process known as self attention [Music]
44:00 - 44:30 mechanism and what is self attention mechanism self attention allows the model to focus on important words in a sentence while ignoring the irrelevant ones right uh so what I what I wanted to say is self attention basically uh it gives focus it gives focus on important words in a sentence if I have a sentence which says that uh what are the symptoms
44:30 - 45:00 of covid-19 it gives certain importance to the words uh like covid-19 symptoms so these uh words are given more importance and it allows model to focus on those important words and ignore the irrelevant ones in that sentence I'll give you a small example like take the same uh something any sentence um for example example let it be in the form of in this disease which we are working uh imagine
45:00 - 45:30 I have a sentence the virus spreads quickly causing uh fever right causing fever cuff and breathing problems if I have that sentence when uh I'll just write it uh write it some small sentence the virus uh spreads spreads quickly causing
45:30 - 46:00 fever cuff and breathing problems when analyzing this uh any word okay I'll take this breathing problems itself when I'm analyzing this bre breathing problems the model should focus more on which word which word should uh the model focus on when I'm telling that breathing problems are
46:00 - 46:30 there it has to be uh virus virus has to be given importance spreads has to be given right quickly I don't think causing fever cuff and breathing problems fever and cuff is also not much related the most important words are virus and spreads the is also not very important quickly is also not very important but some importance is there and this self attention mechanism does
46:30 - 47:00 this work what I did just now right how much importance to give each word how much this breathing problem is giving importance to other words that is what the self attention mechanism does very important concept and how does it work it works with uh three vectors uh it kind of uh there are three terms which are used and in the self attention mechanism which are
47:00 - 47:30 query key and value what are these this query it looks into what word are we looking at this key it it uh mentions
47:30 - 48:00 about how important is another word and value value gives uh uh like it gives the information we should focus on uh I could write it like um what
48:00 - 48:30 information should we focus on so these three words are very important what words are we looking at how important is the another word and what information should we focus on I will give you an example for this also Imagine I'm processing the word the same word which is
48:30 - 49:00 breathing breathing in that sentence what is a sentence covid-19 uh I made a sentence that a virus spreads quickly causing fever cuff and breathing problems so let me check how much breathing how much breathing uh is that uh how much breathing is given importance let me check that right so how to check that query is calculated
49:00 - 49:30 and query for breathing breathing is uh I give it as Vector one qu uh key for the another word virus Vector 2 and value for problems
49:30 - 50:00 I give Vector the the model compares the query and the key to find the most important words so what is what is query doing query was looking into what word are we looking at right that's what water query doing and what are the word word we
50:00 - 50:30 looking at we looking at breathing and key how important is the another word that is virus we are checking how important the virus is there then we calculate the value value is being calculated what information should we focus on this mathematical calculation is being done it's a very uh it's a very big process a lot of almost uh there is weighted you give weights for this query key and value these weights are initialized and the multiplication of the weights happen and further you get a
50:30 - 51:00 vector of this and this Vector is compared so it's again a very big process that can't be explained in this small class but I want you to understand what really happens and once this query key and value values are created whatever values you get so B just to get give a hint that you have query key and value there are some weights being assigned for it and these weights get updated also so so we multiply it with the weights and then we check how much how each score of the
51:00 - 51:30 value and further there is a step in which we get uh we calculate the attention score attention score which has a formula uh key dot query of value so this in this manner we calculate the attention score and if two
51:30 - 52:00 words are kind of related if two words are related then it will have high attention score and if two words are unrelated they will have low attention score for take the example of the same sentence what is the sentence the virus spreads quickly causing fever and breathing problems when the attention weights for each word in the sentence are given
52:00 - 52:30 virus uh will be having uh like attention score we are checking attention score with respect to breathing so if the same sentence the virus speds uh if it's there and uh if I'll be calculating what is the attention score with respect to breathing anything and I check with the
52:30 - 53:00 word word is virus there are other words spread quickly or what are the other word fever and cuff I'll write it
53:00 - 53:30 here cuff and problems should I write the and all those no because those will go in the stop words right those will be removed in the stop words itself those are not important so virus Accord with respect to breathing virus will have high uh attention score let me take as 0.9 spread will get high uh high but not
53:30 - 54:00 very high as virus so I give it as08 quickly how much attention has to be when you calculate that attention thing it will give a very low quickly is not that important and you have uh fever fever uh is see breathing we I'm checking with breathing so fever is quite related so I give it a score of 0. five I'm giving it in the calculation it is done by the by the computer this is the random values
54:00 - 54:30 I'm giving so this is how the scoring happens that's what I want to show you and cuff. five and problems problems problems is breathing problems so breathing should be related with problems in a very high manner right so it'll be getting high score so the model pays more attention to important words like virus and problems while ignoring those filter words are you getting
54:30 - 55:00 it okay someone is saying I know the ter term Transformer in e transformer uh in three years back four years back Transformer was very commonly or it's very important term which was used in primary Transformer secondary Transformer all those connections uh induction these were the these were this this is how Transformer was famous after
55:00 - 55:30 2020 the game changed uh and Transformer became more famous in the form of gpts all models okay for naven who has told me transform he loan was only Transformer in EC yeah when I was doing my engineering I also knew only Transformer as uh as primary and secondary Transformer it's only a after uh these models came that we let me look into some
55:30 - 56:00 questions okay okay great are you understanding guys okay great let me speed it up mightbe we'll extend a little bit more than seven that would be yesterday we had a class till uh 7:45 so I don't have a much problem
56:00 - 56:30 uh but I will I'll be I'll be uh finishing it by 7 don't worry about it because everyone has other works also where did I finish till attention score so once the attention score is done uh there is weighted sum of values which is being calculated uh the model
56:30 - 57:00 multiplies uh each word's value Vector each word's value you found their value right uh we had found out a query key and value so we multiply the each word value VOR by its attention score whatever we get and it then uh it it then sums it up it sums up these weighted values to to get the
57:00 - 57:30 final final result so basically with all this process what is happening the encoder is able to understand which words are important hey just just with curiosity I want all you guys to when naven just told that he knows only about Transformer and
57:30 - 58:00 EC uh there is primary Transformer and secondary Transformer did did they give this Transformer a name a Transformer because even in Transformer we have encoder and decoder just with curiosity it just uh went into you you guys also can check it okay I'm not very sure why why they gave this as a Transformer name might be it is because of this uh primary Transformers secondary Transformer Mutual induction some things are there in electronics and
58:00 - 58:30 communication all your Transformers which are there in your streets it works in this where the AC gets uh uh gets multiplied 100 times or so it gets boosted up that's what Transformer does in your streets uh so might might be that they have got this term they put this term as Transformer because it's resembles to this you guys also can check it okay okay great uh now we have completed with encoder let's go with
58:30 - 59:00 u let's go with decoder decoder will finish it very fast because decoding decoding we can also call it as positional encoding and how can I start it if I want to start decoder you should have a basic of
59:00 - 59:30 rnl but if you do not have a basic of rnl I will like it to write it like this basically RNN uh what it does is it does word by word and unlike RNN Transformers process all the words simultaneously it processes all words simultaneously then you'll be
59:30 - 60:00 asking me uh how does the model know the order of the words we need to know the order of the words right if there is a sentence if I do not know the order of one two where the position is there how is it processing all the words simultaneously so basically what it does is that there is something known as positional IAL encoding it
60:00 - 60:30 adds a special numerical pattern uh to each uh word indicating its position so in that example which I gave the covid-19 it gets position one symptoms gets position two include gets position three some other word gets position four and now the model knows both the words and the orders and the decoder
60:30 - 61:00 then generates the response how does it do step one it takes the processed information from encoder
61:00 - 61:30 applies the self attention again why I'll tell you basically to focus on the important words from the encoder that's the reason why self self attention is used and uh then it does another one uh middle middle work also which is known as uh Mass detention it applies
61:30 - 62:00 mask attention basically to prevent uh it's like masking it uh it to prevent seeing the future words while generating the text so basically what it does is that it will try to prevent the future Words which are coming up prevent the future words while it's generating the text when it's generating decoding what it
62:00 - 62:30 does decoder is generating the text it's giving the answers right when it gives these answers it tries to uh prevent seeing that future words while generating the text why I'll tell you and it has another final method which is uh I'll write it here it uses uh softmax softmax is a activation function which is used to predict next
62:30 - 63:00 word I know you're getting bored with Theory so let me take an example okay let us take the sentence uh let the input sentence what are the symptoms of covid-19 if this is a
63:00 - 63:30 sentence encoder will process it with the process which I said all the process which I mentioned in encoder it processes it and sends the information to the decoder and the decoder it will generate common symptoms like what is the it will generate it will generate that common symptoms include fever cuff and shortness of breath so how does it do it basically it takes the processed
63:30 - 64:00 information from the encoder that is uh wait a second pen is not moving why
64:00 - 64:30 just give me a second guys
64:30 - 65:00 okay so basically first US it takes the it takes the input from the uh from the encoder and encoder converts into numerical form right it converts into numerical form and once it reaches the decoder the decoder uses self
65:00 - 65:30 attention mechanism again and basically here it focuses on previously generated words so basically in the encoder uh unlike the encoder um the decoder generates like one word at a time right so when predicting the next word it must look at the previously generated word also to ensure that there is a
65:30 - 66:00 coherence in that and that solution is uh done with using the self attention mechanism which is in the decoder which helps it to focus on the most relevant words that is that it has already generated for example if the chatbot generates that common symptoms include fever for the that answer what are the com what are the symptoms of covid-19 it generated common symptoms include fever
66:00 - 66:30 it should now focus on fever before deciding what comes next that is what what might come after fever that is uh cuff or breathing problem something like that right so be it it will focus on the fever before deciding what comes next that is cuff so the decoder reuses the same self attention mechanism as the encoder but
66:30 - 67:00 applies it to the previously generated words it only applies to the previously generated words instead of the input words I hope you're getting it it's a little complex this but I
67:00 - 67:30 wait a second okay and you have another step which goes with uh masked self attention where it prevents the future words from being seen and if you ask me why we need this masking uh decoder unlike the generator it generates one word at a time while generating not encoding is
67:30 - 68:00 not one word at a time it Tak Sim whole text but decoder generates one at a time while generating the next word it should not look at the future words otherwise kind of it will be like a cheating right it would be cheating so decod that's one important question also being asked the difference between decoder and encoder okay so in encoder it's not uh it doesn't it looks the complete text not one word at a time but in decoder it generates one word at a
68:00 - 68:30 time and while generating the next word it won't look at the future words right so kind of imagine if the word generated was common the decoder
68:30 - 69:00 sees only common not the next word it only sees common and when word generated was common symptoms it will decoder sees only common and symptoms how it does the masked self attention layer it prevents the model from seeing words beyond the current position by setting
69:00 - 69:30 the attention score you know what is attention score it will set the attention score of the future words to to what to zero it all plays on self attention mechanism itself when I said attention score I explained you what is attention score so in decoder mechanism you it won't be looking into the future words that's what this that's what the
69:30 - 70:00 mask self attention layer does so when you have the sentence even common symptoms include fever the decoder sees only common symptoms include and fever it doesn't go into the next St how is it controlled by putting the attention score of the future words to zero
70:00 - 70:30 okay and once the decoder is focused on its uh uh its own past words what it does it it now looks at the input sentence to generate the relevant relevant response for it um the decoder kind of attends to the important words from the input uh by using that encoder decoder attention and uh finally it is able ble to give a relevant answer to the question
70:30 - 71:00 okay so if I say that example of what are the symptoms of covid-19 uh basically the encoder stores uh the important keywords like covid-19 and symptoms or decoder uses this information to generate cor it will generate the correct response that is common symptoms include fever cuff
71:00 - 71:30 and breathing problems right and in this architecture there is another thing which we missed one encoder decoder and the final layer which is known as soft Max which is for word prediction I want all of all guys to be good with artic architecture write an article also guys because you have learned something so the final layer of the decoder which
71:30 - 72:00 is soft Max layer it predicts the next word by kind of assigning the probabilities to all the possible words and um for example common symptoms include it is there uh the predicted next word which I want to get higher highest probability is being given it will be given to Fever if fever is there it will give 98 percentage probability and the next it gives cuff which is 96 and 92 shortness 94
72:00 - 72:30 so the words softmax function gives the probability and uh the words with highest probability will be selected as the next word that's how your Transformer architect works okay uh what I want you guys to do is uh
72:30 - 73:00 I know with with one hour span of time it's uh not possible for any human being to understand the whole thing but you got an idea of what are the important topics and the you need to you need to prepare when you give for an interview when you put this project right that's what my aim was also and U in a simple words I think I made you understand a little bit let's move on uh to the Practical part of it okay which you guys
73:00 - 73:30 are all waiting for I know give me a second guys for
73:30 - 74:00 uh give me 2 3 minutes uh I will come
74:00 - 74:30 back soon uh by 6:20 uh I'll be starting it 6:21 okay just give me 2 3 minutes e
74:30 - 75:00 e
75:00 - 75:30 e e
75:30 - 76:00 okay let's
76:00 - 76:30 start give 2 minutes more my laptop I
76:30 - 77:00 want to
77:00 - 77:30 connect give me two more
77:30 - 78:00 minutes we'll start soon
78:00 - 78:30 e [Music]
78:30 - 79:00 for
79:00 - 79:30 for
79:30 - 80:00 for for
80:00 - 80:30 okay so all you guys are ready now let's
80:30 - 81:00 start I'm there I'm there starting starting
81:00 - 81:30 will we get the notes of the section you will get the notes but um you won't understand my handwriting let me share my screen is my screen visible
81:30 - 82:00 this okay if you have any PDFs please share us sir guys you're doing an internship you're not doing a course I've given you all the necessary items uh you can um search search search and learn if I give spoon feed everything the learning will be less if it was a course or something I would have given you my notes or my handwritten notes but uh I
82:00 - 82:30 want you to work hard okay before uh we start with the coding I
82:30 - 83:00 always told uh it's a very good practice to create an environment before we start a project okay so look into this process guys and I want you to learn uh use this method uh for anything for ter to open a terminal uh you just need to go to terminal here a new terminal because yesterday I had some students asking how to open a terminal I'm specifying it uh in this change it to command prompt P shell is not something which I use much
83:00 - 83:30 so the first thing of doing any project is to start an environment to create an environment and for that you can create environment using python itself but I prefer uh and I would like you also to go on with that download Anaconda and use cond to create an environment a very good practice it is it goes very smooth all your problems of Transformers tensor flow not installing all that will get
83:30 - 84:00 solved so cond how to create it uh go to terminal and before going to terminal uh also when you start a project start a new folder and open the folder in your vs code how you open the folder in vs code and in that folder it automatically it automatically guess the path comes in this okay okay in this part K
84:00 - 84:30 create name I'm giving uh the name as um uh Health Heth and python version I prefer to give 3.10 because quite stable version I'm not using the newest new
84:30 - 85:00 version giving yes so there are two two ways you can either create an environment in your uh in the cond environment or you you can create an environment in your folder also I prefer folder but here I uh just
85:00 - 85:30 this one I did I'm creating the environment in the cond itself that's also fine but if you want to create in the folder K create minus P then give the name python 3.10 it will the environment will be created in the folder itself okay so that's how you create an environment and further I can activate K activate health I'm activ activating it you have to activate your environment which you're using K activate health so once I do see now my uh thing
85:30 - 86:00 is about health it's going the environment which I've created is Health environment okay so you can give any name it's your name you can give any name for your environment I've just given health because this is regarding to health bot and once this is done you need to install all the necessary things in your Library what are the I have requirement streamlet Transformers tensorflow nltk
86:00 - 86:30 TF caras so all this I need to install for installing all that pip install minus r requirements requirements requirements.txt so once I do this
86:30 - 87:00 oh I spelled it wrong F install minus r require B B do txt so once I give this every libraries
87:00 - 87:30 which I want to it gets installed which is required for this project and it gets installed in the right path that's the importance of using environment okay it gets properly installed so that you won't get that errors when you're doing the project it takes some time we'll wait till it gets this one
87:30 - 88:00 so let this go on it takes it might take some time all you have any doubts please give all commands in chat one
88:00 - 88:30 second cond create name uh Health uh and python is equal to 3. one Z so if I give this I create an environment and it will ask yes or no
88:30 - 89:00 you just need to give yes and then uh you have to uh after creating you have to activate activate cond activate and it will only be working if you download anakonda go to Chrome and download anakonda software okay it's already installed uh I'm not even know it's fine you can use Python also K activate and those who have not
89:00 - 89:30 installed uh when you're installing Anaconda uh the first instruction it comes click on that uh tick uh take it as a path there is a there is a it comes when you install Anaconda it gives uh some two three boxes to pick and the first box it will say it is not recommended but you have to click on the text then only that path will be taken if that is only being done then when you using cond Create it will work otherwise
89:30 - 90:00 it will give an error for you so those people who when you are installing you have not done it uninstall anakonda and again install anond when you installing please sck on that box that first uh step which is coming okay or else uh you have to change the path if you go to Windows you have to go to environment variable and it edit the path and past the path that's a little more complex thing so those who have not
90:00 - 90:30 just uh be sure when you're installing it okay this distal gpt2 model does not give proper answers and gives repeat at words yes that GPT model is not uh very good model it doesn't give great answers I know that uh and uh so that's what you have another tasks to be done you it's not simple the model is only the architecture for you to create the streamlet uh you have to go to hugging phas and select good models I'll be
90:30 - 91:00 telling you how to select good models but it takes a lot of time uh little efforts also will be taken and you have to uh you have to work on different hugging face models I'll give you certain models which are very good in this one but always see that the models which you use it a CPU only if you have a very good system which is like 16GB RAM and uh uh GPU nvds GPU with 4GB uh graphics card if you have only these
91:00 - 91:30 features those big models will work in your laptop okay uh or else you have to do it in Google collab by taking a subscription and uh changing it to GPU because you those uh that's the reason we have used this uh small model um distal GPT it doesn't give great answers but we all have a CPU right now and uh that we we we're not having a GPU right so focus on this streamlet application
91:30 - 92:00 which you making and you can look into hugging face different models uh for medical question answering okay when enter cond create command giving error of path ah Mani work mode you're getting the uh error of the path that's the reason is because when you installed anakonda you didn't tick it you didn't create the path you have one method is go to the start button and uh environment variables go to the environment variables and you have to
92:00 - 92:30 edit the environment variables and take the path of that environment you have to check in which path it has it is there and you have to past that environment there is a quite uh tough process I would suggest what I would suggest is make it very simple uh uninstall your anakonda and install then you're installing ticket okay so that path is being generated if that is also tough for you use Python environment how to use Python environment uh go you have to do it on your own guys every
92:30 - 93:00 small small things it's very tough to explain here okay uh we have already created in the previous session and it's working well should we change it no don't need to change it if it's working well for you everything is working well you seeing your stream this is only for those people who are getting errors I'm getting I've got a lot of messages uh through Linkedin on WhatsApp people saying that I'm getting error I'm getting an error it was very tough for me to uh give answers to all that's the reason I came with this session of K this one it's man is your building chatboard
93:00 - 93:30 using API key very good you can do it go on but um what if somebody misses today's class your questions are very great recordings will be there man don't worry about it but 2 hours live class will turn into 8 hours class when you watch it in recording session that's a reality okay
93:30 - 94:00 let's continue cond activate health I type this codes I will get it P sir tomorrow he will be explaining regarding placement sessions also there
94:00 - 94:30 is some placement Readiness program uh which is introduced in your LMS you would have seen it uh it's a very good uh this one he'll be explaining everything about it okay so once uh see everything is installed properly let's move into the coding part I'll be explaining you the coding part what is going on in this uh process what are we trying to do do and we will just check how weird the answers are coming with this model and I'll tell you how to go to hugging phas and get
94:30 - 95:00 different models Also let's start so initially uh you import streamlet uh Transformers nltk n. Corpus and n. tokenize you you know what what is Corpus now in the theory class I mention nk. Corpus for stop wordss right and nl. tokenize see now you are able to relate it right why are we doing this that's more important than the coding coding you can get it from chat gbt also but
95:00 - 95:30 why and how are we processing it that's more important so nltk is a library which is used for natural language processing task and uh we we are taking the stop words removing stop wordss and we are even tokenizing the words right and Transformers uh what is Transformers that's where you're what you learned about Transformers right from Transformers We Are importing pipeline it's it loads a pre-trained AI model
95:30 - 96:00 from hugging phase to generate certain responses right now we also need to download U uh uh the Punky and stop wordss okay so what is puny punty is uh uh it downloads kind of essential text processing data like punctuation rules and common stop words as I mentioned those unimportant words for text
96:00 - 96:30 cleaning so basically this part is for text cleaning and then we load our pre-trained model which is distal GPT and uh the model generates text response based on their input right we have uh we on I will show you different what are the different other models which you can use from huging face and uh uh that can be used for your process okay and uh further after I'm using the chatbot I'm directly using the pre-train
96:30 - 97:00 model I'm also defining certain logic which is very uh given which which is I'm giving a little bit logic also for my Healthcare chatbot what it has to give a response for what inputs I'm giving right for doing that uh I'm I'm giving that if certain keywords is symptom uh appointment or medication are found in the users input uh it should give the predefined uh responses right if it's
97:00 - 97:30 symptom I need to write uh it seems like you are experience experiencing symptoms please consult a doctor for accurate advice so when I run this model and I give a word symptoms it will give this response uh it won't be taking a response from the pre-train model and uh if it is appointment if I have appointment in my user input if there there is a word like that uh I would then I would like like to give a message like would you like me to schedule an
97:30 - 98:00 appointment with the doctor now you might be thinking there might be sometimes we use these words for different purposes how are we going to that is all now your hands how you're going to think it you can you can Define it you can make it in the most logical way we are just giving you a framework how to do it and of course we do have the better versions of this but uh if if we give everything then this is not an internship but try try try maximum to
98:00 - 98:30 make this model in a very uh very user case and weely looking into who has conducted who has made into the best models who has done some research it takes time you have to do the research we will check it if you have any doubts please do you can ping uh me on LinkedIn or anything you can send me screenshots I might take one day to respond because there are a lot of students from every batch uh but if uh if it's a relevant one I I'll just check it out and if it's relevant one I will surely be messaging
98:30 - 99:00 you back and if you used a very good model and if you have tuned it very well and created more respon more Healthcare jard those uh will be appreciated very well okay so for every uh this one I'm giving for even some medication then it's important to take your prescribed medications regularly if you have a concerns consult your doctor so these are the basic answers which will be coming up if I have these words being present in my chat uh in my input and I'm giving also
99:00 - 99:30 else if anything of nothing of these are there for other inputs uh I will be using the hugging phas model and in my hugging phase model I'll be using user input or whatever the US US input is being given uh I'll be you can increase the max length I'll be increasing a little bit with 300 I can put uh that's the how much length I need it limits the response of the length how much the AI has to be
99:30 - 100:00 given might be in this situation it will repeat a lot of words um and what is the return response I need uh I need only one response right so I give return as one response and uh further once this is being done um the process is to create this web app very simple process we have only just two a chatbot is just we have an we need a title that uh I'm defining main as this one and I'm giving the title as
100:00 - 100:30 Healthcare assistant chatbot and further I'm giving my user input uh text input how can I assist you today so the chatbot is showing how can how can I assist you today and uh you have a so in this STD text input it takes the input it creates a text box and it creates an input and also I need to create a button of a submit right I want a button of submit when I click the submit it gives the response for it uh
100:30 - 101:00 if the user enters a query kind of a query it calls the healthcare chatbot that is uh user input that it goes into that Healthcare chatbot user input right it goes here so that's what I'm defining it here that uh if the user enters a query then the response has to go to the healthcare chatbot and I'm writing sd. WR Healthcare assistant and the response else sg. WR please enter a
101:00 - 101:30 query if this thing is not given and to write please enter a query right very simple and uh if name if uncore uncore name this one to main main this is always used and it ensures that the main functions runs only when the script is executed directly okay for every streamlet when we end it we end it like this and basically what it does it uh it ensures that the main function runs only uh when the script is executed directly
101:30 - 102:00 so once this model is uh being you you got understood the framework uh I can I can paste it in the chat box if you require it's fine I will send you this file itself I will send you this file in your WhatsApp group because uh this is this is not the output which I'm I'm wanting from you also if you're if you're creating the same thing it's not going to lead a lead us a project great project uh you take this framework
102:00 - 102:30 keep the stream but use different models okay
102:30 - 103:00 uh Karan Boer very okay let me just so can we do the same in this like storing data in form of folder with PDF or text but how much it's a very good practice Karen if you're doing that very good uh if you're doing this type of chat B because uh but this is a very generic no how much how much long text will you take you have to give a lot of text regarding medical issues people may ask in a different manner it will take a lot and lot of time to do that uh to train
103:00 - 103:30 that text in that way and making it read uh you can you can go for it if you're going for it great great work uh but you have some hugging face models uh which is us used for medical terms you can search it an hugging face website um and I built using llama model with functionality so would it be allowed as submission I also had it vectorized PDF very good man why it's very good
103:30 - 104:00 to we are not looking for someone who has created the same thing if you're creating the same thing it's not a internship right if you're doing something different great very good work uh if the model is going to produce good results uh very good work carry on okay let me give you the
104:00 - 104:30 model able to copy M what I will do I will send you this file guys okay I'll send you this file this code file itself in your WhatsApp all of you there in the WhatsApp I believe uh so don't worry about this code this one this will be sent you can
104:30 - 105:00 use this uh model the basically what the changes will happen is when you're using different models you will change this model this model here I use digal gpd2 you have to use different models from the hugging phas you can search about it and use it and those who are using Rag and just to create chatboard with predefined text go for it try it you will learn a lot of things okay so
105:00 - 105:30 once this is done once you have written the whole code you have defined the code also uh I go and I run my streamlet page so streamlet uh run app.py
105:30 - 106:00 just give me a second
106:00 - 106:30 e e
106:30 - 107:00 it takes some time um still running fact it's taking a lot of
107:00 - 107:30 time I hope yeah so it is opened
107:30 - 108:00 uh I only joined the telegram group can I use multiple models in one program uh what does multiple models mean ready I didn't get you yes you can use API key tell us about report uh report will be mentioned February 2nd next week speak can we do a different chatbot model by using this model as a reference for our project yes but this project has to be Ahi you at project is a chatbot
108:00 - 108:30 don't change your project title guys and what your project you're doing also it should be a chatbot this one WhatsApp link uh I think WhatsApp group most of the students should be there if you're not there let me let me speak to P I'll be uh I'll be sending the files
108:30 - 109:00 give access Aditya you're using don't why are you not giving access you can download K naen download install K while installing click on that path this one it it shows that it is not recommended but still click on it and then only this will
109:00 - 109:30 work all your errors will get solved when is the last date I think it will be after February 10th itself so you have an ample amount of time okay uh okay I'll just share you uh this model I'll just I have not shown you how the model is looking like so this is how your model will look Healthcare assist in chatbot how can I assist you today see these are the simple things which I gave in the streamlet streamlet is so easy to use now if I write something uh it will give
109:30 - 110:00 a weird response I know that I need U that's because the model distal GPT is not a great model for medical use cases that's the reason it's giving very bad uh response but still let's try with something what is it coming with we'll just check it out okay m I'll try WR
110:00 - 110:30 uh what should I do if someone is having a heart attack try that what should I do if I what should I do if someone is having a heart attack it'll give weird response but you got a framework how to use the hugging phas model right go to hugging phas uh this one and how to do it
110:30 - 111:00 still running
111:00 - 111:30 it's taking a lot of time K create minus P VV python equal to 3.4 that is used for when you want to create
111:30 - 112:00 a fold your environment in the folder itself now I have created my environment in the cond thing it is in a different fold this one if you want to create in your environment in your project folder you can use minus P it's a very good practice this is better practice to use okay recording link on WhatsApp group I'll ask pan uh to do it I can't do the joining thing you have
112:00 - 112:30 to speak to Pavan guys speak all this anything regarding uh regarding to attendance all this please uh look into Sumit can you please post your question again sir will we will we be provided some apis for further development of chatbot no you have to search it search search research guys uh you
112:30 - 113:00 have uh chat GPT you have deeps everything is there do a good research and guys everyone I want uh the previous batches also they have started writing articles uh first batch has written about diffusion model one person has written it in a very beautiful manner about diffusion models uh explaining every even definition model is something which is which is complex topic she has written it in the most simple manner the way I've explained it so Kus to her like
113:00 - 113:30 the way she has explained so that even a lay man can understand it I can I will send you that link to the WhatsApp the way she written so that's where I'm saying uh the importance of writing articles so if you have learned something new the theoretical concept and you feel like you want to you can you can write that in the most simple manner start writing start beginning writing because a data scientist a AI engineer should be very good with having lot of articles in in his domain in his
113:30 - 114:00 uh this one uh the number of Articles if you start with small small things by after some days it'll be a practice write weekly at least one article and it by end of one year you'll be having a lot of Articles being written by you and when when it comes to recruiting when it comes to recruiting you are surely going to have a hire this one to get recruited right uh you might say that what is just copy paste from chat GPD no writing article is not just I can understand from two three words whether it's copied
114:00 - 114:30 from chat gbt you can copy from chat gbt that's not a mistake but even how do you prompt the chat gbt to give it in the most a simple way and understand it the most important is how you understand it and also in the Articles include some good uh uh include some good images so that a Layman can also understand it and I will surely read those articles uh you just need to uh how can uh you just you can send me on LinkedIn or you can tag me on LinkedIn when you when you post it
114:30 - 115:00 that's more than enough uh already that's of no use I guess it's it'll be getting lot of why are you using IF example chat uh if response chatboard one chatboard 2 you using multiple models how is it going to help I'm not very sure about it I think it's not going to help you much because there are very good models on medical
115:00 - 115:30 system itself on on in your hugging phas have a research about it have a have a check on it uh you might have to import some more some more libraries like accelerate and torch when you are using certain models from hugging face that it will be given there itself you can check it out you can use CH GP also you can check it out okay uh please okay I'll sh share you my LinkedIn ID wait a
115:30 - 116:00 minute hey it gave a response uh what should I do if someone is having a heart attack did you see the response very weird if my chest aches the rest of the time what are the risk of my chest to be affected the more I feel my chest aches the rest of the time the more the pain I get at my chest the more it would be like a car accident if I have an abdominal pain like this I
116:00 - 116:30 might have high risk of chest guys I don't want like this type of answers if I'm a chatbot uh don't come up with this uh weird it's very weird you have to you can control your models also by uh changing the temperature and all those features uh work on it Bola y sir I have already done this can give you can some details why it is running very slow it runs very slow you're using a hugging phas model it runs in the speed itself and it depends upon your PC also so it is given a
116:30 - 117:00 response you can see the response right a weird response so these responses are not you can use a different model guys okay uh let me share my LinkedIn ID I will just uh just wait a second you can search me as ARP uh it'll it I hope it'll be I work in edunet Foundation DP uh you can find me
117:00 - 117:30 there that's my name and U I hope it will be let me stop the recording