I am using rasa_nlu(version 0.14.3). I am using a custom pipeline. It consists of a custom component named preprocessing. I need to create a new Attribute(apart from intent and entities) named “phrases”. I am setting this value in my component code as message.phrases=‘my new phrase’. I am still not getting the attribute “phrases” in my final output. I checked the rasa nlu component document. But I didn’t find any information related to it. Any help will be highly appreciated.
Here is my config.yml-
language: en
pipeline:
- name: "preprocessing.Preprocessing"
- name: "intent_featurizer_count_vectors"
- name: "intent_classifier_tensorflow_embedding"
intent_tokenization_flag: true
intent_split_symbol: "+"
My preprocessing.py code is as below-
from rasa_nlu.components import Component
class Preprocessing(Component):
"""A Custom Pre-Processing Step to clean the Text"""
name = "preprocessing"
provides = ['phrases']
requires = []
defaults = {}
language_list = ["en"]
def __init__(self, component_config=None):
super(Preprocessing, self).__init__(component_config)
def process(self, message, **kwargs):
"""Clean up User comments data. The imoticons, hinglish words other shortcuts need to be cleaned"""
print("Processing the custom component....")
#Some custom logic here.....
#Trying to set a custom attribute named phrases to be responded in later pipeline components and in the final output
message.phrases = 'new phrase'
print(message.__dict__)