When Parsey McParseface went open source, it made waves in tech circles on the internet. Seeing this, and hearing about Parsie's state of the art word recognition whatever, I was inspired to make a """"chatbot"""". I ended up not using Parsey, instead using python-nltk, qtypes, and nlp_compromise for the job.

What it does

It takes user input, and stores it in a dictionary. The words are categorized by part of speech. When it's the bot's turn to talk, it attempts to create a grammatically correct sentence. Whether or not it succeeds varies.

How I built it

I started with a bit of code that took in user input. I then used python-nltk to tokenize the input, tag it with parts of speech, and stick them in a dictionary. I then added the functionality to create sentences out of the words in the dictionary, and then contraction expanding to avoid random "'d'"'s. I then added functionality to conjugate verbs and answer yes/no questions.

Challenges I ran in to

How do you tell the difference between the 3 types of *'s? How about the 2 types of *'d And how do you enforce subject-verb agreement? And how about when there are no nouns or verbs in stock?

Accomplishments that I'm proud of

I'm proud that I could expand all contractions. I am also proud that I could enforce subject verb agreement and figure out if a question was yes/no by asking a script of a different language

What I learned

I learned how to have 2 programs of different languages interact with each other. I learned how to analyze text for parts of speech, and I learned how to use subprocess

What's next for NNYN

I'll probably give it a better name than one of the first things that it said. I want to add the ability to answer questions that aren't Y/N and answer questions using either a) common knowledge or b) information shared in the past conversation.

Built With

Share this project: