Object of type float32 is not JSON serializable

Hello Community

I have this error right after that my model predicted an intent when running rasa shell. I am using a keras model to predict intents as a custom component in my nlu pipeline which is saved in h5 format. anyone can guess what can be the reason for this error?

2021-12-09 21:52:05 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
[state 1] user intent: affirm | previous action name: action_listen
[state 2] user intent: affirm | previous action name: utter_greet
2021-12-09 21:52:05 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2021-12-09 21:52:05 DEBUG    rasa.engine.graph  - Node 'run_TEDPolicy2' running 'TEDPolicy.predict_action_probabilities'.
2021-12-09 21:52:05 DEBUG    rasa.core.policies.ted_policy  - TED predicted 'action_listen' based on user intent.
2021-12-09 21:52:05 DEBUG    rasa.engine.graph  - Node 'select_prediction' running 'DefaultPolicyPredictionEnsemble.combine_predictions_from_kwargs'.
2021-12-09 21:52:05 DEBUG    rasa.core.policies.ensemble  - Predicted next action using MemoizationPolicy.
2021-12-09 21:52:05 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 1.00.
2021-12-09 21:52:05 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
2021-12-09 21:52:05 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
2021-12-09 21:52:05 ERROR    rasa.core.tracker_store  - Error happened when trying to save conversation tracker to 'InMemoryTrackerStore'. Falling back to use the 'InMemoryTrackerStore'.
Please investigate the following error: Object of type float32 is not JSON serializable.

@maralbahari can you please share some related files for the same or brief about your use case, that will help us more to understand the issue.

I created a custom component model for intent classification in nlu pipeline which is predicting and working fine and rasa policies are predicting the next action fine while debugging with rasa shell --debug the in memory track store gives this error as below

2021-12-15 16:51:17 ERROR    rasa.core.tracker_store  - Error happened when trying to save conversation tracker to 'InMemoryTrackerStore'. Falling back to use the 'InMemoryTrackerStore'.
Please investigate the following error: Object of type float32 is not JSON serializable.
2021-12-15 16:51:17 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'fcf8b26dbf1d4ae18bf81d52197378ab'.
2021-12-15 16:52:20 ERROR    asyncio  - Task exception was never retrieved

Hi nik, here is more of the error details. I would really appreciate your help… I am frustrated and desperate for a solution on thiis

2021-12-15 23:38:12 ERROR    asyncio  - Task exception was never retrieved
future: <Task finished coro=<SignalRouter._dispatch() done, defined at C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\sanic\signals.py:102> exception=ClientResponseError(Request
Info(url=URL('http://localhost:5005/webhooks/rest/webhook?stream=true&token='), method='POST', headers=<CIMultiDictProxy('Host': 'localhost:5005', 'Accept': '*/*', 'Accept-Encoding': 'gzi
p, deflate', 'User-Agent': 'Python/3.7 aiohttp/3.7.4', 'Content-Length': '71', 'Content-Type': 'application/json')>, real_url=URL('http://localhost:5005/webhooks/rest/webhook?stream=true&
token=')), (), status=503, message='Service Unavailable', headers=<CIMultiDictProxy('Access-Control-Expose-Headers': 'filename', 'Access-Control-Allow-Credentials': 'true', 'Content-Lengt
h': '79', 'Connection': 'close', 'Content-Type': 'application/json')>) created at C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\sanic\signals.py:165>
source_traceback: Object created at (most recent call last):
aiohttp.client_exceptions.ClientResponseError: 503, message='Service Unavailable', url=URL('http://localhost:5005/webhooks/rest/webhook?stream=true&token=')

@maralbahari Hi, sorry for the late reply, can you share the config.yml, credentials.yml, and your custom component code if any?

@maralbahari are you trying to store the data or fetch the data from the database?

@maralbahari can you even share the rasa --version?

I am not using anything of credentials cuz I’m running the bot on terminal with rasa shell and not connected to any other platform yet. and I am not storing the convos on any databases… the bot is using the default in memory tracker store. the rasa open source is 3.0 the rasa x version is 0.42.1 here is my config file:

# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
recipe: "default.v1"
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: "WhitespaceTokenizer"
     intent_tokenization_flag: True
     intent_split_symbol: "_"
   - name: "RegexFeaturizer"
     case_sensitive: False
   - name: "RegexEntityExtractor"
   - name: "DucklingEntityExtractor"
     url: "http://localhost:8000"
     dimensions: ["email"]
   - name: "LexicalSyntacticFeaturizer"
   - name: "EntitySynonymMapper"
   - name: "CountVectorsFeaturizer"
   - name: "CountVectorsFeaturizer"
     analyzer: "char_wb"
     min_ngram: 1
     max_ngram: 4
   - name: "DIETClassifier"
     epochs: 150
     random_seed: 1
     entity_recognition: true
     intent_recognition: false
     constrain_similarities: true
   - name: "wordEmbeddingClassifier.keras_embedding_intent_classifier.KerasEmbeddingIntentClassifier"

#   - name: "ResponseSelector"
#     epochs: 100
#     constrain_similarities: true
#   - name: "FallbackClassifier"
#     threshold: 0.7
#     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: "RulePolicy"
     core_fallback_treshold: 0.3
   - name: "MemoizationPolicy"
   - name: "TEDPolicy"
     max_history: 4
     epochs: 100

and here is my custom component (which is intent classification) and it is predicting correct intents cuz I tested it already . I have said before I can run the rasa shell it predicts correct intent and correct response with the policies however the problem rises when the convo is being saved in local memory or something

the component is as belowe:

from __future__ import annotations
import logging
import typing
import warnings
from typing import Any, Dict, List, Optional, Text, Tuple, Type

import numpy as np
import re
import string

import rasa.shared.utils.io
import rasa.utils.io as io_utils
import sklearn
from rasa.engine.graph import GraphComponent, ExecutionContext
from rasa.engine.recipes.default_recipe import DefaultV1Recipe
from rasa.engine.storage.resource import Resource
from rasa.engine.storage.storage import ModelStorage
from rasa.shared.constants import DOCS_URL_TRAINING_DATA_NLU
from rasa.nlu.classifiers import LABEL_RANKING_LENGTH
from rasa.shared.nlu.constants import TEXT,METADATA_EXAMPLE
from rasa.nlu.classifiers.classifier import IntentClassifier
from rasa.shared.nlu.training_data.training_data import TrainingData
from rasa.shared.nlu.training_data.message import Message
from sklearn.preprocessing import LabelEncoder
logger = logging.getLogger(__name__)

if typing.TYPE_CHECKING:
    import keras
    from keras.preprocessing.sequence import pad_sequences
    from keras.models import Sequential
    from keras.layers import Dense
    from keras.layers import GlobalMaxPooling1D
    import nltk
    from nltk.tokenize import word_tokenize
    from sklearn.model_selection import train_test_split
    from keras.layers.embeddings import Embedding



@DefaultV1Recipe.register(
    DefaultV1Recipe.ComponentType.INTENT_CLASSIFIER, is_trainable=True
)
class KerasEmbeddingIntentClassifier(GraphComponent, IntentClassifier):
    @classmethod
    def required_components(cls) -> List[Type]:
        """Components that should be included in the pipeline before this component."""
        return []

    @staticmethod
    def get_default_config() -> Dict[Text, Any]:
        """The component's default config (see parent class for full docstring)."""
        return {

            "max_len" : 1000,
            "embedding_dim" : 200,
            "trunc_type" : 'post',
            "padding_type" : 'post',
            "optimizer":"adam",
            "loss":"sparse_categorical_crossentropy",
            "metrics":['accuracy'],
            "activation_1":'relu',
            "activation_2":'softmax',
            "epochs":400,
            "verbose":2,
            "num_threads": 1
        }

    def __init__(
            self,
            config: Dict[Text, Any],
            model_storage: ModelStorage,
            resource: Resource,
            clf: "keras.models.Sequential" = None,
            le: "sklearn.preprocessing.LabelEncoder" = None,
            fe:"keras.preprocessing.text.Tokenizer"=None
    ) -> None:
        from keras.preprocessing.text import Tokenizer
        from sklearn.preprocessing import LabelEncoder
        self.component_config = config
        self._model_storage = model_storage
        self._resource = resource
        if fe is not None:
            self.fe=fe
            rasa.shared.utils.io.raise_warning(f"feature tokenizer is not none:{self.fe.word_index}")
        else:
            self.fe=Tokenizer()
        if le is not None:
            self.le = le
        else:
            self.le = LabelEncoder()
        self.clf = clf
    @classmethod
    def create(
        cls,
        config: Dict[Text, Any],
        model_storage: ModelStorage,
        resource: Resource,
        execution_context: ExecutionContext,
    ) -> KerasEmbeddingIntentClassifier:
        """Creates a new untrained component (see parent class for full docstring)."""
        return cls(config, model_storage, resource)

    @classmethod
    def required_packages(cls) -> List[Text]:
        """Any extra python dependencies required for this component to run."""
        return ["keras","sklearn","nltk"]

    def transform_labels_str2num_seq(self, labels: List[Text]) -> np.ndarray:
        """Transforms a list of strings into numeric label representation.

        :param labels: List of labels to convert to numeric representation
        """
        return  self.le.fit_transform(labels)

    def transform_nlu_examples_str2num(self,X)-> list:
        self.fe.fit_on_texts(X)
        return self.fe.texts_to_sequences(X)
    def pad_nlu_examples(self,X)-> np.ndarray:
        from keras.preprocessing.sequence import pad_sequences
        return pad_sequences(X,padding=self.component_config["padding_type"],maxlen=self.component_config['max_len'])

    def clean_text(self,text):
        import nltk
        from nltk.tokenize import word_tokenize
        import string
        text = text.lower()
        # tokenize the text
        tokens = word_tokenize(text)
        tokens = [w.lower() for w in tokens]
        # remove puntuations
        table = str.maketrans('', '', string.punctuation)
        stripped = [w.translate(table) for w in tokens]
        return ' '.join(stripped)


    def train(self, training_data: TrainingData) -> Resource:
        from sklearn.model_selection import train_test_split
        from keras.callbacks import ModelCheckpoint
        from nltk.tokenize import word_tokenize
        num_threads = self.component_config["num_threads"]

        labels = [e.get("intent") for e in training_data.intent_examples]

        examples=[e.get(TEXT) for e in training_data.intent_examples]
        rasa.shared.utils.io.raise_warning(f"examples{examples}")
        cleaned_x=[self.clean_text(t) for t in examples]
        rasa.shared.utils.io.raise_warning(f"cleaned:{cleaned_x}")
        tokenized_cleaned_x=[word_tokenize(t) for t in cleaned_x]
        rasa.shared.utils.io.raise_warning(f"tokenized cleaned{tokenized_cleaned_x}")

        if len(set(labels)) < 2:
            rasa.shared.utils.io.raise_warning(
                "Can not train an intent classifier as there are not "
                "enough intents. Need at least 2 different intents. "
                "Skipping training of intent classifier.",
                docs=DOCS_URL_TRAINING_DATA_NLU,
            )
            return self._resource

        y = self.transform_labels_str2num_seq(labels)

        X=self.transform_nlu_examples_str2num(tokenized_cleaned_x)

        rasa.shared.utils.io.raise_warning(f"y{y}")
        rasa.shared.utils.io.raise_warning(f"x:{X}")

        X_padded=self.pad_nlu_examples(X)
        trainX, testX, trainY, testY = train_test_split(X_padded, y, test_size=0.2, random_state=42)
        self.clf = self._create_classifier(num_threads, y)
        with warnings.catch_warnings():

            warnings.simplefilter("ignore")
            checkpoint = ModelCheckpoint('model-{epoch:03d}-{val_accuracy:03f}.h5', verbose=1, monitor='val_acc',
                                         save_best_only=True, mode='auto')
            self.clf.fit(trainX,trainY,epochs=self.component_config['epochs'],validation_data=(testX,testY),callbacks=[checkpoint],verbose=self.component_config['verbose'])

        self.clf.summary()
        self.persist()
        return self._resource
    def glove_embedding_matrix(self):
        import os
        embedding_index = {}
        glove_dir = "C:\\Users\\maral\\PycharmProjects\\FSKTMBot\\wordEmbeddingClassifier\\pretrained_glove"
        f = open(os.path.join(glove_dir, 'glove.twitter.27B.200d.txt'), encoding="utf-8")
        for line in f:
            values = line.split()
            word = values[0]
            coeff = np.asarray(values[1:], dtype='float32')
            embedding_index[word] = coeff
        f.close()
        embedding_matrix = np.zeros((len(self.fe.word_index)+1, self.component_config["embedding_dim"]))
        for word, i in self.fe.word_index.items():
            embedding_vector = embedding_index.get(word)
            if embedding_vector is not None:
                embedding_matrix[i] = embedding_vector
        return embedding_matrix
    def _create_classifier(
            self, num_threads: int, y: np.ndarray
    ) -> "keras.models.Sequential":
        from keras.models import Sequential
        from keras.layers import Dense,GlobalMaxPooling1D,Dropout
        from keras.layers.embeddings import Embedding
        embedding_matrix=self.glove_embedding_matrix()

        model = Sequential()
        model.add(Embedding(len(self.fe.word_index)+1,
                            self.component_config["embedding_dim"],weights=[embedding_matrix], input_length=self.component_config["max_len"],trainable=False))
        model.add(GlobalMaxPooling1D())
        model.add(Dense(self.component_config["embedding_dim"],activation=self.component_config["activation_1"]))
        model.add(Dense(50,activation=self.component_config["activation_1"]))
        model.add(Dropout(0.5))
        model.add(Dense(16, activation=self.component_config["activation_2"]))
        # compile the model
        model.compile(optimizer=self.component_config['optimizer'],
                      loss=self.component_config['loss'], metrics=self.component_config['metrics'])
        return model
    def predict_prob(self, X: np.ndarray) -> np.ndarray:
        """Given a bow vector of an input text, predict the intent label.

        Return probabilities for all labels.

        :param X: bow of input text
        :return: vector of probabilities containing one entry for each label.
        """
        rasa.shared.utils.io.raise_warning(f'predict_proba{(self.clf.predict(X))}')
        return self.clf.predict(X)

    def predict(self, X: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
        """Given a bow vector of an input text, predict most probable label.

        Return only the most likely label.

        :param X: bow of input text
        :return: tuple of first, the most probable label and second,
                 its probability.
        """
        pred_result = self.predict_prob(X)
        # sort the probabilities retrieving the indices of
        # the elements in sorted order
        sorted_indices = np.fliplr(np.argsort(pred_result, axis=1))
        rasa.shared.utils.io.raise_warning(f"sorted_indicies_type:{(sorted_indices)}")
        return sorted_indices, pred_result[:, sorted_indices]

    def transform_labels_num2str(self,intent_ids)->np.ndarray:
        return self.le.inverse_transform(intent_ids[0])
    def process(self, messages: List[Message]) -> List[Message]:
        """Return the most likely intent and its probability for a message."""
        from nltk.tokenize import word_tokenize
        for message in messages:
            if not self.clf:
                # component is either not trained or didn't
                # receive enough training data
                intent = None
                intent_ranking = []
            else:
                msg =str(message.get(TEXT))
                rasa.shared.utils.io.raise_warning(f"message:{msg}")
                msg=[self.clean_text(msg)]
                msg=[word_tokenize(w) for w in msg]
                msg=self.fe.texts_to_sequences(msg)
                rasa.shared.utils.io.raise_warning(f"message_trans:{msg}")
                padded_X=self.pad_nlu_examples(msg)
                rasa.shared.utils.io.raise_warning(f"message_padded:{padded_X}")
                intent_ids, probabilities = self.predict(padded_X)
                rasa.shared.utils.io.raise_warning(f"intent_ids:{intent_ids}")

                intents = self.transform_labels_num2str(intent_ids)
                rasa.shared.utils.io.raise_warning(f"intents:{intents}")

                # `predict` returns a matrix as it is supposed
                # to work for multiple examples as well, hence we need to flatten
                probabilities = probabilities.flatten()
                rasa.shared.utils.io.raise_warning(f"flatten prob:{probabilities}")

                if intents.size > 0 and probabilities.size > 0:
                    ranking = list(zip(list(intents), list(probabilities)))[
                        :LABEL_RANKING_LENGTH
                    ]

                    intent = {"name": intents[0], "confidence": probabilities[0]}

                    intent_ranking = [
                        {"name": intent_name, "confidence": score}
                        for intent_name, score in ranking
                    ]
                else:
                    intent = {"name": None, "confidence": 0.0}
                    intent_ranking = []
            rasa.shared.utils.io.raise_warning(f"ranking:{intent_ranking}")
            message.set("intent", intent, add_to_output=True)
            message.set("intent_ranking", intent_ranking, add_to_output=True)
            rasa.shared.utils.io.raise_warning(f"message_type:{type(message)}")

        return messages
    def persist(self) -> None:
        """Persist this model into the passed directory."""
        with self._model_storage.write_to(self._resource) as model_dir:
            file_name = self.__class__.__name__
            classifier_file_name = model_dir / f"{file_name}_classifier.h5"
            encoder_file_name = model_dir / f"{file_name}_labels_encoder.pkl"
            feature_encoder_file_name=model_dir/f"{file_name}_features_encoder.pkl"

            if self.clf and self.le:
                io_utils.json_pickle(encoder_file_name, self.le.classes_)
                io_utils.json_pickle(feature_encoder_file_name,self.fe.word_index)
                self.clf.save(classifier_file_name)


    @classmethod
    def load(
            cls,
            config: Dict[Text, Any],
            model_storage: ModelStorage,
            resource: Resource,
            execution_context: ExecutionContext,
            **kwargs: Any,
    ) -> KerasEmbeddingIntentClassifier:
        """Loads trained component (see parent class for full docstring)."""
        from keras.preprocessing.text import Tokenizer
        from keras.models import load_model
        from sklearn.preprocessing import LabelEncoder
        try:
            with model_storage.read_from(resource) as model_dir:
                file_name = cls.__name__
                classifier_file = model_dir / f"{file_name}_classifier.h5"
                rasa.shared.utils.io.raise_warning(f"classifier_file:{(classifier_file)}")

                if classifier_file.exists():
                    rasa.shared.utils.io.raise_warning(f"classifier_file_existance:{(classifier_file.exists())}")

                    classifier = load_model(classifier_file,compile=True)
                    rasa.shared.utils.io.raise_warning(f"classifier:{classifier}")
                    encoder_file = model_dir / f"{file_name}_labels_encoder.pkl"
                    features_encoder_file=model_dir / f"{file_name}_features_encoder.pkl"
                    labels = io_utils.json_unpickle(encoder_file)
                    features=io_utils.json_unpickle(features_encoder_file)
                    labels_encoder = LabelEncoder()
                    labels_encoder.classes_=labels
                    rasa.shared.utils.io.raise_warning(f"label_encoder_index:{labels_encoder.classes_}")

                    features_encoder=Tokenizer()
                    # rasa.shared.utils.io.raise_warning(f"training_data:{training_data}")

                    features_encoder.fit_on_texts(features)
                    rasa.shared.utils.io.raise_warning(f"features index:{features_encoder.word_index}")

                    return cls(config, model_storage, resource, classifier, labels_encoder,features_encoder)
        except ValueError:
            logger.debug(
                f"Failed to load '{cls.__name__}' from model storage. Resource "
                f"'{resource.name}' doesn't exist."
            )
        return cls(config, model_storage, resource)

I think you should dump your dictionary before setting it to your message object. It is possible that the score that you pass is not serialized before setting them on the message object and thus it is not understood as string. the Tracker generally expects string I believe. maybe print the probabilities to see the type and set them as string perhaps. worth a try. I am not sure

I was inspired for the component based on rasa’s sklearn intent classifier for this part how to pass the intent and the confidence. and checked the Dietclassifier as well using the same thing float for confidence and overall the intents ranking is a list of dictionaries. However I will give it a try to store the score as string . thank you for response

as far as i see, you have a serialization error which would probably comes from values with float such as confidence scores, just print the type of such and see. every packages(sklearn, keras) can output different data types when using predict_proba, so at some point it needs to be serialized so it can be saved as JSON. so you might have a type cast error. Your config doesn’t seem to indicate anything out of the ordinary apart from the custom component so start from there.

I have checked the probabilities from the part of code you replied is np.ndarray the intent_ranking is list of dictionaries and intent is dictionary. and type of element in probabilities array is numpy.float32. which this numpy.float32 is the same type as the score that is being returned in Dietclassifier if you check the source code inside def process() of Dietclassifier. even I tried to save the score as string and I am getting the same error. I dont think it’s from how the message is being passed in process() method when is predicting the intent for each message.

If you simply try the nlu , does it work ?

Simply running

Rasa shell nlu

Then you can eliminate the fact that it ain’t your custom component but maybe a slot being set etc which is throwing off the tracker store

yes I am able to run rasa in terminal by rasa shell --debug and it is predicting correct intent and score and the policies are returning correct utter for response everything good till the moment that tracker store is saving the conversation

my nlu is working fine here is the sample I just run

C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: classifier_file:C:\Users\maral\AppData\Local\Temp\tmpkfptzxbe\train_wordEmbeddingClassifi
er.keras_embedding_intent_classifier.KerasEmbeddingIntentClassifier8\KerasEmbeddingIntentClassifier_classifier.h5
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: classifier_file_existance:True
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: classifier:<keras.engine.sequential.Sequential object at 0x000001E589782C08>
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: label_encoder_index:['affirm' 'challenge' 'deny' 'emailaddress' 'goodbye' 'greet' 'happy'

 'letteraddress' 'location' 'matricno' 'name' 'passportno'
 'requestletters' 'stop' 'unhappy' 'university']
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: features index:{'is': 1, 'my': 2, 'letter': 3, 'i': 4, 'um': 5, 'what': 6, 'kuala': 7, 'l
umpur': 8, 'good': 9, 'no': 10, 'a': 11, 'of': 12, 'mission': 13, 'you': 14, 'to': 15, 'so': 16, 'need': 17, 'name': 18, 'university': 19, 'entity': 20, 'not': 21, 'am': 22, 'the': 23, 'm
e': 24, 'confirmation': 25, 'address': 26, 'bye': 27, 'nice': 28, 'malaya': 29, 'wilayah': 30, 'persekutuan': 31, 's': 32, 'sad': 33, 'attendance': 34, 'value': 35, 'bot': 36, 'later': 37
, 'yes': 38, 'bad': 39, 'jalan': 40, 'hello': 41, 'please': 42, 'do': 43, 'where': 44, 'passport': 45, 'number': 46, 'gmailcom': 47, 'hi': 48, 'day': 49, 'great': 50, 'very': 51, 'call':
52, 'vision': 53, 'for': 54, 'goal': 55, 'about': 56, 'here': 57, 'ismail': 58, 'binti': 59, 'matric': 60, 'hey': 61, 'there': 62, 'see': 63, 'your': 64, 'get': 65, 'thanks': 66, 'nt': 67
, 'perfect': 68, 'are': 69, 'should': 70, 'want': 71, 'request': 72, 'report': 73, 'student': 74, 'dont': 75, 'it': 76, 'email': 77, 'yahoocom': 78, 'afternoon': 79, 'fsktm': 80, 'talk':
81, 'nope': 82, 'that': 83, 'sure': 84, 'yup': 85, 'pls': 86, 'like': 87, 'amazing': 88, 'feeling': 89, 'super': 90, 'well': 91, 'in': 92, 'mood': 93, 'human': 94, 'talking': 95, 'u': 96,
 'and': 97, 'aim': 98, 'tell': 99, 'uni': 100, 'show': 101, 'loc': 102, 'send': 103, '2': 104, 'letters': 105, 'status': 106, 'stop': 107, 'changed': 108, 'mind': 109, 'enough': 110, 'can
cel': 111, 'maral': 112, 'sarah': 113, 'bader': 114, 'this': 115, 'bin': 116, 'min': 117, 'ahmed': 118, 'they': 119, 'full': 120, 'pass': 121, 'ic': 122, 'be': 123, 'johor': 124, '50250':
 125, 'sultan': 126, '12': 127, 'morning': 128, 'evening': 129, 'moin': 130, 'let': 131, 'go': 132, 'goodmorning': 133, 'goodevening': 134, 'hy': 135, 'fast': 136, 'up': 137, 'friend': 13
8, 'chatbot': 139, 'hiii': 140, 'helo': 141, 'halo': 142, 'watsup': 143, 'cu': 144, 'by': 145, 'cee': 146, 'night': 147, 'goodbye': 148, 'have': 149, 'around': 150, 'back': 151, 'ask': 15
2, 'forever': 153, 'y': 154, 'indeed': 155, 'course': 156, 'sounds': 157, 'correct': 158, 'definitely': 159, 'yess': 160, 'yea': 161, 'ye': 162, 'yeh': 163, 'surely': 164, 'extermly': 165
, '100': 166, 'percent': 167, 'lot': 168, 'much': 169, 'n': 170, 'never': 171, 'think': 172, 'way': 173, 'really': 174, 'nah': 175, 'king': 176, 'wonderful': 177, 'going': 178, 'save': 17
9, 'world': 180, 'stoked': 181, 'extremely': 182, 'all': 183, 'was': 184, 'horrible': 185, 'feel': 186, 'disappointed': 187, 'm': 188, 'unhappy': 189, 'extremly': 190, 'saad': 191, 'upset
': 192, 'had': 193, 'mad': 194, 'who': 195, 'made': 196, 'shoul': 197, 'can': 198, 'ypur': 199, 'job': 200, 'knowledge': 201, 'aming': 202, 'univercity': 203, 'does': 204, 'doing': 205, '
how': 206, 'far': 207, 'located': 208, 'location': 209, 'map': 210, 'umiversity': 211, 'an': 212, 'provide': 213, 'two': 214, 'any': 215, 'more': 216, 'pause': 217, 'anymore': 218, 'done'
: 219, 'reject': 220, 'bahari': 221, 'sasani': 222, 'complete': 223, 'ba': 224, 'sowid': 225, 'fariba': 226, 'kalsia': 227, 'ali': 228, 'abassi': 229, 'fakher': 230, 'din': 231, 'jack': 2
32, 'ong': 233, 'fullname': 234, 'roksana': 235, 'samira': 236, 'hossein': 237, 'baha': 238, 'tashfia': 239, 'shamim': 240, 'erfan': 241, 'shahreeza': 242, 'fatih': 243, 'davood': 244, 'j
ashoa': 245, 'migash': 246, 'dini': 247, 'bal': 248, 'makail': 249, 'izza': 250, 'rafi': 251, 'hako': 252, 'darani': 253, 'media': 254, 'jamalian': 255, 'mahnaz': 256, 'kamila': 257, 'soh
eil': 258, 'ang': 259, 'sara': 260, 'farooki': 261, 'kamil': 262, 'farahani': 263, 'asil': 264, 'fati': 265, 'mohmed': 266, 'saleh': 267, 'saman': 268, 'ahadi': 269, 'lee': 270, 'hoo': 27
1, 'ksia': 272, 'wga': 273, 'ska': 274, 'kim': 275, 'hio': 276, 'ji': 277, 'famih': 278, 'aksia': 279, 'da': 280, 'ajs': 281, 'jemini': 282, 'silams': 283, 't02381723': 284, '122939222':
285, 'vs1394342': 286, '2392106': 287, 'tk328u4211': 288, 'pk18271602': 289, 'k118271201': 290, '192716292121': 291, 'l12991327': 292, '102971351': 293, '374661637': 294, '29323203': 295,
 '102172891': 296, '19282637261': 297, 'lks817272721': 298, '292773291929': 299, 'malaysian': 300, 'id': 301, '192830284726': 302, '927371742812': 303, '1193736473': 304, '271530213816':
305, 'nj19287427': 306, 'q111804232': 307, '236252464827': 308, '162419151537': 309, '192301488361': 310, '9b': 311, 'abdul': 312, 'samad': 313, 'kolam': 314, 'ayer': 315, '80100': 316, '
bahru': 317, 'alan': 318, 'perubatan': 319, '1': 320, 'pandan': 321, 'indah': 322, '55100': 323, '50350': 324, 'ampang': 325, 'mcity': 326, '55000': 327, 'amra': 328, 'sentul': 329, 'sela
tan': 330, '51000': 331, 'addres': 332, '20th': 333, 'floor': 334, 'menara': 335, 'ta': 336, 'one': 337, '22': 338, 'p': 339, 'ramlee': 340, '972': 341, 'azlan': 342, 'shah': 343, 'batu':
 344, '6': 345, '68100': 346, 'vortex': 347, 'klcc': 348, 'jln': 349, 'lorong': 350, 'universiti': 351, '50603': 352, 'federal': 353, 'territory': 354, 'hospital': 355, '93586': 356, 'kuc
hing': 357, 'sarawak': 358, 'djuna29': 359, 'wid180729': 360, 'siswaumedumy': 361, 'firda': 362, 'linda182': 363, 'dualipa': 364, 'maralbahari75': 365, 'badrbasowid98': 366, '171999741':
367, '200574712': 368, '181772481': 369, '121467892': 370, '500211961': 371, '200724291': 372, '938726151': 373}
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: feature tokenizer is not none:{'is': 1, 'my': 2, 'letter': 3, 'i': 4, 'um': 5, 'what': 6,
 'kuala': 7, 'lumpur': 8, 'good': 9, 'no': 10, 'a': 11, 'of': 12, 'mission': 13, 'you': 14, 'to': 15, 'so': 16, 'need': 17, 'name': 18, 'university': 19, 'entity': 20, 'not': 21, 'am': 22
, 'the': 23, 'me': 24, 'confirmation': 25, 'address': 26, 'bye': 27, 'nice': 28, 'malaya': 29, 'wilayah': 30, 'persekutuan': 31, 's': 32, 'sad': 33, 'attendance': 34, 'value': 35, 'bot':
36, 'later': 37, 'yes': 38, 'bad': 39, 'jalan': 40, 'hello': 41, 'please': 42, 'do': 43, 'where': 44, 'passport': 45, 'number': 46, 'gmailcom': 47, 'hi': 48, 'day': 49, 'great': 50, 'very
': 51, 'call': 52, 'vision': 53, 'for': 54, 'goal': 55, 'about': 56, 'here': 57, 'ismail': 58, 'binti': 59, 'matric': 60, 'hey': 61, 'there': 62, 'see': 63, 'your': 64, 'get': 65, 'thanks
': 66, 'nt': 67, 'perfect': 68, 'are': 69, 'should': 70, 'want': 71, 'request': 72, 'report': 73, 'student': 74, 'dont': 75, 'it': 76, 'email': 77, 'yahoocom': 78, 'afternoon': 79, 'fsktm
': 80, 'talk': 81, 'nope': 82, 'that': 83, 'sure': 84, 'yup': 85, 'pls': 86, 'like': 87, 'amazing': 88, 'feeling': 89, 'super': 90, 'well': 91, 'in': 92, 'mood': 93, 'human': 94, 'talking
': 95, 'u': 96, 'and': 97, 'aim': 98, 'tell': 99, 'uni': 100, 'show': 101, 'loc': 102, 'send': 103, '2': 104, 'letters': 105, 'status': 106, 'stop': 107, 'changed': 108, 'mind': 109, 'eno
ugh': 110, 'cancel': 111, 'maral': 112, 'sarah': 113, 'bader': 114, 'this': 115, 'bin': 116, 'min': 117, 'ahmed': 118, 'they': 119, 'full': 120, 'pass': 121, 'ic': 122, 'be': 123, 'johor'
: 124, '50250': 125, 'sultan': 126, '12': 127, 'morning': 128, 'evening': 129, 'moin': 130, 'let': 131, 'go': 132, 'goodmorning': 133, 'goodevening': 134, 'hy': 135, 'fast': 136, 'up': 13
7, 'friend': 138, 'chatbot': 139, 'hiii': 140, 'helo': 141, 'halo': 142, 'watsup': 143, 'cu': 144, 'by': 145, 'cee': 146, 'night': 147, 'goodbye': 148, 'have': 149, 'around': 150, 'back':
 151, 'ask': 152, 'forever': 153, 'y': 154, 'indeed': 155, 'course': 156, 'sounds': 157, 'correct': 158, 'definitely': 159, 'yess': 160, 'yea': 161, 'ye': 162, 'yeh': 163, 'surely': 164,
'extermly': 165, '100': 166, 'percent': 167, 'lot': 168, 'much': 169, 'n': 170, 'never': 171, 'think': 172, 'way': 173, 'really': 174, 'nah': 175, 'king': 176, 'wonderful': 177, 'going':
178, 'save': 179, 'world': 180, 'stoked': 181, 'extremely': 182, 'all': 183, 'was': 184, 'horrible': 185, 'feel': 186, 'disappointed': 187, 'm': 188, 'unhappy': 189, 'extremly': 190, 'saa
d': 191, 'upset': 192, 'had': 193, 'mad': 194, 'who': 195, 'made': 196, 'shoul': 197, 'can': 198, 'ypur': 199, 'job': 200, 'knowledge': 201, 'aming': 202, 'univercity': 203, 'does': 204,
'doing': 205, 'how': 206, 'far': 207, 'located': 208, 'location': 209, 'map': 210, 'umiversity': 211, 'an': 212, 'provide': 213, 'two': 214, 'any': 215, 'more': 216, 'pause': 217, 'anymor
e': 218, 'done': 219, 'reject': 220, 'bahari': 221, 'sasani': 222, 'complete': 223, 'ba': 224, 'sowid': 225, 'fariba': 226, 'kalsia': 227, 'ali': 228, 'abassi': 229, 'fakher': 230, 'din':
 231, 'jack': 232, 'ong': 233, 'fullname': 234, 'roksana': 235, 'samira': 236, 'hossein': 237, 'baha': 238, 'tashfia': 239, 'shamim': 240, 'erfan': 241, 'shahreeza': 242, 'fatih': 243, 'd
avood': 244, 'jashoa': 245, 'migash': 246, 'dini': 247, 'bal': 248, 'makail': 249, 'izza': 250, 'rafi': 251, 'hako': 252, 'darani': 253, 'media': 254, 'jamalian': 255, 'mahnaz': 256, 'kam
ila': 257, 'soheil': 258, 'ang': 259, 'sara': 260, 'farooki': 261, 'kamil': 262, 'farahani': 263, 'asil': 264, 'fati': 265, 'mohmed': 266, 'saleh': 267, 'saman': 268, 'ahadi': 269, 'lee':
 270, 'hoo': 271, 'ksia': 272, 'wga': 273, 'ska': 274, 'kim': 275, 'hio': 276, 'ji': 277, 'famih': 278, 'aksia': 279, 'da': 280, 'ajs': 281, 'jemini': 282, 'silams': 283, 't02381723': 284
, '122939222': 285, 'vs1394342': 286, '2392106': 287, 'tk328u4211': 288, 'pk18271602': 289, 'k118271201': 290, '192716292121': 291, 'l12991327': 292, '102971351': 293, '374661637': 294, '
29323203': 295, '102172891': 296, '19282637261': 297, 'lks817272721': 298, '292773291929': 299, 'malaysian': 300, 'id': 301, '192830284726': 302, '927371742812': 303, '1193736473': 304, '
271530213816': 305, 'nj19287427': 306, 'q111804232': 307, '236252464827': 308, '162419151537': 309, '192301488361': 310, '9b': 311, 'abdul': 312, 'samad': 313, 'kolam': 314, 'ayer': 315,
'80100': 316, 'bahru': 317, 'alan': 318, 'perubatan': 319, '1': 320, 'pandan': 321, 'indah': 322, '55100': 323, '50350': 324, 'ampang': 325, 'mcity': 326, '55000': 327, 'amra': 328, 'sent
ul': 329, 'selatan': 330, '51000': 331, 'addres': 332, '20th': 333, 'floor': 334, 'menara': 335, 'ta': 336, 'one': 337, '22': 338, 'p': 339, 'ramlee': 340, '972': 341, 'azlan': 342, 'shah
': 343, 'batu': 344, '6': 345, '68100': 346, 'vortex': 347, 'klcc': 348, 'jln': 349, 'lorong': 350, 'universiti': 351, '50603': 352, 'federal': 353, 'territory': 354, 'hospital': 355, '93
586': 356, 'kuching': 357, 'sarawak': 358, 'djuna29': 359, 'wid180729': 360, 'siswaumedumy': 361, 'firda': 362, 'linda182': 363, 'dualipa': 364, 'maralbahari75': 365, 'badrbasowid98': 366
, '171999741': 367, '200574712': 368, '181772481': 369, '121467892': 370, '500211961': 371, '200724291': 372, '938726151': 373}
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\utils\train_utils.py:560: UserWarning: constrain_similarities is set to `False`. It is recommended to set it to `True` when u
sing cross-entropy loss.
  category=UserWarning,
NLU model loaded. Type a message and press enter to parse it.
Next message:
hello
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: message:hello
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: message_trans:[[41]]
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: message_padded:[[41  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0]]
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: predict_proba[[1.11175480e-09 5.59629232e-10 3.71970788e-11 9.58058285e-13
  1.34879531e-06 9.99998569e-01 2.16610410e-12 2.41970940e-13
  4.42200165e-10 7.48617314e-12 2.34549251e-08 1.46821119e-12
  4.63247359e-15 4.88799632e-16 1.44136925e-11 5.67392921e-12]]
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: sorted_indicies_type:[[ 5  4 10  0  1  8  2 14  9 15  6 11  3  7 12 13]]
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: intent_ids:[[ 5  4 10  0  1  8  2 14  9 15  6 11  3  7 12 13]]
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: intents:['greet' 'goodbye' 'name' 'affirm' 'challenge' 'location' 'deny' 'unhappy'
 'matricno' 'university' 'happy' 'passportno' 'emailaddress'
 'letteraddress' 'requestletters' 'stop']
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: flatten prob:[9.99998569e-01 1.34879531e-06 2.34549251e-08 1.11175480e-09
 5.59629232e-10 4.42200165e-10 3.71970788e-11 1.44136925e-11
 7.48617314e-12 5.67392921e-12 2.16610410e-12 1.46821119e-12
 9.58058285e-13 2.41970940e-13 4.63247359e-15 4.88799632e-16]
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: ranking:[{'name': 'greet', 'confidence': 0.99999857}, {'name': 'goodbye', 'confidence': 1
.3487953e-06}, {'name': 'name', 'confidence': 2.3454925e-08}, {'name': 'affirm', 'confidence': 1.1117548e-09}, {'name': 'challenge', 'confidence': 5.5962923e-10}, {'name': 'location', 'co
nfidence': 4.4220017e-10}, {'name': 'deny', 'confidence': 3.719708e-11}, {'name': 'unhappy', 'confidence': 1.44136925e-11}, {'name': 'matricno', 'confidence': 7.486173e-12}, {'name': 'uni
versity', 'confidence': 5.673929e-12}]
C:\Users\maral\anaconda3\envs\FSKTMBot\lib\site-packages\rasa\shared\utils\io.py:99: UserWarning: message_type:<class 'rasa.shared.nlu.training_data.message.Message'>
{
  "text": "hello",
  "intent": {
    "name": "greet",
    "confidence": 0.9999499320983887
  },
  "entities": [
    {
      "entity": "passport_number",
      "start": 0,
      "end": 5,
      "value": "hello",
      "extractor": "RegexEntityExtractor"
    }
  ],
  "text_tokens": [
    [
      0,
      5
    ]
  ],
  "intent_ranking": [
    {
      "name": "greet",
      "confidence": 0.9999499320983887
    },
    {
      "name": "name",
      "confidence": 2.344199310755357e-05
    },
    {
      "name": "affirm",
      "confidence": 9.562681043462362e-06
    },
    {
      "name": "emailaddress",
      "confidence": 8.964624612417538e-06
    },
    {
      "name": "university",
      "confidence": 3.914005901606288e-06
    },
    {
      "name": "matricno",
      "confidence": 2.2906265257915948e-06
    },
    {
      "name": "stop",
      "confidence": 8.021576149985776e-07
    },
    {
      "name": "requestletters",
      "confidence": 3.3519205544507713e-07
    },
    {
      "name": "letteraddress",
      "confidence": 2.942831542895874e-07
    },
    {
      "name": "challenge",
      "confidence": 2.0830677271987952e-07
    }
  ]
}
Next message:

in this sample of rasa shell nlu I added warning just for myself to debug my classifier

It seems before dumping the data in the tracker store, it is being serialized

when tracker store tries to save, it first serialises the dialogue data.

you can try to debug the above line. i feel there must be some value in the dialogue that it is not able to serialize and thus throws off an error.

object not json serializable happens when you try json.dumps and since yours is coming from the tracker store, this feels like the right place to start

1 Like

thanks for your reply. I have fixed the problem by changing the probabilities of each intent ranking type to float64 and it is working fine.

1 Like

now I have another problem… do you know how can I add my custom component with along with rasa image. I am trying to run the chatbot with docker now. using Dockerfile and docker-compose my files are as below: my Dockerfile

FROM rasa/rasa-sdk:3.0.0

WORKDIR /app

COPY actions/requirements.txt ./

COPY actions/service_key.json ./

USER root

COPY ./actions /app/actions
COPY ./endpoints.yml /app/

CMD ["run","actions"]

RUN pip install -r requirements.txt

EXPOSE 5055

ENTRYPOINT ["./entrypoint.sh"]

USER 1000


FROM rasa/rasa:3.0.3-full

WORKDIR /app

COPY wordEmbeddingClassifier/requirements.txt ./

USER root

ENV PYTHONPATH "${PYTHONPATH}:/app/wordEmbeddingClassifier/keras_embedding_intent_classifier"

RUN pip install -r requirements.txt

EXPOSE 5005

USER 1000

my docker-compose file:

version: "3.9"
services:
  rasa:
    image: rasa/rasa:3.0.3-full
    ports:
    - "5005:5005"
    volumes:
    - ./:/app
    - ./wordEmbeddingClassifier/keras_embedding_intent_classifier:/app/keras_embedding_intent_classifier
    command:
      - shell
      - --debug
    depends_on:
      - action_server
  action_server:
    image: rasa/rasa-sdk:3.0.0
    volumes:
    -  ./actions:/app/actions
    ports:
      - "5055:5055"
  duckling:
    image: rasa/duckling:latest
    ports:
    - "8000:8000"