# Manually replace part of translation

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmanually-replace-part-of-translation%2F20550%3E%5C
**Category:** Beginners\
**Created:** [July 19, 2022, 3:45am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmanually-replace-part-of-translation%2F20550 "2022-07-19T03:45:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![revantemp3](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@revantemp3](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Frevantemp3)%5C
**Post date:** [July 19, 2022, 3:45am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmanually-replace-part-of-translation%2F20550%2F1 "2022-07-19T03:45:47Z")

</div>

Hi,

I am using [this model](https://huggingface.co/facebook/m2m100_418M) for translation task.

My corpus has a lot of numbers and they eat up the 128 tokens per sentence limitation pretty quickly. I want to handle the number translation by a separate function, and let the transformer handle the main text, using this procedure:

Step 1: Suppose the original sentence is “I have five chickens”  
Step 2: Replace the number “five” with a special token. Here I use ℑ to represent the special token  
Step 3: Translate the sentence with Transformer  
I have ℑ chickens → j’ai ℑ poules  
Step 4: Special function translate “five” to “cinq”  
Step 5: Insert “cinq” back to the special token ℑ and get back j’ai cinq poules

I tried to do this in the model, but the special token just disappear in the final translation

i.e., in step 3, instead of getting j’ai ℑ poules, I get j’ai poules

Please help, thanks.  
R T
