
Olivia: An open source chatbot build with a neural network in Go - trypho
https://github.com/olivia-ai/olivia
======
boyter
Personally I hate chat-bots. I think the problem they solve can be better
implemented using a search interface and some workflows, which is generally
all website chat-bots do under the hood.

This is rather cool though from an implementation point of view. I actually
wrote my own really cheap chat-bot a few years ago, and its surprising how far
you can get with a few simple techniques if you know exactly where you want to
direct the user.

A while ago I was working at a client site where there was an internal
discussion group about building a chat-bot. Many meetings had passed,
discussing using neural networks, building flows, should we use IBM Watson.
Lots of talk, but not much delivery.

During the next chat-bot discussion while it was happening I during that
meeting wrote and showed at the end a chat-bot that was further along than
anything else delivered, not hard considering they were still talking. Code is
here for those interested, but please don't judge my hour worth of python too
harshly [https://github.com/boyter/really-cheap-
chatbot](https://github.com/boyter/really-cheap-chatbot)

Example flow of it

    
    
        Hello! RCC (really cheap chatbot) here what are you trying to do today? At any time type quit to quit.: pay bill
    
        Do you want to pay your bill using a credit card or using paypal?: dunno
        Sorry I did't quite catch what you were saying. Could you try typing it using different words please.
    
        Do you want to pay your bill using a credit card or using paypal?: credit card mate
    
        You can pay online using your credit card at https://plumbus.com.au/pay

~~~
hackily
I find that chatbots are great for doing a search for a user that didn't
bother to actually do a search.

For example, my team at work used to own a webcomponents library, but it
didn't seem like people were actually reading our documentation.

I created a simple lambda function that triggered on a webhook when someone
messaged our channel, and my function would parse through the message for some
mention of "help" or "didn't work" "how", and if they mentioned one of our
components. It would create response thread to that message and just link them
to the documentation page.

There was no machine learning involved... but there didn't need to be.

------
tschellenbach
The neural network code for that is used to train this bot is only 350 lines,
that's really succinct: [https://github.com/olivia-
ai/gonn/blob/master/gonn/gonn.go](https://github.com/olivia-
ai/gonn/blob/master/gonn/gonn.go)

Update: Well... the results are not really great.

------
WilliamEdward
This is pretty non-functional, i think it only got upvoted because it hit all
the right buzzwords in the title. Some combination of "Open Source", "Neural
Network", and "Go" gets you real far huh.

Here's how mine went:

me: please calculate 4 x 5

bot: That makes 4

~~~
ananagame
That's because you need to use * for the enthusiasm arround Olivia, sure she
does not answer well to all questions but the important is the structure of
the chatbot, you can clone the project and import your own dataset (a big one)
and you will have a good chatbot. :)

~~~
WilliamEdward
i used text to speech and said 'times' and ir produced an x

------
darepublic
Tried it out and the convo went like this:

Me: hi

Bot: I do not understand your request

Me: what is your name

Bot: my name is Olivia

Me: can you help me?

Bot: goodbye

~~~
usaphp
If you look at a source code it seems to only do some basic stuff like
currency converter, searches for a capital of the country and some other basic

~~~
ananagame
This shows the example, the goal is for people to clone Olivia to add their
own dataset because the default one is too small.

~~~
usaphp
I understand that. I was just referring to the OP who was surprised that it
does not answer his questions

------
johnnyfived
This looks cool but there's not a lot of documentation about how this works or
how the bot reads in the training data.

There's the example file here: [https://github.com/olivia-
ai/olivia/blob/master/res/intents....](https://github.com/olivia-
ai/olivia/blob/master/res/intents.json)

But trying every variation of "hi" doesn't return any of the correct responses
from the online demo. And Olivia doesn't seem to do text normalization
(stripping out punctuation), so saying "Hey." instead of "Hey" or "Hey!"
doesn't work.

~~~
trypho
I think that's coming but I don't know for punctuation :/

------
sumo89
Why do all personal assistant programs/apps have to have female names?

~~~
m0zg
Not all. Siri is a gender-neutral name. It defaults to a female voice, but you
could imagine a male named Siri as well.

~~~
jdietrich
In the UK (and France, IIRC), Siri launched with a male voice only.

The poor support for women's issues in many apps (rape crisis centres in
virtual assistants, period tracking in Apple Health etc) do represent serious
failures in product development, but I suspect that the voice gender issue is
a bit of a double-bind. If a male voice was the default in the US, I expect
we'd be seeing thinkpieces about how Siri was reinforcing patriarchal
stereotypes about men being authoritative.

~~~
sgt101
I know that Siri has a male voice in the UK now, but I remember when it
launched it was female.

------
lemmox
Neat! I haven't seen much golang ML. I wonder: is there a particular reason to
target go? Maybe some plans for the future?

~~~
ananagame
Not a real particular reason, that's just because go was the language I knew
the best and I was enthusiastic because no one has built a real chatbot in Go

------
keyle
How does it talk on MacOs? I'm confused, I closed the tab mid-sentence and it
kept talking until it finished the sentence.

~~~
ananagame
I am using the Web Speech Api

------
binwiederhier
I'm having a hard time understanding why this has been upvoted so much. I
don't want to sound harsh but the code just looks like a ton of if-then-elses
and regexes. Where is the neural network? Or did I miss that somehow?

