Build your own chatbot using Python | Python Tutorial for Beginners in 2022 | Great Learning

Sdílet
Vložit
  • čas přidán 12. 09. 2024

Komentáře • 198

  • @greatlearning
    @greatlearning  Před 2 lety +8

    Register and get free Certificate for the course: glacad.me/3Hn1pKh
    Topics Covered
    00:00:00 Introduction
    00:01:58 Agenda
    00:03:57 Did you know?
    00:08:24 Introduction to chatbots
    00:16:57 Types of chatbots
    00:22:11 Top applications of chatbots
    00:28:03 Architecture of chatbots
    00:33:37 How does a chatbot work?
    00:45:12 Hands-on Demo with Python
    01:02:58 Summary

    • @harshalchaudhari2444
      @harshalchaudhari2444 Před rokem

      import numpy as np
      import nltk
      import string
      import random
      f=open('chatbot.txt','r',errors='ignore')
      raw_doc=f.read()
      raw_doc=raw_doc.lower()
      nltk.download('punkt')
      nltk.download('wordnet')
      sent_tokens= nltk.sent_tokenize(raw_doc)
      word_tokens= nltk.word_tokenize(raw_doc)
      sent_tokens[:2]
      word_tokens[:2]
      lemmer = nltk.stem.wordNetLemmatizer()
      def LemTokens(tokens):
      return[lemmer.lemmatize(token) for token in tokens]
      remove_punct_dict = dict((ord(punct),None)for punct in string.punctuation)
      def LemNormalize(text):
      return LemTokens(nltk.word_tokenize(text.lower().translate(remove_punct_dict)))
      GREET_INPUTS =("hello","hii","greetings","sup","what'sup","hey",)
      GREET_RESPONSES =["hii","hey","nods","hii there","hello","how can i help u?"]
      def great(sentence):
      for word in sentence.split():
      if word.lower() in GREET_INPUTS:
      return random.choice(GREET_RESPONSES)
      from sklearn.feature_extraction.text import TfidfVectorizer
      from sklearn.metrics.pairwise import cosine_similarity
      def response(user_response):
      robo1_response=''
      TfidfVec = TfidfVectorizer(tokenizer=LemNormalize,stop_words='english')
      tfidf = TfidfVec.fit_transform(sent_tokens)
      vals = cosine_similarity(tfidf[-1],tfidf)
      idx = vals.argsort()[0][-2]
      flat = vals.flatten()
      flat.sort()
      req_tfidf = flat[-2]
      if(req_tfidf==0):
      robo1_response=robo1_response+"I am sorry!I dont understand u"
      return robo1_response
      else:
      robo1_response = robo1_response+sent_tokens[idx]
      return robo1_response
      flag=True
      print("Bot:My name is Harry.Lets have a conversation! If you want to exit ant time,just type Bye!!)
      while(flag==True):
      user_response=input()
      user_response=user_response.lower()
      if(user_response!='bye'):
      if(user_response=='thanks' or user_response=='thank you'):
      flag=False
      print("Bot:You are welcome..")
      else:
      if(greet(user_response)!=None):
      print("Bot:"+greet(user_response))
      else:
      sent_tokens.append(user_response)
      word_tokens=word_tokens+nltk.word_tokenize(user_response)
      final_words=list(set(word_tokens))
      print("Bot:",end="")
      print(response(user_response))
      sent_tokens.remove(user_response)
      else:
      flag=False
      print("Bot:Goodbye")

    • @harshalchaudhari2444
      @harshalchaudhari2444 Před rokem

      Respected Sir....Syntax error for 'else' showing....what should be the correction??

  • @greatlearning
    @greatlearning  Před 3 lety +10

    🔥 Get your free certificate of completion for the Artificial Intelligence with Python Course, Register Now: glacad.me/3JnI7pB

    • @hammadawan9116
      @hammadawan9116 Před 3 lety

      Great Sir Thank you ❤️
      Sir i have one question can i use your videos for my website? Please Allow me

    • @vkgautam7980
      @vkgautam7980 Před 3 lety

      @@hammadawan9116 he would of course refuse. It's not right to take somebody else's work

    • @hammadawan9116
      @hammadawan9116 Před 3 lety

      @@vkgautam7980 yes you r right brother 👍

    • @olgastarostina8621
      @olgastarostina8621 Před 2 lety

      8г888г88б88г8гг⁸г88г8гг8г

  • @nabeelhyderchohan5373
    @nabeelhyderchohan5373 Před 3 lety +22

    Amazing and great video in terms of learning new things, need more sessions like these which may help the Learners.

    • @greatlearning
      @greatlearning  Před 3 lety +1

      Thank you, we're glad we could help you😇 Subscribe to our channel for more such content, and hit the bell icon so you are always notified of updates from us!

  • @niharoad4483
    @niharoad4483 Před 3 lety +17

    I've been waiting for this, thank you. Is it possible for you to upload one more like this about building your own video calling website (like google meet)

    • @greatlearning
      @greatlearning  Před 3 lety

      Thank you for the suggestion, we’ll try and look into it! So, subscribe to our channel NOW and hit the bell icon so that you never miss an update from us😇

    • @runtime02error66
      @runtime02error66 Před 2 lety +5

      @@greatlearning this is a bot

  • @akankshajoshi3868
    @akankshajoshi3868 Před 2 lety +6

    Very well explained! Loved the technical knowledge provided by the video.

    • @greatlearning
      @greatlearning  Před 2 lety

      Hi we are glad that you liked our Content Please do subscribe to our Channel for Similar & Awesome Content

  • @brianthomas9148
    @brianthomas9148 Před 2 lety +12

    Extremely beautifully explained and recorded !!!
    Hats off to your dedication !!!

  • @shefalibhattacharya3434
    @shefalibhattacharya3434 Před 3 lety +4

    hello! thanks for this tutorial. it was very useful. i have 2 errors; please help me out. in the text preprocessing, i am getting error in the very first line and it says that nltk is not defined, but i have imported nltk. the next error is coming in defining the start and end protocol where the control goes to function greet and there the random library is said to be not defined. i have imported both the files. i have checked all the syntactical errors and everything is as same as shown in the video. please help me out. thanks!

  • @thobeycampion5387
    @thobeycampion5387 Před 2 lety +2

    Incredible video. Great historical perspective. Thank you!

    • @greatlearning
      @greatlearning  Před 2 lety

      Hi we are glad that you liked our Content Please do subscribe to our Channel for Similar & Awesome Content

  • @Vipul390
    @Vipul390 Před 2 lety +2

    Hello Sir, How can i make a chatbot which ask questions and constructs the question based on user response, more like an interview session ? What kind of corpus should i use for this ?
    It will be really helpful if you can help me out

  • @cutiserzero963
    @cutiserzero963 Před 2 lety +2

    Thank you sir. I showed your own project for my end term. You were very helpful

    • @greatlearning
      @greatlearning  Před 2 lety

      Hi we are glad that you liked our Content Please do subscribe to our Channel for Similar & Awesome Content

    • @mohdfaizel8327
      @mohdfaizel8327 Před 2 lety

      bro can you please share this project ?

    • @vamsikrishna8082
      @vamsikrishna8082 Před 2 měsíci

      please give us source code to do the same

  • @ranjitnambisan8023
    @ranjitnambisan8023 Před 2 lety +3

    Hi, This was a great video. Thanks. I would like to know how to put in production I mean how can we use chatbot for different language say Hindi. and if i have a website, how can i integrate this chatbot in Python to my website.
    Thanks

  • @pankajkunekar2101
    @pankajkunekar2101 Před 3 lety +3

    Can we have an implementation of epilepsy seizure detection and prediction project demo please?

    • @greatlearning
      @greatlearning  Před 3 lety

      Thank you for the suggestion, we’ll try and look into it! Alternatively, check out our CZcams video on "Coronavirus Outbreak Prediction using Machine Learning in Hindi" here: czcams.com/video/jLnLfAPL-iY/video.html Subscribe to our channel NOW and hit the bell icon so that you never miss an update from us😇

  • @vishnujatav6329
    @vishnujatav6329 Před 2 lety +1

    Amazing vide, I have learnt a lot from this video. The instructor is awesome. Thank you

  • @chetanbedi07
    @chetanbedi07 Před 3 lety +8

    Sir I'm getting an issue again and again.
    My chatbot shows an error when ever I type " What is data science " But if I write " Hi, hello" Then it works!
    It shows me the error in ( defining conversation start/end protocols) 18th line of code and tells (name 'TfedVectorizer' is not defined.)
    Please help me out!
    And thankyou sir for this tutorial ❤

    • @greatlearning
      @greatlearning  Před 3 lety +5

      You have a small typo - It is not TfedVectorizer, it is TfidfVectorizer. The video has the correct syntax. Please refer to the demo.

  • @mohinpatel2179
    @mohinpatel2179 Před 2 lety +3

    Your stop_words may be inconsistent with your preprocessing. Tokenizing the stop words generated tokens ['ha', 'le', 'u', 'wa'] not in stop_words.
    warnings.warn('Your stop_words may be inconsistent with '
    Getting this error. How to solve it?

  • @navneetsinha451
    @navneetsinha451 Před rokem +2

    Please share the code ad data. Thanks.

  • @takudzwamachida8077
    @takudzwamachida8077 Před 3 lety +1

    great staff ...
    how do i create a chatbot linked or trained with data from a csv file ?

  • @dhruvchopra3848
    @dhruvchopra3848 Před 2 lety +1

    Very well explained!! Thank you!

    • @greatlearning
      @greatlearning  Před 2 lety

      Hi we are glad that you liked our Content Please do subscribe to our Channel for Similar & Awesome Content

  • @Vineeth-ys8lu
    @Vineeth-ys8lu Před 3 lety +1

    Sir it's an amazing video ! ,But can I use my own terms instead of hi ,hello ,in input?

  • @kousthubhyadavalli1077

    such an amazing lecture !! it was really fun to learn

  • @SideKnowledge-ck7kf
    @SideKnowledge-ck7kf Před rokem

    just a few minutes in , so well explained. So clean. SUBBED AND LIKED!

  • @priyanshisharma8792
    @priyanshisharma8792 Před 2 lety +1

    I got holiday homework to build chatbot using AI app or software...
    Thankyou....bro

    • @greatlearning
      @greatlearning  Před 2 lety +1

      Hi we are glad that you liked our Content Please do subscribe to our Channel for Similar & Awesome Content

    • @khushimahajan5971
      @khushimahajan5971 Před 2 lety +1

      Did you get the out put??

    • @priyanshisharma8792
      @priyanshisharma8792 Před 2 lety

      @@khushimahajan5971 not yet....

    • @dinanath5250
      @dinanath5250 Před 2 lety

      @@priyanshisharma8792 Have you made chatbot ?

    • @dinanath5250
      @dinanath5250 Před 2 lety

      @@priyanshisharma8792 please reply

  • @prasannakumar1311
    @prasannakumar1311 Před 3 lety +1

    how we can make this chatbox precisely? means i need exact reply

  • @sahilsharma-er9yu
    @sahilsharma-er9yu Před 3 lety +3

    Please make video on kivy python full course

    • @greatlearning
      @greatlearning  Před 3 lety +1

      Greetings from Great Learning! Check out our CZcams video on "Build your first mobile app in Python | App Development tutorial for Beginners" here: czcams.com/video/_TY9OjROg9U/video.html Subscribe to the channel and hit the bell icon so that you never miss out on such content from us😇

    • @sahilsharma-er9yu
      @sahilsharma-er9yu Před 3 lety +1

      I have already seen that video, but I want full course on kivy python app development.

  • @thiernoalimoudiallo8703

    Thank you sir for this explanation.

  • @padmajamankani9130
    @padmajamankani9130 Před 2 lety +1

    hey where I get this code? you've not mentioned the code in your description

  • @sanjeevinisurendran7660
    @sanjeevinisurendran7660 Před 2 lety +1

    Very informative and useful!

  • @mrnoatall479
    @mrnoatall479 Před 3 lety

    Wow helpful id idea for little project
    Please dear sir
    Make a little application in which all content of python will be uses and teach once start to end ..

  • @user-ro6xp7zt1f
    @user-ro6xp7zt1f Před 9 měsíci

    Please share the python notebook used, Great video

  • @sahilgupta4340
    @sahilgupta4340 Před 2 lety

    Nice video !! Great explanation!!!

  • @yogeetakhatri4015
    @yogeetakhatri4015 Před 2 lety

    very well explanation, thorough knowledge... so my question is do we easily get syntax to make our own chatbots

  • @edwinwachirarukuno6714

    Incredible!Incredible!

  • @saiprasadambrale5369
    @saiprasadambrale5369 Před 3 lety +1

    Can we have a project on malaria detection using machine learning please this week

    • @greatlearning
      @greatlearning  Před 3 lety +1

      Thank you for the suggestion, we’ll try and look into it! Alternatively, check out our CZcams video on "Coronavirus Outbreak Prediction using Machine Learning in Hindi" here: czcams.com/video/jLnLfAPL-iY/video.html Subscribe to our channel NOW and hit the bell icon so that you never miss an update from us😇

    • @SubhashChandraGupta2021
      @SubhashChandraGupta2021 Před 3 lety

      @@greatlearning i am sure this thing is also a bot i am srs and sure

  • @amantyagi3514
    @amantyagi3514 Před 2 lety

    Could we use it as final year project

  • @nakabalegodfrey3223
    @nakabalegodfrey3223 Před 2 měsíci

    Hey, am having problems with that code, am getting 2 errors; line 18 "print(response(user_response)) and line 6 "return LemTokens(nltk.word_tokenize(text.lower(). translate(remove_punct_dict))), here it says 'remove_punct_dict' is not defined....help me out

  • @forinformation2001
    @forinformation2001 Před 3 lety

    Are you used any cloud in this?

  • @_sizza9994
    @_sizza9994 Před 2 lety

    what if you wana add another input like "How are you" with a corresponding response?

  • @TheUzairify
    @TheUzairify Před 5 měsíci

    Could you please provide source code?

  • @yumlive5698
    @yumlive5698 Před 3 lety +1

    Thanks for sharing

    • @greatlearning
      @greatlearning  Před 3 lety

      You're welcome, we're glad we could help you😇 Subscribe to our channel for more such content, and hit the bell icon so you are always notified of updates from us!

  • @dheeruymv
    @dheeruymv Před 2 lety

    Hello Team, Do you have a playbook location to download the code

  • @antibarcelona2123
    @antibarcelona2123 Před 2 lety

    For Resource omw-1.4 not found,
    use the following command below the "nltk.download('wordnet')"
    >> nltk.download('omw-1.4')

  • @s1sirohi
    @s1sirohi Před 3 lety +1

    Sir can you pls tell me how can i add this chatbot to my website

  • @anshuvishwakarma6020
    @anshuvishwakarma6020 Před rokem

    How to trained our own data. How much time it will take to trained

  • @user-ko3xl6du5s
    @user-ko3xl6du5s Před 9 měsíci

    Can I get the link to colab notebook in the video?

  • @anandbapiraju6311
    @anandbapiraju6311 Před rokem

    Thank you 💕 it's helped me alot

    • @greatlearning
      @greatlearning  Před rokem

      Hi we are glad that you liked our Content Please do subscribe to our Channel for Similar & Awesome Content

  • @funnycuteanimals44
    @funnycuteanimals44 Před 2 lety

    I want help. My chatbot is not replying as trained. How to write Questions and answers in .txt file ? Please reply.

  • @shutterrstories
    @shutterrstories Před 3 lety +1

    Thankyou for this but how to train your chat bot to give the perfect answer ?

  • @krushnalitiwari3337
    @krushnalitiwari3337 Před 2 lety +18

    Python is a non venomous snake

  • @SrushtiGotekar
    @SrushtiGotekar Před 3 lety

    Sir need help,have to make chatbot where user can type questions and chatbot will give ans it live chat nd chatbot can give different ans..

  • @hemanthhemu2636
    @hemanthhemu2636 Před 3 lety

    Video is amazing but I'm getting error in strt end protocols like greet not defined please help me sir

  • @DsaDecoder
    @DsaDecoder Před rokem

    Will this code work in Jupyter Notebook

  • @bhushanmali4592
    @bhushanmali4592 Před rokem +2

    Please provide source code 🙏

  • @dinanath5250
    @dinanath5250 Před 2 lety +1

    I need source code for my project please tell me from where I get it

  • @aviatrix.r7611
    @aviatrix.r7611 Před 22 dny

    Can anyone help me out .
    I an getting an error of no such file or directory :
    But the name of file is the same 😢

  • @hazimhabeeb
    @hazimhabeeb Před rokem

    Great video Anirudh, keep up the good work !

    • @rashidiqbal1193
      @rashidiqbal1193 Před rokem

      I'm facing some difficulty.. NameError: name 'LemNormalize' is not defined

  • @shalinih.m7183
    @shalinih.m7183 Před rokem

    As we given data science input..so chat bot is going to give answer for only questions related to data science..and not on other type of questions

    • @--ThansilMohamedS
      @--ThansilMohamedS Před rokem

      Hey, did you do the chatbot? Coz I tried as he said and I ain't able to get the foundations or anything other than hi or hello. It says look-up error

  • @jordy789
    @jordy789 Před 2 lety

    Hello! can you create a video on how to create a bot on facebook user account not on page using python or js ?

    • @greatlearning
      @greatlearning  Před 2 lety +1

      Hi, Thank you for your valuable suggestion, We will try to look into it and will try to bring the video on our channel

  • @avvarupreethi3063
    @avvarupreethi3063 Před 3 lety +1

    Sir, I am still getting the error even after uploading chat Bot.txt

  • @divyatejachalla8639
    @divyatejachalla8639 Před rokem

    It's an amazing lecture

  • @harshrastogi1996
    @harshrastogi1996 Před 2 lety

    how we made chatbot to read and display info from the excel sheet

  • @enamulhuque4999
    @enamulhuque4999 Před 2 lety

    How to work file download pause and resume functionality in a python program

  • @ti_36vedamrutaudavant37
    @ti_36vedamrutaudavant37 Před 3 lety +2

    The Content is always Amazing 👍👍👍

    • @greatlearning
      @greatlearning  Před 3 lety

      Thank you, we're glad we could help you😇 Subscribe to our channel for more such content, and hit the bell icon so you are always notified of updates from us!

  • @abhishekgalagali5968
    @abhishekgalagali5968 Před 2 lety

    can anyone please tell me where is the code thats used in this session

  • @chrisvillanti8349
    @chrisvillanti8349 Před 3 lety

    I'm getting an issue where all of my greeting functions work, except for any with more than one word. Please help

  • @vanshikadhiman1259
    @vanshikadhiman1259 Před rokem

    Hi I have made this but when i am writing bye it’s not responding like yours!

  • @imperial-x9899
    @imperial-x9899 Před 2 lety

    arey par run kaha karna hai vscode mein nhi chalega kya?

  • @kousthubhyadavalli1077

    where can i get the code

  • @maurusmariarubenson6242

    Bro Im getting an error from fit_transform missing 1 positional arguement("raw_documents")

  • @olajideobe
    @olajideobe Před 2 lety +1

    Awesome content. It will be helpful in building my first ever chatbot

    • @greatlearning
      @greatlearning  Před 2 lety +1

      Dear Learner it was Great to hear! for more such content please subscribe to our channel.

    • @Andrewtate200
      @Andrewtate200 Před rokem

      Did you finish?

  • @hadeerkhalaf2417
    @hadeerkhalaf2417 Před 2 lety +1

    Could you please send me the presentation?

  • @amitmoudgil8071
    @amitmoudgil8071 Před 3 lety

    Is there a way to have the code?

  • @avinashkumar-tx4vw
    @avinashkumar-tx4vw Před 2 lety

    when I use this code at last else it shows an error why

  • @nehalalex9497
    @nehalalex9497 Před 2 lety

    How to get this dataset?

  • @ratishkumar4012
    @ratishkumar4012 Před rokem

    Itna fantastic hai ki khud hi decide kar Lete hai aap

  • @datasciencetoday7127
    @datasciencetoday7127 Před 2 lety

    the guy knows his stuff, majja agaya

    • @greatlearning
      @greatlearning  Před 2 lety

      Hi we are glad that you liked our Content Please do subscribe to our Channel for Similar & Awesome Content

  • @jagrutiyewale8891
    @jagrutiyewale8891 Před 8 měsíci

    When I execute the filenot found error was occur......even I properly imported .......

  • @ananyashukla1976
    @ananyashukla1976 Před 2 lety

    From where i get my corpse file ?

  • @shaikarifa1727
    @shaikarifa1727 Před 2 lety

    Is there a way to remove stop_words warning?

  • @vivekgupta8279
    @vivekgupta8279 Před 3 lety +1

    please provide that google collab code

  • @heyamigos5568
    @heyamigos5568 Před 2 lety

    How to integrate this in webpage

  • @46_subhamkumar41
    @46_subhamkumar41 Před 3 lety +3

    I don't know why your channel is so underrated but thank you for such great content.
    🙏🙏🙏🙏

    • @greatlearning
      @greatlearning  Před 3 lety +1

      You're welcome, we're glad we could help you😇 Subscribe to our channel for more such content, and hit the bell icon so you are always notified of updates from us!

    • @ananyashukla1976
      @ananyashukla1976 Před 2 lety

      Hi do have code of chatbot?

  • @cartoonkids3008
    @cartoonkids3008 Před 3 lety +2

    How to get free courses and certificate

    • @greatlearning
      @greatlearning  Před 3 lety +2

      🔥🔥 Visit Great Learning Academy to learn from any of our 300+ free courses and get your free certificate of completion, Register Now: glacad.me/FreeCourses_1000Hours 🔥🔥

    • @theunknown9214
      @theunknown9214 Před 3 lety

      @@greatlearning is that free?

    • @rahmedgamer7446
      @rahmedgamer7446 Před 3 lety

      Jb bh is website pr jao koi course free nahi hai

  • @relaxandsleepmusicchannel5175

    I want to put some in a game I'm making but can't figure out how

  • @adityaporwal222
    @adityaporwal222 Před 2 lety

    hello sir i got an error related to " object is not iterable " on if(greet(user_response) !=None) that line
    what can i do ?

    • @adityaporwal222
      @adityaporwal222 Před 2 lety

      'builtin_function_or_method' object is not iterable, this type of error is occured

    • @adityaporwal222
      @adityaporwal222 Před 2 lety

      yeah i got my prbolem. thanks for showing this types of basic projects'

  • @pragatishukla2397
    @pragatishukla2397 Před 2 lety +2

    Sir please give me a code

  • @sreeparnabera6929
    @sreeparnabera6929 Před rokem

    Hello sir can you please help me. I am getting an import error while importing sklearn. I am already installed it

  • @KirtanPatel552
    @KirtanPatel552 Před 2 lety

    Brother you are amezing i watched full video and i completely understood what is Chatbot ...you are explaining in a simple language which is more benificial for me...
    Hats off bro🙌🙌✌️

    • @greatlearning
      @greatlearning  Před 2 lety

      Hi we are glad that you liked our Content Please do subscribe to our Channel for Similar & Awesome Content

  • @mangalapallysandeepkumar1020

    Sir iam getting error that tfidf is not defined in the chat when I have written the foundations

    • @--ThansilMohamedS
      @--ThansilMohamedS Před rokem

      Same bro, did you resolve the problem .. please tell me,if u did

  • @kushalamdkushi9618
    @kushalamdkushi9618 Před 2 lety

    Sir can i get a code ,it's amazing 👏

  • @kaushikjoshi8191
    @kaushikjoshi8191 Před rokem

    I need Source Code of the NLP Chat Bot

  • @symca_a_25_jadhav_vaibhav14

    can i get the source code

  • @Shubham-jr7ij
    @Shubham-jr7ij Před 2 lety

    Is this Chatbot work in Facebook and Instagram

  • @Eng-py5yh
    @Eng-py5yh Před rokem

    If we want to replace the English language with another language, let it be Arabic, what should be done? What will change in the project?

  • @ayanmandal8257
    @ayanmandal8257 Před 2 lety

    can you give the ccode?

  • @ayushnautiyal7965
    @ayushnautiyal7965 Před 2 lety

    Sir can you give source code for this It would be helpful

  • @yahyawafi8498
    @yahyawafi8498 Před 2 lety +1

    can u send source code

  • @IFD404
    @IFD404 Před 2 lety

    40:30 *talks bout giving compatative exams*
    me who's 13 y/o : hmmm mhhhh yeup i deffienetly did that

  • @pratikmahajan654
    @pratikmahajan654 Před rokem

    is here use flask or not if not why

  • @Reviewer8379
    @Reviewer8379 Před 2 měsíci

    Hw was going too fast. I couldn't catch many things as I am extremely new in this field

  • @rishabh2746
    @rishabh2746 Před 2 lety

    Hello sir! please provide the code