I'm really new to Chatbots and starting to learn these stuff using frameworks. I'm starting to use this opensource framework RASA and learning about it. Then I found that this entity extraction tool Spacy, is used by RASA.
Can anybody explain what's the actual relation between these ? What's the role of Spacy within RASA ?
Rasa is a library used for building AI chatbots using Python and natural language understanding (NLU). You will use Spacy for advanced natural language processing and backend operations.
Back to Rasa Let's make a change to the NLU pipeline in our `config. yml` file so that we're able to use our own spaCy model. The main part that is important here is that we're configuring a SpacyNLP component in our pipeline that is referring to our own en_ner_demo_replace model.
Rasa NLU: A natural language understanding solution which takes the user input and tries to infer the intent and extract the available entities. Rasa Core: A dialogue management solution tries to build a probability model which decides the set of actions to perform based on the previous set of user inputs.
Rasa NLU internally uses Bag-of-Word (BoW) algorithm to find intent and Conditional Random Field (CRF) to find entities. Although you can use other algorithms for finding intent and entities using Rasa. You have to create a custom pipeline to do that.
The Rasa stack has two primary components: NLU and Core. Inside of Rasa NLU there are pipelines for extracting intents and entities. One of the pipeline components uses spaCy. For example in this Rasa pipeline:
pipeline:
- name: "nlp_spacy"
- name: "tokenizer_spacy"
- name: "intent_entity_featurizer_regex"
- name: "intent_featurizer_spacy"
- name: "ner_crf"
- name: "ner_synonyms"
- name: "intent_classifier_sklearn"
spaCy is used for pre-processing of the utterances, tokenization, and featurization. It also utilizes other python libraries like nltk and sklearn.
But Rasa NLU has several different pipeline options. So in the below pipeline:
pipeline:
- name: "tokenizer_whitespace"
- name: "ner_crf"
- name: "intent_featurizer_count_vectors"
- name: "intent_classifier_tensorflow_embedding"
spaCy is not used at all, but sklearn and tensorflow are.
Rasa NLU attempts to abstract some of the difficulties of working with spaCy and other libraries to make it easier and more focused on building a chatbot. Then there are other applications that are trying to take Rasa NLU and make it even easier to use by providing a more abstraction with a GUI. It's a fairly common pattern in open source where one tool builds on another. Some of the GUI applications for Rasa are:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With