Chat Bot With PyTorch - NLP And Deep Learning - Python Tutorial (Part 1)

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • In this Python Tutorial we build a simple chatbot using PyTorch and Deep Learning. I will also provide an introduction to some basic Natural Language Processing (NLP) techniques.
    1) Theory + NLP concepts (Stemming, Tokenization, bag of words)
    2) Create training data
    3) PyTorch model and training
    4) Save/load model and implement the chat
    Resource:
    This tutorial was inspired and adapted from the following article:
    "Contextual Chatbots with Tensorflow": chatbotsmagazi...
    ✅ Write cleaner code with Sourcery, instant refactoring suggestions in VS Code & PyCharm: sourcery.ai/?u... *
    📚 Get my FREE NumPy Handbook:
    www.python-eng...
    📓 Notebooks available on Patreon:
    / patrickloeber
    ⭐ Join Our Discord : / discord
    If you enjoyed this video, please subscribe to the channel!
    NLTK:
    www.nltk.org
    You can find the code on GitHub:
    github.com/pat...
    PyTorch Beginner Course:
    • PyTorch Tutorials - Co...
    Please checkout my website to see all tutorials:
    www.python-eng...
    You can find me here:
    Twitter: / patloeber
    GitHub: github.com/pat...
    Icons:
    fontawesome.co...
    fontawesome.co...
    #PyTorch #NLP #DeepLearning
    ----------------------------------------------------------------------------------------------------------
    This is a sponsored or an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏

Комментарии • 254

  • @rc5016
    @rc5016 3 года назад +10

    You are the best!! Among all the youtube videos about chabot , you are the only one to explain step by step the fundamentals of coding a chatbot.

  • @amparoconsuelo9451
    @amparoconsuelo9451 Год назад +9

    Very clear. Much better than the later tutorials. I understood the meaning of tokenization and bag of words when you demonstrated what happens during the execution of the code.

  • @xingfenyizhen
    @xingfenyizhen Год назад +5

    You can tell the difficult theory to the easy one,you're the master!😁

  • @pratyusharavishankar5573
    @pratyusharavishankar5573 3 года назад +85

    Such a good explanation, seriously anyone with a negative IQ can also understand!
    Never stop uploading please :)

  • @Kids_stories400
    @Kids_stories400 Год назад +8

    Very informative and explains everything! Please do more videos like this!

  • @theroyal1914
    @theroyal1914 3 года назад +2

    I saw many videos but your explanation is great.

    • @patloeber
      @patloeber  3 года назад

      Glad to hear that :)

  • @michapodlaszuk9025
    @michapodlaszuk9025 3 года назад +1

    Oh man I love that, I'm working on a chatbot based project and these videos will definitely help me

    • @patloeber
      @patloeber  3 года назад +1

      glad to hear that!

  • @muhammadzubairbaloch3224
    @muhammadzubairbaloch3224 4 года назад +12

    I am really happy to see your efforts. You have done a great job. thanks sir

  • @enthusiasticsimple901
    @enthusiasticsimple901 3 года назад +5

    Amazing tutorial, I've no idea about ML or DL, but the video is crisp enough to make understand everything 😊

  • @sumithhh9379
    @sumithhh9379 4 года назад +5

    Waited for months from your last series on pytorch :). Please make videos on NLP with pytorch

    • @patloeber
      @patloeber  4 года назад +4

      yes I finally got around to do some pytorch tutorials! part 2,3, and 4 will be released in the next 3 days. I hope to do even more NLP in the future

  • @yahyayozo8660
    @yahyayozo8660 3 года назад +2

    you made it much easier for me , great job

  • @theinnoverse
    @theinnoverse 3 года назад +2

    Beautiful Explanation bro! just wow!

    • @patloeber
      @patloeber  3 года назад +1

      glad to hear that!

  • @piyushborse3085
    @piyushborse3085 3 года назад +2

    Watched this video... And boom 💥 SUBSCRIBED!!! 😍

    • @patloeber
      @patloeber  3 года назад

      yeah thanks a lot :)

  • @RamanKumar-nr6lr
    @RamanKumar-nr6lr 3 года назад +1

    Really great!! Keep uploading.

  • @mahjabinbintemannan8924
    @mahjabinbintemannan8924 Год назад +1

    great video man. Really helpful for my course project. Thank you.

  • @elvisadesese2842
    @elvisadesese2842 2 года назад

    Sir, thanks for this video seeing this video has made me love love NLP. I was looking for where to specialise in. Thanks 👍

  • @milainmaroo9048
    @milainmaroo9048 4 года назад +3

    very clear and easy to understand..thank you for this tutorial :)

    • @patloeber
      @patloeber  3 года назад +1

      Thanks! Glad you like it

  • @sunsong868
    @sunsong868 2 года назад +3

    It looks like training dataset is same as test set, am I right? Using an AI method to recognize the chat instead of using "if--else" structure.

  • @juheehong7445
    @juheehong7445 2 года назад +5

    thank you so much for a wonderful tutorial! by the way, I was curious as to which vscode theme you were using-i find it very nice!

  • @deek8812
    @deek8812 4 года назад +8

    thank you so much for this helpful video! would you consider teaching how to implement a GUI along with it?

    • @patloeber
      @patloeber  4 года назад +3

      Yes good suggestion! I’ll consider it

  • @conversationalai8320
    @conversationalai8320 3 года назад

    Nice - thanks for taking the time to make the video

  • @manishpatil09
    @manishpatil09 2 года назад +3

    you sound a lot like Kumail Nanjiani. Great video btw

  • @haseebsheikh6101
    @haseebsheikh6101 3 года назад +1

    Very helpful video and implementation is very clear, Thanks Man

  • @samouda717
    @samouda717 Год назад +2

    I like it. Thank you! Is this rule-based or learning-based (retrieval or generative)?

  • @AdmiralPotatoGaming
    @AdmiralPotatoGaming 2 года назад +1

    This is a nice video man!, I was hoping if you could do also a chatbot in web? Thank you so much for the effort

  • @villanuevajohnoliver5953
    @villanuevajohnoliver5953 2 месяца назад

    Love your playlist on this! Can we use Word2Vec instead of Bag of Words for word embedding?

  • @flamboyantperson5936
    @flamboyantperson5936 4 года назад +3

    This is really awesome. After this I want you to develop a machine learning model and deployment using flink kafka hadoop

    • @patloeber
      @patloeber  4 года назад +2

      I will have a look at this...

    • @flamboyantperson5936
      @flamboyantperson5936 4 года назад +1

      @@patloeber Please have a look. It will be like a big data archteciture for a bank where each transaction will be monitoried

  • @tashifhoda2414
    @tashifhoda2414 4 года назад +19

    This tutorial is more german than Germany itself. But great tutorial anyways!

  • @aichamahfoudh2451
    @aichamahfoudh2451 3 года назад +1

    Great job, thank you so much

    • @patloeber
      @patloeber  3 года назад

      Glad it was helpful!

    • @aichamahfoudh2451
      @aichamahfoudh2451 3 года назад

      @@patloeber I would like to ask you for a favor, how may I find Covid19 psychologic Dataset other than Kaggle. Thank you in advance

  • @peschebichsu
    @peschebichsu 3 года назад +5

    Nice video, thanks! Just one question: Is this bag of words methode really also how chatbots (as far as I understand also assistants like siri?) with huge amounts of data work. So apple really has millions of tag with possible inputs that can be labelled to one of the tags like "greeting" and so on? Hard to imagine, since it would be such a long way for it to work well :O

    • @yuvrajdudhal1147
      @yuvrajdudhal1147 3 года назад +3

      I guess they are self learning bots ,they don't have huge data chunks they rather learn as they progress talking with you

    • @nirajpaneru9694
      @nirajpaneru9694 2 года назад +1

      no they use much better method like word2vec.

  • @Gintoki.Sakata918
    @Gintoki.Sakata918 3 года назад +2

    Hey,
    Can you build a notification reader(who speaks what's the notification) using python...?
    By the way
    Your videos are just awesome ❤️

    • @patloeber
      @patloeber  3 года назад +1

      Glad you like it! Will add it to my list

  • @martinegracehategekimana1323
    @martinegracehategekimana1323 Год назад

    very understandable

  • @fundatamdogan
    @fundatamdogan 3 года назад +1

    Thank you very much for this video.I always search to find this kind of explanations and knowledges.You are really great :)

    • @patloeber
      @patloeber  3 года назад

      thanks :)

    • @fundatamdogan
      @fundatamdogan 3 года назад

      I am chemist actually .I ve learning python and machine and deep learning and NLP for 3 years.I rarely need to help but sometimes I really need too but there is nobody to ask

  • @CognitiveArena
    @CognitiveArena Год назад

    I watched all parts and Deployment. I executed also. Amazing work, thank you for sharing 😍. One funny thing I noticed is coffee and tea delivery needs 2-4 days🤣.

  • @thePocketWatch45
    @thePocketWatch45 3 года назад

    What a great video

  • @tc322
    @tc322 4 года назад

    Many Thanks!!

  • @azerioauditore511
    @azerioauditore511 3 года назад

    Thanks a lot keep up the good work

  • @subhashisdas81
    @subhashisdas81 Год назад

    Very easy to follow. Very good explanation. Thank you very much.

  • @mohammedumar3684
    @mohammedumar3684 2 года назад +1

    Can you also show how to do entity extraction in a video or a blog post?

  • @AharsiDey
    @AharsiDey 9 месяцев назад

    Thank you so much for this great project! I have a slight doubt... In 20:21 part of the video, when we are running the stem function, why doesn't the output show `['organiz', organiz', organiz']` because when you were explaining the concept of stemming you had shown another example where the words universe and university were stemmed as univers and univers repectively

  • @GagaChen0104
    @GagaChen0104 Год назад

    this course is amazing!!! I'm familiar with python, but have no any experience on ML.
    any prerequisites for building the chat bot? TensorFlow Tutorial or PyTorch Tutorial both are needed?

  • @cryptomilovatcode
    @cryptomilovatcode Год назад

    genial, gracias por la informacion

  • @poeticfeint9717
    @poeticfeint9717 3 года назад +2

    Thanks for the instructive content! Can you tell me what editor/ IDE you use with python?

    • @patloeber
      @patloeber  3 года назад +2

      I use VS Code. I have a tutorial about my editor setup on this channel :)

  • @DsaDecoder
    @DsaDecoder Год назад +1

    Can I work on this project in jupyter notebook

  • @tasmimdristy6846
    @tasmimdristy6846 3 года назад +3

    I am trying to do this code on google colab but facing some issues like how to creat environment or use pytorch there, can you guide me through? also getting errors on tokenizing(sentence)

  • @chandradeepsingh.8661
    @chandradeepsingh.8661 3 года назад

    Please make a chatbot more advance using rnn And other techniques

  • @srinivasanramakrishnan7289
    @srinivasanramakrishnan7289 3 года назад

    could u add about how to link database for storing different credentials

  • @speedystrider9401
    @speedystrider9401 4 года назад +11

    14:49

    • @patloeber
      @patloeber  4 года назад +1

      yes before is theory :)

  • @neelaramesh3765
    @neelaramesh3765 2 года назад

    great video !! just one doubt what do i have to specify in data.pth

  • @pranavjagdale
    @pranavjagdale 3 года назад

    Will it answer questions regarding Home Remedies?

  • @adityajyoti5615
    @adityajyoti5615 4 года назад +3

    i know this might not be seen but at 14:10 in the stemming stage why did the 'e' get chopped off form the word 'anyone'?

  • @prishabhavsar194
    @prishabhavsar194 2 года назад

    What IDE are you using? Great video!

  • @marcoevic
    @marcoevic 3 года назад

    Great tutorial! The bot works perfectly fine! Is there any chance you could recommend any german stemmer which works as simply as the PorterStemmer? Really struggling to get this bot to talk german with me....

    • @patloeber
      @patloeber  3 года назад +1

      spacy has german lemmatization support, which is better than stemming anyway. You can also try to skip this part and see if it works without it

  • @TheBornfreetofly
    @TheBornfreetofly 3 года назад +1

    Danke für das tolle Video.
    Ich habe einen Fehler, würde mich über einen Kommentar freuen
    line 134, in _check_not_importing_main
    raise RuntimeError('''
    RuntimeError:
    An attempt has been made to start a new process before the
    current process has finished its bootstrapping phase.
    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

    • @patloeber
      @patloeber  3 года назад +1

      Vermutlich unter Windows, num_workers=0 for the DataLoader, and use if __name__ == "__main__" could be tried to solve this

  • @Ajitkm8
    @Ajitkm8 2 года назад

    U r amazing

  • @aynuryapc5653
    @aynuryapc5653 3 года назад +2

    PS C:\Users\Jane_Brit\Desktop\ProjeTasarimi\ChatBot> conda activate pytorch
    Could not find conda environment: pytorch
    You can list all discoverable environments with `conda info --envs`.
    I'm getting an error like this. Can you help?I'm getting an error like this. Can you help?

    • @sanjanapatil4777
      @sanjanapatil4777 2 года назад

      The environment is not created so it gives an error that way

  • @soumcaranormal6699
    @soumcaranormal6699 2 года назад

    hey there great tutorial! i'm having just one problem, when stemming the words when i debug i always get 'None' as a result

  • @TeambitDK
    @TeambitDK 3 года назад

    I reckon this might be a dump question, but NLTK is that minded for english only?

  • @pleasedontsubscribeme4397
    @pleasedontsubscribeme4397 3 года назад +1

    Great explanation buddy !

  • @DragonKidPlaysMC
    @DragonKidPlaysMC 4 года назад +3

    Hey, I’m creating a twitter bot that searches for tweets that indicate suicidal tendencies and I want to implement an AI that identifies this kind of tweets.

    • @patloeber
      @patloeber  4 года назад +4

      That’s an awesome application! I have a tutorial where I set up the titter api if you want to have a look at that: ruclips.net/video/yCYPzoG25ak/видео.html

  • @magentaIX
    @magentaIX 2 года назад

    Good video sir, can I use pyttsx3 on this model?

  • @gumz3871
    @gumz3871 Год назад

    Hi! I'm an early beginner to coding in general. I too am trying to create a chatbot I can use for my website. I just don't know which IDE to use. Which one is Mr. Loeber using in this video?

  • @aachaljakhotiya523
    @aachaljakhotiya523 3 года назад +2

    This is a great explanation!!
    I have one doubt...what should you include in your intents file so that the bot responds with some default message every time it does not recognize a sentence asked by the user

    • @patloeber
      @patloeber  3 года назад +1

      I implemented this in part 4. You don't need to put the default message into the intents. You can simply put it in your code and whenever the probability for intent classification is not high enough, you can return the default message

  • @Shaan11s
    @Shaan11s 5 месяцев назад

    Why not lemmatize vs. stem?

  • @lidory98
    @lidory98 4 года назад +1

    can we get the slides you used for the theoretical parts?

  • @HMN277
    @HMN277 3 года назад +1

    Just a quick question what is the IDLE used in the video? Could I just use pyCharm.

    • @patloeber
      @patloeber  3 года назад

      I use VS Code but Pycharm is great, too :)

  • @Duriel1000
    @Duriel1000 Год назад

    what good is a chatbot in a terminal?

  • @saurrav3801
    @saurrav3801 4 года назад

    You are awesome

  • @himeshkoli8607
    @himeshkoli8607 Год назад

    Hey ive seen all your videos for chatbot and even made specifically for my needs, however I just want to ask how do you break into new line in chatbot UI, what to write in intents.json to break in new line in chatbot UI??

  • @gowthambhat1498
    @gowthambhat1498 2 года назад

    is it possible to recive files(upload files) from a bot like pdf and word file?, I found no tutorials teaching that concept

  • @boli7171
    @boli7171 3 года назад +1

    This is really great tutorial, and currently I have a problem about using TF-IDF instead of boW, anyone has any resources to figure it out, please? I will appreciate it!

    • @Zydres_Impaler
      @Zydres_Impaler 3 года назад

      Do I need to learn pytorch before I learn this??

  • @eunicepague1132
    @eunicepague1132 2 года назад

    What kind of algorithm did you use for this entire system? I hope you can reply.

  • @rohanparkar
    @rohanparkar 4 года назад +1

    nice

  • @programerguy8396
    @programerguy8396 7 месяцев назад

    Is it necessary to create a virtual environment

  • @reetaravi3315
    @reetaravi3315 Год назад

    Thanks so much. It was very understandable. But every time I put a new package in python and run it, it still says Module not found error.

  • @stonedchat
    @stonedchat 3 года назад

    What if you misspell a word? Does bow take it as a 0?

  • @suseendaran5690
    @suseendaran5690 2 года назад +1

    Hi all,
    i'm getting a error while downloading punkt, i searched everywhere but no answer ,please someone give me a alternative
    [nltk_data] Error loading punkt:

  • @rittikatalukdar7768
    @rittikatalukdar7768 Год назад

    Which model of chatbot is being used here in this chatbot and why? Please reply

  • @jordy789
    @jordy789 2 года назад

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

  • @NoMoreTricky
    @NoMoreTricky 3 года назад

    Hey ! Can u add button response in this ?

  • @rhl_ai
    @rhl_ai Год назад

    thnx

  • @sanyasinha6088
    @sanyasinha6088 3 года назад +2

    Thank you so much for this great project! I have a slight doubt...Every time I import a new package like numpy or random on my VS Code, my system isn't able to read it. It says 'ModuleNotFound' I tried everything from changing to path to reinstalling multiple times but it doesn't work. Please help me out with this. Thank youu

    • @ralphdeguzman570
      @ralphdeguzman570 5 месяцев назад

      having the exact same problem for installing and importing anything. did you find any general solution?

  • @carlospaz5560
    @carlospaz5560 Год назад

    Hello Patrick, How Can I Stemm in Spanish?

  • @calebdalais5356
    @calebdalais5356 4 года назад +1

    If I wanted to make this bot only respond with questions and never anything other than a question, would it be possible to train it with just the intent file or would I need extra code?

    • @patloeber
      @patloeber  4 года назад +1

      Should work with the intent file

  • @flashtroncreations6938
    @flashtroncreations6938 2 месяца назад

    Is this chatbot Rule based chatbot??

  • @VikramParmar-fn9et
    @VikramParmar-fn9et 3 года назад

    May I know Which platform he is using for coding? Please help

  • @revihasbi682
    @revihasbi682 Год назад

    Is there a way for a chatbot to answer questions and select responses that have been predetermined through a database we have created? If I saw your video, the chatbot still answers and responds to questions manually according to what is written in the code. I want to make it able to answer and determine its responses online through the database

  • @vidhisharma8147
    @vidhisharma8147 4 года назад +1

    Can we run this without setting up a virtual environment? If yes, how?

    • @patloeber
      @patloeber  4 года назад

      Yes you can, just install it with pip. This will install all packages into your main Python site-packages folder

  • @karankhanna3391
    @karankhanna3391 2 года назад

    how can we add voice recognition in the chatbot?
    and how and where should I put the code ?

  • @anushkasrivatsa5502
    @anushkasrivatsa5502 2 года назад

    Which editor have you used sir?

  • @IshikaAgarwal816
    @IshikaAgarwal816 Год назад

    For some reason, my print statement is not working. nothing is being printed yet I dont get any error

  • @kmaltman
    @kmaltman 8 месяцев назад

    Great video, But I get an error from testing stemming...... stemmed_words = [stem(w) for w words] ...... The error is invalid syntax Perhaps I forgot a comma? Anyone know whats wrong? Keith

  • @taniya3686
    @taniya3686 5 дней назад

    how to integrate this chatbot to our website?

  • @bhavyamverma70
    @bhavyamverma70 3 года назад

    Hey can you tell which ide you are using visual studio code or atom and can you please tell which is better thanks

  • @KRYTOY_EZHIK
    @KRYTOY_EZHIK Год назад

    How to train a model to attach a transformer?

  • @redgeciccone8218
    @redgeciccone8218 3 года назад

    multi-language support?

  • @haruke4981
    @haruke4981 9 месяцев назад

    can it do followups?

  • @vyas8137
    @vyas8137 3 года назад

    Hey wanted to ask what is the use of NLP and pytorch if it answers only particular questions. Can anyone clear my doubt?

  • @NushrinaTeelhawod
    @NushrinaTeelhawod 2 года назад

    Is it retrieval based chatbot?

  • @vinayprabhu5754
    @vinayprabhu5754 3 года назад

    How do you check the accuracy and model summary in pytorch