Chat Bot With PyTorch – NLP And Deep Learning – Python Tutorial (Part 4)




[ad_1]

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

⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I’ve been using Kite for 6 months and I love it! https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=pythonengineer&utm_content=description-only

🚀🚀 JOIN MY NEWSLETTER 🚀🚀
https://www.python-engineer.com/newsletter/

🚀🚀 Get exclusive content on Patreon: 🚀🚀
https://www.patreon.com/patrickloeber

If you enjoyed this video, please subscribe to the channel!

Article “Contextual Chatbots with Tensorflow”:
https://chatbotsmagazine.com/contextual-chat-bots-with-tensorflow-4391749d0077

NLTK:
https://www.nltk.org

You can find the code on GitHub:
https://github.com/python-engineer/pytorch-chatbot

PyTorch Beginner Course:
https://www.youtube.com/playlist?list=PLqnslRFeH2UrcDBWF5mfPGpqQDSta6VK4

Please checkout my website to see all tutorials:
https://www.python-engineer.com

You can find me here:
Twitter: https://twitter.com/python_engineer
GitHub: https://github.com/python-engineer

Icons:
https://fontawesome.com/icons/comments
https://fontawesome.com/icons/robot

#PyTorch #NLP #DeepLearning

Source


[ad_2]

Comment List

  • Python Engineer
    November 23, 2020

    Does anyone get "UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1470: character maps to <undefined>" when trying to execute "python chat.py" ?

  • Python Engineer
    November 23, 2020

    Is it possible that , you can imply on Tkinter GUI app .. after all you have done?

  • Python Engineer
    November 23, 2020

    thanks you sir, it run perfectly

  • Python Engineer
    November 23, 2020

    great

  • Python Engineer
    November 23, 2020

    Pls make self learning chatbot in Python vedios and pls upload the code in description.

  • Python Engineer
    November 23, 2020

    easily liked and subscribed; thank you for this tutorial! It was easy to follow, and I really appreciated the theory/abstract explanations along the way. Loved how concise and straight to the point it was. Looking forward to more of your content!

  • Python Engineer
    November 23, 2020

    Clear concise and easy to understand .. good stuff man .. will be implementing this today and connecting it up to my voice to text and text to speech … Whole house gonna be annoyed by this 😁🤣😈

  • Python Engineer
    November 23, 2020

    Can you code accuracy score in this repo?

  • Python Engineer
    November 23, 2020

    can i integrate this chatbot into web using flask ?
    looking forward for a tutorial for that

  • Python Engineer
    November 23, 2020

    id didnt work

  • Python Engineer
    November 23, 2020

    Can you tell how can i add chatbot on my web app project.

  • Python Engineer
    November 23, 2020

    hey everything is working but when i say "hey" or anything it replies with see you later or bye … inshort replies with only one tag which is goodbye idk whats wrong please help…

  • Python Engineer
    November 23, 2020

    That was very helpful, thank you

  • Python Engineer
    November 23, 2020

    First of all, thanks for this great tutorial!

    I did run into an issue though and would love some input on this:

    When the program tries to execute predicted.item(), it throws an illegal memory access error.

    tag = tags[type(predicted.item())]
    RuntimeError: CUDA error: an illegal memory access was encountered

    However it runs fine when I disable cuda and just use the cpu. Any idea why?

  • Python Engineer
    November 23, 2020

    Thank You. After debugging the error in part 3, everything works as intended.

  • Python Engineer
    November 23, 2020

    RuntimeError: expected scalar type Long but found Int . please solve this error

  • Python Engineer
    November 23, 2020

    Hello Sir, Great Tutorial. But Sir I want to integrate my chatbot on an HTML page, how can I do that ?. Please sir help me out with this

  • Python Engineer
    November 23, 2020

    makes a mistake with the key in code
    proceeds to recreate the mistake instead of fixing it to make it work

    Bruh! That's my life in a nutshell.

    BTW, a very helpful tutorial. I like that you explained the algorithm before implementing the code. I rarely see tutorials doing that. Just one feedback, talk a little faster. Anyway, I just subscribed. Great job!

  • Python Engineer
    November 23, 2020

    Thank you very much sir It finally worked. Lots of love for you.

  • Python Engineer
    November 23, 2020

    How can we add GUI to the chatbot

  • Python Engineer
    November 23, 2020

    File "C:Usersniko-000Anaconda3libctypes__init__.py", line 356, in __init_
    self._handle = _dlopen(self._name, mode)

    OSError: [WinError 126] The specified module could not be found

  • Python Engineer
    November 23, 2020

    How can I show buttons to the user , instead of just replying with test? , thanks, great series! 🙂

  • Python Engineer
    November 23, 2020

    I watched the 4 videos, my chat bot fails to work. Issues with code in part 3, I feel like i wasted my time even though the quality of the videos are very good. bummer. Thanks for posting video series.

  • Python Engineer
    November 23, 2020

    How can i calculate accuracy on every epoch of the training ?

  • Python Engineer
    November 23, 2020

    And also, This tutorial series was amazing. Followed through the whole series, implemented the ChatBot and now tweaking around intents.json. kudos to you for this amazing session Python Engineer! Take Love <3

  • Python Engineer
    November 23, 2020

    To all the people who are attempting this series and made your way into the last session.
    1. Install 'CPU only' Version of PyTorch through Anaconda,if you don't have any GPU support. The Command is:
    $conda install pytorch torchvision cpuonly -c pytorch
    2.If you are getting this error : "RuntimeError: expected scalar type Long but found Int",use this in train.py Line 105
    loss = criterion(outputs, labels.long())
    3. In (Windows,PyCharm) the num_workers = 0 helps to overcome the threading issue.
    for any further help,you can reach out to me at: arafmustavi@gmail.com Happy To Help

  • Python Engineer
    November 23, 2020

    I wanted to integrate a database probably MySQL or SQLite database so that when I ask a question to it it will fetch the data from the database. Can You please tell me how can I do it?

  • Python Engineer
    November 23, 2020

    I am trying to execute chat.py and getting this error "No such file or directory: ‘data.pth'"

  • Python Engineer
    November 23, 2020

    Bro while making a chat bot using audio …..how to convert audio into audio image spectrum…..is there any module in python…….

  • Python Engineer
    November 23, 2020

    Sır, thanks for the easy explanation. It works great. I want to add hierarchical order for example If the user says yes, bot recommends a solution. After this part, if the problem not solved and the user says yes, the troubleshooting step goes one more further with the second solution. How can I implement that?

  • Python Engineer
    November 23, 2020

    A good 4 series video tutorial using PyTorch. I downloaded the code from your git repo which made things easier. I had to watch it through a few times but a good series. Thanks. You used the Porter stemmer from nltk. There are others including Lancaster and the Porter2 (or English). Which one is best for this simple chat bot?

  • Python Engineer
    November 23, 2020

    Beo can you make a video about defining different layers and different activation functions and also different optimizer in pytorch …..because…dont know…where it to be use ….

  • Python Engineer
    November 23, 2020

    More pytorch videos …..bro

  • Python Engineer
    November 23, 2020

    Super Fantastisch channel! Please keep up the great work.

  • Python Engineer
    November 23, 2020

    Great explanation. Like all your videos.

Write a comment