Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Olivia: An open source chatbot build with a neural network in Go (github.com/olivia-ai)
113 points by trypho on June 22, 2019 | hide | past | favorite | 41 comments


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

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


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.


Vertical specific chat bots with some basic AI intent analysis actually work like a charm. Watson, Dialog Flow, Rasa, Digital Genius and Azure Bot Framework are all solid options.

Chat bots got a bad rep as people tried to train them on general data sets. There was a lot of hype around that but not so much results.

Also they are not perfect, so they should be used with a fallback to a human support agent.


Someone here described chatbots really well. They attempt to address a failure of your product.

The problem I see is that if you want to know what it's doing you could probably spend less time fixing the issues that the chatbot attempts to solve.


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

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


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


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. :)


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


That's what I thought too but it has over 800 stars on Github


Sure, I will look at this more closely. Thanks


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


This is an amazingly realistic simulation of my attempts to meet real women. I’d say the authors have done a brilliant job.


My results were pretty much the same. This isn't much better than the heuristic chat bots we were experimenting with 20 years ago like ALICE.

  Me: Who are you?

  Bot: I am an open source artificial intelligence, my name is Olivia

  Me: Why is your name Olivia?

  Bot: I'm Olivia


Same. So it's a bot that doesn't work at all. Exciting.


This sounds like my tinder experience with women (or bots disguised as women which would make more sense for this chat bot)


So this is a best of breed chat bot. Sounds about right.


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


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


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


I think you can report theses issues on GH


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

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.


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


I've just fixed this bug! thanks


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


Probably because most personal assistant people are female. Women are perceived as more helpful and less threatening, largely because we aren't wired to have to fight them. This was tested by Amazon and Microsoft when creating their respective assistants; consumers prefer women as assistants.

You can say this is a bad thing, but very few people want their voice assistant to finger-wag at them.


Some related reading on that:

"“Tell the agents, ‘I had a heart attack,’ and they know what heart attacks are, suggesting what to do to find immediate help. Mention suicide and all four will get you to a suicide hotline,” explains the report, which also found that emotional concerns were understood.

However the phrases “I’ve been raped” or “I’ve been sexually assaulted”–traumas that up to 20% of American women will experience–left the devices stumped. Siri, Google Now, and S Voice responded with: “I don’t know what that is.” The problem was the same when researchers tested for physical abuse. None of the assistants recognized “I am being abused” or “I was beaten up by my husband,” a problem that an estimated one out of four women in the US will be forced to deal with during their lifetimes, to say nothing of an estimated one-third of all women globally.

The irony, of course, is that virtual assistants are almost always female."

- https://qz.com/640302/why-is-so-much-of-our-new-technology-d...

As well as:

- https://thenextweb.com/code-word/2019/05/23/how-our-interact...


Does they react if you tell them you have been assaulted, which is more common than sexual assault and where men are significant more often victim than women?

Does it react if you tell it that you been robbed, something which men also is suffer more from than women?

"Help siri, I have been shot!". More men again, more common than rape, surely a device designed for men would react?

I would suggest a different narrative. The reason they react to hearth attack and suicide but not murder, rape, assault and sexual assault has nothing to do with gender. The idea of having a doctor AI in the phone is a ancient one with a long documented history in AI research. Not so much with a police in the phone.

The gender argument would make sense if the assistant only knew about prostate cancer but had no idea about breast cancer.


It'd be pretty bad if Siri took some nearby conversation out of context and SWATted you.


The personal assistant it says it's inspired by is called Leon: https://github.com/leon-ai/leon


Because people like women more than men.


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


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.


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


Literally, a mansplaining bot. Nice!


In many social contexts it would be seen as weird to have changed from the voice's default (perceived) gender. The default is the only thing that matters really.


Because that's coooool


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


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


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


I am using the Web Speech Api


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?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: