# Using Custom SpaCy model

**URL:** <https://forum.rasa.com/t/using-custom-spacy-model/24024>\
**Category:** Rasa Open Source\
**Created:** [January 27, 2020, 3:58pm UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024 "2020-01-27T15:58:34Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![taimoor-ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/taimoor-ahmed/32/4108_2.png) [@taimoor-ahmed](https://forum.rasa.com/u/taimoor-ahmed)\
**Post date:** [January 27, 2020, 3:58pm UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/1 "2020-01-27T15:58:34Z")

</div>

Hi, I was developing a chatbot in Urdu language and I wanted to know if there is an existing pipeline that I could use for Urdu language. Moreover, I found a custom SpaCy model, could that be used for training my chatbot? Thank you in advance.

---

<div class="post-metadata">

**Author:** ![mloubser](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mloubser/32/13021_2.png) [@mloubser](https://forum.rasa.com/u/mloubser)\
**Post date:** [January 27, 2020, 5:26pm UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/2 "2020-01-27T17:26:02Z")

</div>

Check out [Language Support](https://rasa.com/docs/rasa/nlu/language-support/) for info on adding a custom spaCy model and linking it to the language code. Once you have done that you could use the `pretrained_embeddings_spacy` pipeline which would look like:

```auto
language: ur
pipeline: pretrained_embeddings_spacy

```

in your config file.

---

<div class="post-metadata">

**Author:** ![taimoor-ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/taimoor-ahmed/32/4108_2.png) [@taimoor-ahmed](https://forum.rasa.com/u/taimoor-ahmed)\
**Post date:** [January 28, 2020, 3:13am UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/3 "2020-01-28T03:13:33Z")

</div>

Hi @mloubser thanks for helping me out. I’ve set these in the config file now but I have another issue regarding linking the model. The first command I ran was:

> pip install dist/ur\_model-0.0.0.tar.gz

Then, when I try to link the SpaCy model (ur-model-0.0.0.tar.gz) from terminal using the command

> python -m spacy link ur-model ur

I get the error: Could not load model data Can you help me out on this? Any help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![mloubser](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/mloubser/32/13021_2.png) [@mloubser](https://forum.rasa.com/u/mloubser)\
**Post date:** [January 28, 2020, 2:13pm UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/4 "2020-01-28T14:13:11Z")

</div>

Sounds like an issue with your custom model - you’ll probably find better info on spaCy’s docs & github, since this is unrelated to rasa.

---

<div class="post-metadata">

**Author:** ![Talhag958](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/talhag958/32/8968_2.png) [@Talhag958](https://forum.rasa.com/u/Talhag958)\
**Post date:** [April 20, 2020, 5:42pm UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/5 "2020-04-20T17:42:49Z")

</div>

@taimoor-ahmed Are you done with Urdu bot? Can you help me with that. I am creating a bot too and its urgent.

---

<div class="post-metadata">

**Author:** ![taimoor-ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/taimoor-ahmed/32/4108_2.png) [@taimoor-ahmed](https://forum.rasa.com/u/taimoor-ahmed)\
**Post date:** [April 20, 2020, 8:34pm UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/6 "2020-04-20T20:34:24Z")

</div>

Yes, it’s still in development but I have developed a prototype. What do you need help with?

---

<div class="post-metadata">

**Author:** ![Talhag958](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/talhag958/32/8968_2.png) [@Talhag958](https://forum.rasa.com/u/Talhag958)\
**Post date:** [April 21, 2020, 6:59am UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/7 "2020-04-21T06:59:13Z")

</div>

Dear can you plz share the sample of prototype. It will be very gratefull of you. I have the model you mentioned earlier in the post but i am not able to connect it to rasa. Secondly how you use slot filling for Urdu.

---

<div class="post-metadata">

**Author:** ![taimoor-ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/taimoor-ahmed/32/4108_2.png) [@taimoor-ahmed](https://forum.rasa.com/u/taimoor-ahmed)\
**Post date:** [April 21, 2020, 10:02am UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/8 "2020-04-21T10:02:37Z")

</div>

@Talhag958 I didn’t end up using the SpaCy model for Urdu because I was unable to integrate it in RASA. Here is my config.yml file which I am using.

# Configuration for Rasa NLU.

# [Components](https://rasa.com/docs/rasa/nlu/components/)

language: ur

pipeline:

- 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

policies:

- name: MemoizationPolicy
- name: KerasPolicy
- name: MappingPolicy
- name: FormPolicy

---

<div class="post-metadata">

**Author:** ![Talhag958](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/talhag958/32/8968_2.png) [@Talhag958](https://forum.rasa.com/u/Talhag958)\
**Post date:** [April 21, 2020, 10:06am UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/9 "2020-04-21T10:06:46Z")

</div>

Dear are your slots working??

---

<div class="post-metadata">

**Author:** ![taimoor-ahmed](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/taimoor-ahmed/32/4108_2.png) [@taimoor-ahmed](https://forum.rasa.com/u/taimoor-ahmed)\
**Post date:** [April 25, 2020, 6:48pm UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/10 "2020-04-25T18:48:59Z")

</div>

They do not work for most times. Did you get them to work ?

---

<div class="post-metadata">

**Author:** ![Talhag958](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/talhag958/32/8968_2.png) [@Talhag958](https://forum.rasa.com/u/Talhag958)\
**Post date:** [May 3, 2020, 8:10pm UTC](https://forum.rasa.com/t/using-custom-spacy-model/24024/11 "2020-05-03T20:10:17Z")

</div>

@mirfan899 has done marvelous job. Here is link of repository for urdu bot.

> **[GitHub - mirfan899/ubot: Code of tutorial...](https://github.com/mirfan899/ubot)**
>
> Code of tutorial https://www.urdunlp.com/2020/04/building-conversational-chat-bot-for.html - GitHub - mirfan899/ubot: Code of tutorial https://www.urdunlp.com/2020/04/building-conversational-chat-b...
