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

Поділитися
Вставка
  • Опубліковано 5 жов 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 :)

  • @theroyal1914
    @theroyal1914 3 роки тому +2

    I saw many videos but your explanation is great.

  • @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

  • @michapodlaszuk9025
    @michapodlaszuk9025 3 роки тому +1

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

  • @muhammadzubairbaloch3224
    @muhammadzubairbaloch3224 4 роки тому +12

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

  • @Kids_stories400
    @Kids_stories400 Рік тому +8

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

  • @enthusiasticsimple901
    @enthusiasticsimple901 3 роки тому +5

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

  • @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

  • @yahyayozo8660
    @yahyayozo8660 3 роки тому +2

    you made it much easier for me , great job

  • @theinnoverse
    @theinnoverse 3 роки тому +2

    Beautiful Explanation bro! just wow!

  • @piyushborse3085
    @piyushborse3085 3 роки тому +2

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

  • @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!

  • @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

  • @samouda717
    @samouda717 Рік тому +2

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

  • @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.

  • @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 👍

  • @manishpatil09
    @manishpatil09 2 роки тому +3

    you sound a lot like Kumail Nanjiani. Great video btw

  • @tashifhoda2414
    @tashifhoda2414 4 роки тому +19

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

  • @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.

  • @milainmaroo9048
    @milainmaroo9048 4 роки тому +3

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

    • @patloeber
      @patloeber  4 роки тому +1

      Thanks! Glad you like it

  • @RamanKumar-nr6lr
    @RamanKumar-nr6lr 3 роки тому +1

    Really great!! Keep uploading.

  • @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

  • @haseebsheikh6101
    @haseebsheikh6101 3 роки тому +1

    Very helpful video and implementation is very clear, Thanks Man

  • @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

  • @conversationalai8320
    @conversationalai8320 3 роки тому

    Nice - thanks for taking the time to make the video

  • @villanuevajohnoliver5953
    @villanuevajohnoliver5953 2 місяці тому

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

  • @mohammedumar3684
    @mohammedumar3684 2 роки тому +1

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

  • @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)

  • @DsaDecoder
    @DsaDecoder Рік тому +1

    Can I work on this project in jupyter notebook

  • @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

  • @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🤣.

  • @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?

  • @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

  • @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

  • @subhashisdas81
    @subhashisdas81 Рік тому

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

  • @chandradeepsingh.8661
    @chandradeepsingh.8661 3 роки тому

    Please make a chatbot more advance using rnn And other techniques

  • @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 :)

  • @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

  • @martinegracehategekimana1323

    very understandable

  • @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: ua-cam.com/video/yCYPzoG25ak/v-deo.html

  • @srinivasanramakrishnan7289
    @srinivasanramakrishnan7289 3 роки тому

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

  • @azerioauditore511
    @azerioauditore511 3 роки тому

    Thanks a lot keep up the good work

  • @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'?

  • @tc322
    @tc322 4 роки тому

    Many Thanks!!

  • @neelaramesh3765
    @neelaramesh3765 2 роки тому

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

  • @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?

  • @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

  • @speedystrider9401
    @speedystrider9401 4 роки тому +11

    14:49

    • @patloeber
      @patloeber  4 роки тому +1

      yes before is theory :)

  • @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

  • @cryptomilovatcode
    @cryptomilovatcode Рік тому

    genial, gracias por la informacion

  • @pranavjagdale
    @pranavjagdale 3 роки тому

    Will it answer questions regarding Home Remedies?

  • @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

  • @magentaIX
    @magentaIX 2 роки тому

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

  • @thePocketWatch45
    @thePocketWatch45 3 роки тому

    What a great video

  • @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??

  • @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 ?

  • @prishabhavsar194
    @prishabhavsar194 2 роки тому

    What IDE are you using? Great video!

  • @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 :)

  • @TeambitDK
    @TeambitDK 3 роки тому

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

  • @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.

  • @lidory98
    @lidory98 4 роки тому +1

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

  • @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

  • @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

  • @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

  • @eunicepague1132
    @eunicepague1132 2 роки тому

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

  • @NoMoreTricky
    @NoMoreTricky 3 роки тому

    Hey ! Can u add button response in this ?

  • @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

  • @stonedchat
    @stonedchat 3 роки тому

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

  • @rittikatalukdar7768
    @rittikatalukdar7768 Рік тому

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

  • @programerguy8396
    @programerguy8396 7 місяців тому

    Is it necessary to create a virtual environment

  • @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?

  • @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:

  • @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??

  • @VikramParmar-fn9et
    @VikramParmar-fn9et 3 роки тому

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

  • @karankhanna3391
    @karankhanna3391 2 роки тому

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

  • @Shaan11s
    @Shaan11s 5 місяців тому

    Why not lemmatize vs. stem?

  • @pleasedontsubscribeme4397
    @pleasedontsubscribeme4397 3 роки тому +1

    Great explanation buddy !

  • @johnmarktiongson1629
    @johnmarktiongson1629 3 роки тому +1

    Hi Python Engineer may I ask what kind of neural network did you used in this project thanks !

    • @ejecb4975
      @ejecb4975 3 роки тому

      Up i want to know too. thanks

    • @patloeber
      @patloeber  3 роки тому +2

      A very simple feed forward neural network with linear layers and relu. The key here is in the data preprocessing! Feel free to try out a more complex model :)

    • @johnmarktiongson1629
      @johnmarktiongson1629 3 роки тому

      @@patloeber Thanks I would just like to ask also if it is still a feed forward neural network even though you use back propagation?

  • @rhl_ai
    @rhl_ai Рік тому

    thnx

  • @anjalivenugobal7543
    @anjalivenugobal7543 4 роки тому

    Sir please tell what are the primary things to be downloaded to work with this project

    • @patloeber
      @patloeber  4 роки тому

      you can clone this repo and follow the installation guide in the README: github.com/python-engineer/pytorch-chatbot

  • @chandradeepsingh.8661
    @chandradeepsingh.8661 3 роки тому +3

    Best programming channels I know :
    She online classes Arduino
    Python engineer
    Edureka

  • @IshikaAgarwal816
    @IshikaAgarwal816 Рік тому

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

  • @KRYTOY_EZHIK
    @KRYTOY_EZHIK Рік тому

    How to train a model to attach a transformer?

  • @anushkasrivatsa5502
    @anushkasrivatsa5502 2 роки тому

    Which editor have you used sir?

  • @Duriel1000
    @Duriel1000 Рік тому

    what good is a chatbot in a terminal?

  • @vinayprabhu5754
    @vinayprabhu5754 3 роки тому

    How do you check the accuracy and model summary in pytorch

  • @haruke4981
    @haruke4981 9 місяців тому

    can it do followups?

  • @redgeciccone8218
    @redgeciccone8218 3 роки тому

    multi-language support?

  • @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

  • @Just_existing_in_this_universe

    which ide are you using

  • @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 7 днів тому

    how to integrate this chatbot to our website?

  • @remixowlz
    @remixowlz 4 роки тому +1

    Hi python engineer, do you know the ideal epoch batch size for small training data of less than 50? I want to ensure that the model is not too 'strict when making prediction. How do I do that?

    • @patloeber
      @patloeber  4 роки тому +1

      You have to try it out :) maybe 4 or 8, or even without batches

    • @remixowlz
      @remixowlz 4 роки тому

      @@patloeber Thankewww >:)

  • @carlospaz5560
    @carlospaz5560 Рік тому

    Hello Patrick, How Can I Stemm in Spanish?

  • @NushrinaTeelhawod
    @NushrinaTeelhawod 2 роки тому

    Is it retrieval based chatbot?

  • @Ajitkm8
    @Ajitkm8 2 роки тому

    U r amazing