Add 2 languages in config

Hi all i’m trying to add two languages in same model in config (english and greek) my config is:

# Configuration for English pipeline
language: en
pipeline:
  - name: SpacyNLP_en
    model: en_core_web_md
  - name: SpacyTokenizer
  - name: SpacyFeaturizer
  - name: RegexFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
  - name: EntitySynonymMapper
  - name: ResponseSelector
    epochs: 50
policies:
  - name: MemoizationPolicy
  - name: TEDPolicy
    max_history: 5
    epochs: 100
  - name: MappingPolicy

# Separator
---

# Configuration for Greek pipeline
language: el
pipeline:
  - name: SpacyNLP_el
    model: el_core_news_sm
  - name: SpacyTokenizer
  - name: SpacyFeaturizer
  - name: RegexFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
  - name: EntitySynonymMapper
  - name: ResponseSelector
    epochs: 50
policies:
  - name: MemoizationPolicy
  - name: TEDPolicy
    max_history: 5
    epochs: 100
  - name: MappingPolicy

but i get an error of invalid yaml file

what’s the issue here?

thanks

Hi there,

Rasa doesn’t support having multiple languages inside of the same config file.

If you want to implement a multilingual bot you could refer to What is the best way to create a multilingual chatbot?

There are multiple ways to tackle this problem. Recently I had a client that wanted both multilingual input and output. For that use case, I used a language agnostic config file (no language specific models even though I’ve stated that the config language is english), Rasa’s LabSE rasa/LaBSE · Hugging Face for featurization, defined custom components to account for language specifics (for example, a custom component for wrapping duckling so multiple languages could be processed), etc. For the response part, you could use NLG server or overwrite the default implementation of CollectingDispatcher, as I did, and do all the required translations in there :slight_smile:

However, if I were you, I’d experiment with NLG, it looks like a neater solution from my perspective now.

Regards, Nikola