I have developed a chatbot, which is basically a seq2seq LSTM network. Which can generate text based on input text. But the problem I am having right now is it is not topic aware.
As an example :

Input : Wanna go to the stadium ? Topic: Football

Answer: No , I don't like football.

What I am planning to do , is to tokenize each possible topic

As an example {1: "Football",2: "Food" ..........}

But don't know how to embed this tokenized topic in training .


1 Answer 1


Try this approach (not embedded but filtering your model) with Topic modeling, that could be used to filter the results of your model by topic:

  1. Separate each doc in several sentences
  2. Obtain the best topics ( occur > 3, chars > 3 ) from sentences if you do not have an idea of topics to declare (LatentDirichlet Allocation)
  3. Discard some topics out of interest

Finally assign a dominant topic to every sentence and filter results by topic.

I have found a reference from steps 1-3: https://medium.com/@actsusanli/when-topic-modeling-is-part-of-the-text-pre-processing-294b58d35514


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.