Cosine similarity, doc2vec in pipeline, QnA csv

Prerequisites: I have many-many FAQ questions in my domain. So instead of creating and labeling 1000 intents i thinking of some solution.

  1. Create intent FAQ followed by action_faq which inference faq_model trained on QnA csv file.
  2. Put inference in action_default_fallback if high confidence then utter answer and revert fallback

I’ve seen rasa-demo. Not my case.

Is there solution to put my FAQ model in pipeline?

You don’t even have to put it in the pipeline, no? You can just do it like this:

  1. Change your fallback action name to whatever you like in config.yml. E.g.: fallback_action_name: “action_default_faq”
  2. Create custom action in named “action_default_faq”.
  3. In the class’s run method you manually check cosine similarity of the input against each of your faq candidates. If a similar case has been found, utter it. Else, prompt the user to rephrase and return [UserUtteranceReverted()]

Yes, i mentioned this approach in 2).

I doubt to implement it this way because i think FAQ model is NLU component and in this approach it’s located in actions field.

Also, i’m thinking about new feature Knowledge Base. How can i implement using this approach?

I’ll gonna try Retrieval Actions. It looks like what i’m looking for.