Augmenting Text for Specialist Domains
This lesson explains how domain-specific augmentation creates more useful training text in fields such as law, medicine and finance while preserving the meaning of domain terms.
Learning outcomes
After completing this lesson, you will be able to:
- Apply augmentation techniques such as back-translation and FM paraphrasing.
- Keep augmented data trustworthy.
- Decide when domain adaptation beyond augmentation is needed.
Augmentation techniques
Synonym replacement swaps words for synonyms, but general thesauri can damage domain terms ("discharge" means something different in medicine and law), so use a domain glossary and protect key terms. Back-translation translates text into another language and back with Amazon Translate, producing natural paraphrases; custom terminology in Translate keeps domain terms unchanged. FM paraphrasing asks a model on Amazon Bedrock to rewrite examples in different styles or to generate new examples for rare classes from a description and a few seeds. Entity substitution swaps names, products or amounts with other valid values to vary examples without changing their label.
Augmentation techniques
Keeping augmented data trustworthy
Augmented text can change meaning or even the correct label, for example a paraphrase that reverses the sentiment of a review. A sample of augmented data should therefore be validated, by expert review or with a classifier trained on real data. Generated text that is too similar to the original adds little, and text that drifts off-topic adds noise, so both are filtered out.
Synthetic examples should be tracked, so their effect can be measured and they can be removed if they cause problems, and they must never be placed in the test set, which must reflect real data. Synthetic data generated by a foundation model must also respect the model provider's terms of use, some of which restrict using outputs to train other models.
The following table summarises the techniques.
| Technique | AWS support | Risk to manage |
|---|---|---|
| Synonym replacement with glossary | Custom code, domain glossary | Changing domain meaning |
| Back-translation | Amazon Translate with custom terminology | Mistranslated domain terms |
| FM paraphrasing and generation | Amazon Bedrock | Hallucinated or wrong labels |
| Entity substitution | Comprehend entities plus lists | Unrealistic combinations |
The following diagram shows the steps used to augment a set of only 150 training examples for a rare claim type.

Trust the synthetic examples
Domain adaptation beyond augmentation
When the model's vocabulary is the problem rather than the number of examples, consider a domain pre-trained model from SageMaker JumpStart, continued pre-training on domain text (covered in the next module), or, for FMs, adding definitions of domain terms to prompts and RAG context.
Beyond augmentation
Rare insurance claim types
A claims classifier has 20,000 examples, but only 150 for "subrogation" claims, a legal term. The model rarely predicts this class.
- Back-translate the 150 examples through French and German with Amazon Translate, using a custom terminology file that keeps "subrogation" and policy codes unchanged.
- Ask a Bedrock model to write 300 new claim descriptions from anonymised seed examples, then have adjusters review a 10% sample.
- Tag all synthetic examples and keep the test set entirely real.
Recall on subrogation claims rises because the model now sees varied phrasings. Using a general synonym tool would have replaced "subrogation" with unrelated words and corrupted the label.
How can paraphrases be created with Amazon Translate?
Show answer
By back-translation: translating text into another language and back.
Exam Tips
Remember for the exam
- Protect domain terms during augmentation with glossaries or custom terminology.
- Back-translation with Amazon Translate creates natural paraphrases.
- Bedrock models can generate synthetic examples for rare classes.
- Review samples of synthetic data and keep the test set real.
- Vocabulary gaps may need domain models or continued pre-training instead.