How to use HuggingFace Language Models in Pipeline

I want to use HuggingFace language models in my pipeline how can I add to my pipeline and how to use them. I want my bot in Multilingual (English-Arabic) switch automatically instead of manually adding (Intents and Responses).I have heard that (HFT) have a langugage model which support Arabic. I don’t know how to use that.

SpaCy and MITIE didn’t support Arabic. Here is my project what I did to make changes.

version: "2.0"


- intent: greet

  examples: |

    - hey

    - hello

    - hi

    - hello there

    - good morning

    - good evening

    - moin

    - hey there

    - let's go

    - hey dude

    - goodmorning

    - goodevening

    - good afternoon 


# Configuration for Rasa NLU.


language: en


# # 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 for more information.

   - name: HFTransformersNLP

     model_name: "bert"

     model_weights: "rasa/LaBSE"

     cache_dir: null

   - name: "LanguageModelTokenizer"

    "intent_tokenization_flag": False

    "intent_split_symbol": "_"

   - name: DIETClassifier

      epochs: 100

      constrain_similarities: true

    - name: EntitySynonymMapper

    - name: ResponseSelector

      epochs: 100

      constrain_similarities: true

    - name: FallbackClassifier

      threshold: 0.3

      ambiguity_threshold: 0.1

# Configuration for Rasa Core.



# # 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 for more information.

#   - name: MemoizationPolicy

#   - name: RulePolicy

#   - name: UnexpecTEDIntentPolicy

#     max_history: 5

#     epochs: 100

#   - name: TEDPolicy

#     max_history: 5

#     epochs: 100

#     constrain_similarities: true

After running (rasa shell)

  Bot loaded. Type a message and press enter (use '/stop' to exit): 
    Your input ->  hi                                                                                                                                                  
    D:\Anaconda3\envs\bot\lib\site-packages\rasa\shared\utils\ UserWarning: Interpreter parsed an intent 'hi' which is not defined in the domain. Please make 
    sure all intents are listed in the domain.
      More info at
    2021-08-20 11:37:51 ERROR    asyncio  - Task exception was never retrieved
    future: <Task finished name='Task-2' coro=<configure_app.<locals>.run_cmdline_io() done, defined at D:\Anaconda3\envs\bot\lib\site-packages\rasa\core\> exception=TimeoutError()>
    Traceback (most recent call last):
      File "D:\Anaconda3\envs\bot\lib\site-packages\rasa\core\", line 135, in run_cmdline_io
        await console.record_messages(
      File "D:\Anaconda3\envs\bot\lib\site-packages\rasa\core\channels\", line 182, in record_messages
        async for response in bot_responses:
      File "D:\Anaconda3\envs\bot\lib\site-packages\rasa\core\channels\", line 137, in _send_message_receive_stream
        async for line in resp.content:
      File "D:\Anaconda3\envs\bot\lib\site-packages\aiohttp\", line 39, in __anext__
        rv = await self.read_func()
      File "D:\Anaconda3\envs\bot\lib\site-packages\aiohttp\", line 338, in readline
        await self._wait("readline")
      File "D:\Anaconda3\envs\bot\lib\site-packages\aiohttp\", line 306, in _wait
        await waiter
      File "D:\Anaconda3\envs\bot\lib\site-packages\aiohttp\", line 656, in __exit__
        raise asyncio.TimeoutError from None

You can look the LanguageModelFeaturizer which used transformers

Will you give me a better Idea to how to use these in NLU pipeline. I mean I am new to this.

Maybe this video can help you.

Thank You , for giving me idea.