[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[],[],null,["# Custom translations overview\n============================\n\nThe default Google Neural Machine Translation (NMT) model covers a wide range of\nlanguages and works well for general-purpose text. However, in cases where\nyou're translating domain-specific or style-sensitive text, custom translations\ncan help you get more relevant translations.\n\nCustom translations require you to provide your own example translations. Then,\nCloud Translation can generate results that closely follow the style, tone,\nand vocabulary of your examples.\n\nCloud Translation provides two solutions for requesting custom\ntranslations: AutoML Translation for training custom models or\nadaptive translation to leverage Google's large-language models (LLMs). Each\nfeature has its own data requirements, set of supported languages, and pricing.\n\nAutoML Translation\n------------------\n\nWith AutoML Translation, you import your data to train custom models that\nyou own and maintain. After building a custom model, you can then request\ntranslations that use your model instead of the default NMT model. Compared to\nadaptive translation, custom models work well for domain-specific text where\ngetting the correct terminology is your highest priority. You are also required\nto provide larger datasets for model training.\n\nYou are charged on the model training time and the number of input characters\nthat you send for translations.\n\nAdaptive translation\n--------------------\n\nAdaptive translations use LLMs combined with small datasets to provide\nhigh-quality translations, often on par with AutoML Translation custom\nmodels. You don't train or maintain any models. Compared to custom models,\nadaptive translation works well for getting responses that are similar in style,\ntone, and voice with your input.\n\nFor adaptive translation, you are charged on the number of input and output\ncharacters.\n\nPrepare example translations\n----------------------------\n\nPrepare example translations as segment pairs, which consists of one sentence in\na source language and a corresponding sentence that's translated in the\ntarget language. Save these segment pairs in a tab-separated values (TSV) file\nor Translation Memory eXchange (TMX) file.\n\nChoose examples that represent the linguistic domain of the content that you\nplan to translation. For additional guidance, see the [Data\npreparation](/translate/docs/advanced/automl-beginner#data-preparation) section in the AutoML Translation beginner's\nguide. \n\n### TSV\n\nFor tab-separated files, each row has the following format:\n\n- `Source segment` *tab* `Translated segment`\n\nDon't include a header row with language codes to identify the source and\ntarget languages. You specify these languages when you create a dataset.\nThe following example includes segment pairs for English to German\ntranslations: \n\n```\nIt's a beautiful day.\\tEs ist ein schöner Tag.\nTomorrow it will rain.\\tMorgen wird es regnen.\n```\n\nAll content in a TSV file must be plain text. If the text includes HTML tags or\nother markup, Cloud Translation treats the markup as plain text.\n\n### TMX\n\nTMX is a standard XML format for providing source and target translation\nsegments. Cloud Translation supports input files in a format based on\n[TMX version 1.4](https://www.gala-global.org/lisa-oscar-standards). The following example illustrates the\nrequired structure: \n\n```\n\u003c?xml version='1.0' encoding='utf-8'?\u003e\n\u003c!DOCTYPE tmx SYSTEM \"tmx14.dtd\"\u003e\n\u003ctmx version=\"1.4\"\u003e\n \u003cheader segtype=\"sentence\" o-tmf=\"UTF-8\"\n adminlang=\"en\" srclang=\"en\" datatype=\"PlainText\"/\u003e\n \u003cbody\u003e\n \u003ctu\u003e\n \u003ctuv xml:lang=\"en\"\u003e\n \u003cseg\u003eIt's a beautiful day.\u003c/seg\u003e\n \u003c/tuv\u003e\n \u003ctuv xml:lang=\"de\"\u003e\n \u003cseg\u003eEs ist ein schöner Tag.\u003c/seg\u003e\n \u003c/tuv\u003e\n \u003c/tu\u003e\n \u003ctu\u003e\n \u003ctuv xml:lang=\"en\"\u003e\n \u003cseg\u003eTomorrow it will rain.\u003c/seg\u003e\n \u003c/tuv\u003e\n \u003ctuv xml:lang=\"de\"\u003e\n \u003cseg\u003eMorgen wird es regnen.\u003c/seg\u003e\n \u003c/tuv\u003e\n \u003c/tu\u003e\n \u003c/body\u003e\n\u003c/tmx\u003e\n```\n\nThe `\u003cheader\u003e` element of a well-formed TMX file must identify\nthe source language by using the `srclang` attribute, and every\n`\u003ctuv\u003e` element must identify the language of the contained\ntext using the `xml:lang` attribute.\n\nAll `\u003ctu\u003e` elements must contain a pair of\n`\u003ctuv\u003e` elements with the same source and target languages. If\na `\u003ctu\u003e` element contains more than two `\u003ctuv\u003e`\nelements, Cloud Translation processes only the first\n`\u003ctuv\u003e` matching the source language and the first matching\nthe target language and ignores the rest. If a `\u003ctu\u003e` element\ndoes not have a matching pair of `\u003ctuv\u003e` elements,\nCloud Translation skips over the invalid `\u003ctu\u003e` element.\n\nCloud Translation strips the markup tags from around a\n`\u003cseg\u003e` element before processing it. If a\n`\u003ctuv\u003e` element contains more than one `\u003cseg\u003e`\nelement, Cloud Translation concatenates their text into a single\nelement with a space between them.\n\nIf the file contains XML tags other than those shown earlier,\nCloud Translation ignores them.\n\nIf the file does not conform to proper XML and TMX format -- for\nexample, if it is missing an end tag or a `\u003ctmx\u003e` element\n-- Cloud Translation aborts processing it. Cloud Translation\nalso aborts processing if it skips more than 1024 invalid\n`\u003ctu\u003e` elements.\n\nThe minimum required and maximum allowed number segment pairs for each feature\nis different. For more information, see the [AutoML Translation data\npreparation](/translate/docs/advanced/automl-prepare) or [adaptive translation data\nrequirements](/translate/docs/advanced/adaptive-translation#data_requirements_and_suggestions).\n\nWhat's next\n-----------\n\n- For more information about each feature, see [AutoML Translation\n overview](/translate/docs/advanced/automl-beginner) or [Adaptive translation](/translate/docs/advanced/adaptive-translation).\n- For language support, see [Supported languages](/translate/docs/languages).\n- For pricing details, see [Cloud Translation pricing](/translate/pricing)."]]