Hello
I have created a custom pipeline for altering user message but even before user inputs something the function is getting called and ‘None’ gets saved in the message variable
So any further actions prints into a result saying none cannot be …etc
my rasa version is
Rasa Version : 2.1.2
Rasa SDK Version : 2.1.2
Rasa X Version : None
Python Version : 3.6.8
Operating System : Windows-10-10.0.19041-SP0
Can anyone suggest how should i move forward with this
My CustomComponent file pre-processing.py
import typing
from typing import Any, Optional, Text, Dict, List, Type
from rasa.nlu.components import Component
from rasa.shared.nlu.training_data.message import Message
if typing.TYPE_CHECKING:
from rasa.nlu.model import Metadata
installed_languages = translate.get_installed_languages()
translation_ar_en = installed_languages[1].get_translation(installed_languages[0])
No so i ran rasa shell --debug to understand whats going on
I want it to work when i do rasa run --enable-api --cors “*”
Also when you say i dont have a classifier
So there are only 2 things in cofig pipeline and policy, right?
So where does a classifier comes
I also tried adding Ted policy and Rule policy separately and together to see if that helps
but same issue
you need to add the other components in the pipeline for the bot to understand text and provide intent and entities
policies consider these as input and provides you with actions to do or reply
in your logs the first line says
2022-02-01 14:20:52 DEBUG rasa.core.processor - Received user message ‘hi’ with intent ‘{‘name’: None, ‘confidence’: 0.0}’ and entities ‘[]’
This means that the pipeline did not understand your text since you didn’t provide anything except your custom component and your custom component if i see the code doesn’t do anything
thus your policies failed since they depend on the output of the pipeline.
So please create a valid config.yml where you also provide the remaning components of your pipeline which is missing in the information you provided above.
initially there was no pipelines right. thus rasa went to use the default one. now since you have a custom component in your pipeline, rasa does not pick up the rest as default instead you must now explicitly provide all the other components
language: en
pipeline:
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
- name: pre-processing.MyComponent
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: char_wb
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 100
- name: EntitySynonymMapper
- name: ResponseSelector
epochs: 100
# - name: FallbackClassifier
# threshold: 0.3
# ambiguity_threshold: 0.1
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
# # No configuration for policies was provided. The following default policies were used to train your model.
# # If you'd like to customize them, uncomment and adjust the policies.
# # See https://rasa.com/docs/rasa/policies for more information.
- name: MemoizationPolicy
- name: TEDPolicy
max_history: 5
epochs: 100
- name: RulePolicy
is your pre-processing a module with the root package having init.py ?
I woud create a package(folder) called custom then place the pre-processing.py in it and add another init.py and write the component in pre-processing.py
in my config, i will refer it as custom.pre-processing.MyComponent so your component is recognised