# Custom domain specific training text-to-text

**URL:** <https://discuss.huggingface.co/t/custom-domain-specific-training-text-to-text/33609>\
**Category:** Beginners\
**Created:** [March 11, 2023, 11:58pm UTC](https://discuss.huggingface.co/t/custom-domain-specific-training-text-to-text/33609 "2023-03-11T23:58:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thinkcru](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/thinkcru/32/13469_2.png) [@Thinkcru](https://discuss.huggingface.co/u/Thinkcru)\
**Post date:** [March 11, 2023, 11:58pm UTC](https://discuss.huggingface.co/t/custom-domain-specific-training-text-to-text/33609/1 "2023-03-11T23:58:48Z")

</div>

Hell Hugginface exerts,

I am trying to solve a very specific domain problem. I have a project where I must take input text that contains domain specific codes in the text and translate it to a specific output.

I am using `ABC` and `FOO` to just convey the basic idea here, because I do not want to distract with problem statement. However, my domain is _electrical engineering_ data. There will be words like: `Port`, `VSS`, `GND`, `CHA`, etc. I have a PDF document specification that explains these words, do you think I need to throw this into the fine-tuning flow?

In this example, I have an input text, and what I am showing you is the output result that I am trying to produce from the model. This example shows `input text` → `output result I want`, for example:  
`! Port[1] = ABCZ4_FOO1` -model-\> `ABC_c_FOO1`  
or  
`! Port[4] = ABC4_FOO1` -model-\> `ABC_t_FOO1`

There are many variations of this input text, where in some cases it would be `ABC3` instead of `ABCZ4`, so in this case the input/output would be:  
`! Port[1] = ABC3_FOO1` -model-\> `ABC_c_FOO1`

What I am trying to figure out is what would be the best model transformer, base mode model and then training task. Should I use translation, masking, or something else?

You can see that the input has individual character input tokens, and the sequence of characters gives more context. My instincts is that a **transformer** makes sense here because “attention” is needed on the specific character tokens to be _translated_ to an output.

Here is a snapshot of a completed table of input/output. You could imagine that I am going to use this data to train the model. There is a ton of variations of possibilities of the input tokens that could be provided with different text. BTW, I have about 700 training input/output samples. Do you think this would be enough or would I need generate more?

 ![image](https://us1.discourse-cdn.com/hellohellohello/original/2X/9/9a9aea2fb3bce4298659cd71851179bfadb31cbe.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![dblakely](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dblakely](https://discuss.huggingface.co/u/dblakely)\
**Post date:** [March 14, 2023, 7:09pm UTC](https://discuss.huggingface.co/t/custom-domain-specific-training-text-to-text/33609/2 "2023-03-14T19:09:59Z")

</div>

Just to start, are you positive that the problem can’t be solved with traditional code (e.g., using regexes)? The examples you posted look like they have a sufficiently simple pattern that AI isn’t needed.

---

<div class="post-metadata">

**Author:** ![Thinkcru](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/thinkcru/32/13469_2.png) [@Thinkcru](https://discuss.huggingface.co/u/Thinkcru)\
**Post date:** [March 14, 2023, 11:15pm UTC](https://discuss.huggingface.co/t/custom-domain-specific-training-text-to-text/33609/3 "2023-03-14T23:15:33Z")

</div>

Thanks @dblakely,

Yes I’m sure we will not be able to edit regent. There are so many variations that users can input that I could not put it all in the example. It is something we will really have to develop a model for. Do you have any ideas?

---

<div class="post-metadata">

**Author:** ![randmodel77](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@randmodel77](https://discuss.huggingface.co/u/randmodel77)\
**Post date:** [June 15, 2023, 10:28pm UTC](https://discuss.huggingface.co/t/custom-domain-specific-training-text-to-text/33609/4 "2023-06-15T22:28:00Z")

</div>

Just bumping this thread, I’m curious of the possible solutions to this.
