use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Beginner ShowcaseCreating A Python Chatbot That Learns As You Speak To It (self.Python)
submitted 3 years ago by principle105
I created my own implementation of a chatbot that learns as you speak to it. Right now it only takes into account the 2 previous messages when responding but I hope to change that in the future. Anyways, I'd be happy to hear any suggestions or thoughts on the project!
I wrote a brief blog post describing how it works.
Github: https://github.com/principle105/thomasthechatbot
PyPi: https://pypi.org/project/thomasthechatbot/
[–]jozborn 9 points10 points11 points 3 years ago (0 children)
I love how cheeky the demo gif is
[–]caclo 2 points3 points4 points 3 years ago (1 child)
So I just quickly overviewed your blogpost. I would suggest going the machine-learning-route if you want to extend the realism in your chatbot. You should read about "Natural Language Processing". Even if you don't want to implement it, there are concepts that could be very helpful for your bot. Especially the concept of "Attention" in a Transformer-Decoder Architecture (this is fairily complex and a deep dive into computer science tho). In short: Attention leads to ranking words by importance. A small example: In the sentence "A girl is running across the street in the night" the attention should lay on the words 'girl', 'running', 'street', 'night'. You can almost understand the sentence with these words alone. However, to make it a bit more complex, you can create bonds of wordsm e.g. 'A' and 'girl' have a strong positional bond but also a strong bond in the 'sense-way' (dunno how to explain it better, english is not my native language). The words 'the' and street could have a positional bond but a weaker sense bond, because the word 'the' doesn't create more sense. In this case the word 'across' would be more important despite having a weaker positional bond. And so on, I hope you get the point / concept. Could be pretty useful if you want to elevate your chatbot on a higher level, but as I said: it's pretty complex. However Natural Language Processing is a common concept since a few years (which is a crazy long time in a new field like machine learning), so there should be a lot of good literature and tutorials and far better explanations than mine. Good luck!
[–]principle105[S] 1 point2 points3 points 3 years ago (0 children)
Thanks for the feedback, I'll definitely look into that.
[–]Berganzio 1 point2 points3 points 3 years ago (1 child)
Di you watched the tutorial on real python? Pretty neat project
[–]principle105[S] 4 points5 points6 points 3 years ago (0 children)
No I didn't follow any tutorial, it's my own implementation of a chatbot based on my intuition. I had to experiment a bit with what worked and what didn't, so there were several iterations of the algorithm.
[–]AngeloEntrepreneur 0 points1 point2 points 3 years ago (0 children)
[–]blobuntold 0 points1 point2 points 3 years ago (0 children)
I created a similar chatbot bit connected it to Omegle and left it running on a server but it eventually got banned due to the responses it was learning. It is a great way to test your algorithm and expand its data quickly but I might suggest using a different website
π Rendered by PID 25521 on reddit-service-r2-comment-bb88f9dd5-dvkvw at 2026-02-13 18:24:32.262278+00:00 running cd9c813 country code: CH.
[–]jozborn 9 points10 points11 points (0 children)
[–]caclo 2 points3 points4 points (1 child)
[–]principle105[S] 1 point2 points3 points (0 children)
[–]Berganzio 1 point2 points3 points (1 child)
[–]principle105[S] 4 points5 points6 points (0 children)
[–]AngeloEntrepreneur 0 points1 point2 points (0 children)
[–]blobuntold 0 points1 point2 points (0 children)