
Ask HN: How to Build NLP+ai Chatbot with 30 Days from Scratch - anbux
Hey HN, 
How to build Chatbot in 30 days without using any api?
======
tlack
Off the top of my head:

You'll need a way to talk to your bot. I think the Telegram bot API is the
easiest to use and it has bot-drawn UI buttons to simplify drudgery. Look into
a connector for your language of choice.

The bot will need to understand what the user is asking. You could create a
few dozen labeled examples of message text and the users intent, such as
('drive time to NYC' -> 'duration', 'thai food in seattle' ->
'recommendation'). You can then train a text classification system to infer
the intent of new messages that have some common text.

SpaCy is an excellent natural language processing toolkit that can be used for
this, but there are maaany options. [1]

The bot will need to be able to recognize different parts of user text in
cases like "address of Eiffel Tower". You could use SpaCy's named entity
recognition -- which can be retrained to understand other things -- to get
started. [2]

In my experience you'll need a complex system to understand the state of an
individual conversation and operate as a "control loop", but that's all on
you.

[1]
[https://spacy.io/usage/training#textcat](https://spacy.io/usage/training#textcat)
[2] [https://spacy.io/usage/linguistic-features#named-
entities](https://spacy.io/usage/linguistic-features#named-entities)

------
verdverm
Why without any APIs?

