Gravitation wrote:
Molybdenum wrote:
Gravitation wrote:
And it's back up.
(sorry for the consecutive posts, I can't edit yet)Excuse me for being stupid, but where is your website?
Gravi.tation.tk
The files are chat.php and chat.dat.
Is it just me, or do the tabs on the left do nothing?
Offline
I still can't connect to it. I've had trouble connecting with some .tk domains.
Offline
Molybdenum wrote:
Gravitation wrote:
Molybdenum wrote:
Excuse me for being stupid, but where is your website?Gravi.tation.tk
The files are chat.php and chat.dat.Is it just me, or do the tabs on the left do nothing?
They do nothing, I'm not done with the website yet; I have nothing to put on there.
transparent wrote:
I still can't connect to it. I've had trouble connecting with some .tk domains.
Hmm. Weird.
Offline
Gravitation wrote:
blob8108 wrote:
This is still my favourite chatbot:
Code:
import random messages = [] while 1: messages.append(raw_input("? ")) print random.choice(messages)
I knew you would post here, since you're a Python programmer.
I found the thread eventually...
Offline
I did make a learning chatbot once that automatically built a dictionary of inputs versus lists of possible responses as you talked to it. It would add your replies as possible responses to the last thing it said, if that makes sense. I wrote an interface for an anonymous chatroom and got it to learn from random strangers... It generated some very amusing chat logs
The trick was to use fuzzy string comparison (called Levenshtein distance, if you're interested) when comparing the current input against the dictionary. It compared sentences, and then words, and then letters (exactly the same was 1.0, upper/lowercase of the same letter were set as 0.8 similar, for example, and so on).
It picks a random response from the input with the best match. Below a certain threshold (about 0.4, iirc) it just gives a random response.
So as a result, if it says "How are you?", and you say "Fine, thanks!" in reply, it will then respond to "how're you today" (or similar) with "Fine, thanks!".
So, there are my thoughts I could post code if you're interested (:
Last edited by blob8108 (2012-10-14 14:21:07)
Offline
blob8108 wrote:
I did make a learning chatbot once that automatically built a dictionary of inputs versus lists of possible responses as you talked to it. It would add your replies as possible responses to the last thing it said, if that makes sense. I wrote an interface for an anonymous chatroom and got it to learn from random strangers... It generated some very amusing chat logs
The trick was to use fuzzy string comparison (called Levenshtein distance, if you're interested) when comparing the current input against the dictionary. It compared sentences, and then words, and then letters (exactly the same was 1.0, upper/lowercase of the same letter were set as 0.8 similar, for example, and so on).
It picks a random response from the input with the best match. Below a certain threshold (about 0.4, iirc) it just gives a random response.
So as a result, if it says "How are you?", and you say "Fine, thanks!" in reply, it will then respond to "how're you today" (or similar) with "Fine, thanks!".
So, there are my thoughts I could post code if you're interested (:
Very interesting stuff! Can I see the code?
Offline
Gravitation wrote:
blob8108 wrote:
I did make a learning chatbot once that automatically built a dictionary of inputs versus lists of possible responses as you talked to it. It would add your replies as possible responses to the last thing it said, if that makes sense. I wrote an interface for an anonymous chatroom and got it to learn from random strangers... It generated some very amusing chat logs
The trick was to use fuzzy string comparison (called Levenshtein distance, if you're interested) when comparing the current input against the dictionary. It compared sentences, and then words, and then letters (exactly the same was 1.0, upper/lowercase of the same letter were set as 0.8 similar, for example, and so on).
It picks a random response from the input with the best match. Below a certain threshold (about 0.4, iirc) it just gives a random response.
So as a result, if it says "How are you?", and you say "Fine, thanks!" in reply, it will then respond to "how're you today" (or similar) with "Fine, thanks!".
So, there are my thoughts I could post code if you're interested (:Very interesting stuff! Can I see the code?
Hmm, fuzzy comparison. I need to know how to do that.
Offline
Molybdenum wrote:
Hmm, fuzzy comparison. I need to know how to do that.
I just found a Levenshtein distance algorithm on the internet...
Offline
Gravitation wrote:
blob8108 wrote:
I did make a learning chatbot once ...
Very interesting stuff! Can I see the code?
Sure, I'll clean it up a bit and post it here.
In the meantime, here's a sample conversation, starting from a blank memory:
YOU: Hi! BOT: Hi! YOU: How are you? BOT: How are you? YOU: I'm alright, thanks. How are you? BOT: I'm alright, thanks. YOU: Good! Let's have a party. BOT: Good! YOU: Yes. BOT: How are you? YOU: Good, thanks! BOT: Let's have a party. YOU: Yes, let's! BOT: Yes, let's!
(It gets better, honestly...)
Last edited by blob8108 (2012-10-15 13:50:13)
Offline
blob8108 wrote:
Gravitation wrote:
blob8108 wrote:
I did make a learning chatbot once ...
Very interesting stuff! Can I see the code?Sure, I'll clean it up a bit and post it here.
Here you go!
It's some of the messiest code I've ever written, by virtue of being the product of my procrastination for exams the summer before last...
Offline
blob8108 wrote:
blob8108 wrote:
Gravitation wrote:
Sure, I'll clean it up a bit and post it here.
Here you go!
It's some of the messiest code I've ever written, by virtue of being the product of my procrastination for exams the summer before last...
Hrm. It immediately closes after it opens. Something about JSON.
Offline
Gravitation wrote:
blob8108 wrote:
blob8108 wrote:
Sure, I'll clean it up a bit and post it here.Here you go!
It's some of the messiest code I've ever written, by virtue of being the product of my procrastination for exams the summer before last...Hrm. It immediately closes after it opens. Something about JSON.
Which Python are you using? Did you run it from terminal? You need to pass an argument telling it where to save its memory, like
python chatbot.py memory.json
Offline
blob8108 wrote:
Gravitation wrote:
blob8108 wrote:
Here you go!
It's some of the messiest code I've ever written, by virtue of being the product of my procrastination for exams the summer before last...Hrm. It immediately closes after it opens. Something about JSON.
Which Python are you using? Did you run it from terminal? You need to pass an argument telling it where to save its memory, like
Code:
python chatbot.py memory.json
Oh, okay. Thanks, it works now
Excuse my stupidity, I have Windows
Offline
Gravitation wrote:
Excuse my stupidity, I have Windows
It's okay, I'll forgive you — I'll pretend it's just Windows being stupid, and not you...
Offline
blob8108 wrote:
Gravitation wrote:
Excuse my stupidity, I have Windows
It's okay, I'll forgive you — I'll pretend it's just Windows being stupid, and not you...
Thanks.
But seriously, I'm new to programming (not Scratch, though); I have no idea how most of the stuff works.
Offline