会話型アクションのサポートは 2023 年 6 月 13 日に終了しました。詳細については、
会話型アクションの廃止をご覧ください。
アクションをローカライズする
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アクションには会話インターフェースが用意されているため、Actions プロジェクトをローカライズする場合は、平均的な開発プロジェクトよりも多くの考慮事項があります。アクションの多くのコンポーネントは、設定、リソース、インテント、タイプ、プロンプトなど、翻訳を必要とします。
アクションの一部のコンポーネントでは、会話インターフェースがターゲット言語で確実に動作するように、特別な注意が必要です。たとえば、インテントの呼び出しに使用するトレーニング フレーズは、デフォルトの言語で作成したフレーズを単にターゲット言語に翻訳するのではなく、ターゲット言語のネイティブ スピーカーと協議して作成する必要があります。
Actions Builder と Actions SDK はどちらも、アクションのローカライズをサポートしています。アクション プロジェクトをローカライズする場合、ローカライズが必要なのは、プロジェクト設定/リソースと会話コンポーネントの 2 つのエンティティ グループがあります。
プロジェクトの設定とリソース
プロジェクトの設定には、アクションのディレクトリ リストに表示される情報(アクションの機能の簡単な説明と長い説明など)が含まれます。
リソースとは、ローカライズが必要な画像、音声ファイル、その他のプロジェクト文字列のことです。たとえば、プロンプトで使用されるロゴ画像や録音音声などです。
プロジェクトの設定とリソースのローカライズは、元のロケールから新しいロケールへの設定/リソースの翻訳版を用意するだけで済みます。
会話の構成要素
会話コンポーネントのローカライズは、既存のコンテンツの翻訳を提供するだけとは異なります。他の言語 / 地域向けに会話をローカライズする主な目的は、自然で直感的に感じられる会話エクスペリエンス(その言語 / 地域の特定のコンテキストとその進化に応じて変化するコンセプト)を提供することです。
以降のセクションでは、Actions プロジェクトでインテント、タイプ、プロンプトをローカライズする際の考慮事項について説明します。
インテント
インテントは、アクションで実現できるユーザーの要望やニーズを表します。インテントで指定するトレーニング フレーズは、アシスタントの自然言語理解(NLU)がアクションのどのインテントがユーザーがリクエストしている内容と一致するかを判断するのに役立ちます。
インテントのトレーニング フレーズをローカライズする場合は、既存のフレーズを単に翻訳するのではなく、インテントの意味を検討し、ターゲット言語で潜在的なユーザー リクエストをより適切に表現するトレーニング フレーズを定義する必要があります。言語の表現力は、ローカル コンテキストが言語の進化に与えた影響や、コンセプトを定義するのに利用できる表現の範囲によって異なります。
例として、ユーザーに幸運だと思うものを特定するように求める会話インタラクションについて考えてみましょう。たとえば ブラジルでは部屋の隅に
塩のつぼが置いてあるような感じです日本では、朝にクモを見たユーザーはラッキーです。中国では、数字が 8 または赤色の場合、ユーザーは自身を幸運だと考えることができます。
型
型は、ビジネス ロジックで処理する必要があるエンティティを定義するために使用されます。たとえば、ユーザーが注文する商品のオプションや変更などです。タイプ値の類義語を使用すると、アシスタントの NLU はユーザーの発話からより効果的に情報を抽出できます。ユーザーはアファメーションに別の単語を使用する可能性があるため、単純な yes
型の値であっても、yeah
や okay
などの同義語が必要です。
型値の同義語をローカライズする場合は、現地の言語や文化の進化などの要因に応じて、同じコンセプトについて同義語の数が言語によって異なる場合があることを考慮することが重要です。
これを明確にできる例が雪の概念です。英語では、雪を表す言葉はいくつかあります。「Fryrry」、「blizzard」、「slush」、「powder」などです。一方、北ヨーロッパで話されているサーミ族の言語は、雪を表す語が 100 語をはるかに超えています。
雪のような架空のタイプをローカライズする場合に考慮すべき点が 2 つあります。
- 多様な言葉: 会話において Sámi を話すユーザーは、英語のユーザーよりも、雪を表現するための選択肢が豊富であることを期待します。
- 単語の特殊化: 特定の言語で利用できる一部の表現は、具体的すぎて会話エクスペリエンスの一部として使用できない場合があります。たとえば、サーミ語で「guoldu」という言葉を思い浮かべてみてください。これは「あまり風が強くない強い霜が降り、地面から吹く雪の雲」を意味します。この用語は技術的には雪の種類を示す手段ですが、アクションをサーミ語を使うユーザーには実用的ではないかもしれません。
プロンプト
プロンプトは、ユーザーとアクションの会話をガイドするために使用されます。これらは、アクションで何ができるかをユーザーに伝えるだけでなく、ユーザーのリクエストを処理するために必要な特定の情報を要求します。
プロンプトをローカライズする際は、言語や文化が異なれば、「良い会話」の内容に対する期待も異なる可能性があることを考慮することが重要です。
たとえば、日本語には、礼儀正しさとフォーマルさを表現するための広範な文法体系があり、この度合には主に「くだけた」(平文)、「たいてい」(丁寧な態度)、「丁寧な態度」という 3 つの丁寧さがあります。
使用するフォームは、各ユーザーが別の人に対応するときに使用するフォーマル度を決定するさまざまな要因によって決まります。アクションを日本語にローカライズする場合、これは 2 つのことを指します。
- ユーザーへのアプローチでどのレベルを使用すべきかを理解する。
- 必要なフォーマル度に応じてローカライズされたプロンプトを提供する。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-26 UTC。"],[[["\u003cp\u003eLocalizing Actions involves translating various components like settings, resources, intents, types, and prompts for a natural conversational experience in the target language.\u003c/p\u003e\n"],["\u003cp\u003eWhen localizing intents and types, consider cultural nuances and linguistic variations to accurately reflect user expressions and entity synonyms in the target language.\u003c/p\u003e\n"],["\u003cp\u003ePrompts should be adapted to align with cultural expectations and conversational norms, such as levels of formality and politeness, for a seamless user experience.\u003c/p\u003e\n"],["\u003cp\u003eEffective localization goes beyond direct translation and requires understanding cultural context and language evolution to ensure the conversation feels intuitive and natural for users in different locales.\u003c/p\u003e\n"]]],["Localizing Actions requires more than simple translation; it involves adapting the conversational experience. Key actions include translating project settings and resources like descriptions and images. Conversational components like intents, types, and prompts need careful consideration of the target language's nuances. Intents require new training phrases crafted with native speaker input. Types need localized synonyms that account for the language's variety and specialization, as seen in different words for snow. Prompts must reflect the target culture's conversational expectations and formality levels.\n"],null,["Since Actions provide a conversational interface, there are more things to\nconsider when localizing an Actions project than an average development project.\nMany components of your Action require translation, including settings,\nresources, intents, types, and prompts.\n\nSome components of an Action require particular attention to ensure that the\nconversational interface works in the target language. For example, training\nphrases used to invoke intents should be created in consultation with native\nspeakers of the target language, rather than simply translating the phrases\ncreated in the default language into the target language.\n\nActions Builder and the Actions SDK both support localization of your Action.\nWhen localizing an Actions project, there are two distinct groups of entities\nthat require localization: project settings/resources and conversational\ncomponents.\n\nProject settings and resources\n\nA project's settings include the information users find in your Action's\ndirectory listing, like short and long descriptions of your Action's\nfunctionality.\n\nResources are images, audio files, and other project strings that require\nlocalization, like logo images or recorded audio used in prompts.\n\nLocalizing a project's settings and resources is just a matter of providing\ntranslated versions of the settings/resources from the original locale to the\nnew locale.\n\nConversational components\n\nLocalizing conversational components is different than just providing a\ntranslation of existing content. The main objective of localizing a conversation\nfor other locales is to provide a conversational experience that feels natural\nand intuitive; a concept that varies based on the specific context of the locale\nlanguage and its evolution.\n\nThe following sections discuss considerations for localizing intents, types, and\nprompts in your Actions project.\n\nIntents\n\nIntents express a user's desire or need that your Action can fulfill. Training\nphrases you provide in an intent help the Assistant's Natural Language\nUnderstanding (NLU) determine which of the Action's intents match what a user is\nrequesting.\n\nWhen you localize training phrases for an intent, instead of just translating\nthe existing phrases, you should consider the meaning of the intent and define\ntraining phrases that better express potential user requests in the target\nlanguage. The expressivity of languages varies based on how the local context\nhas affected the evolution of the language, and the range of expressions\navailable to define concepts.\n\nAs an example, consider a conversational interaction where you ask users to\nidentify something they consider lucky. In Brazil, this could be having a pot of\nsalt in the corner of a room. In Japan, a user who sees a spider in the morning\nis lucky. In China, a user who sees the number 8 or the color red may consider\nthemselves lucky.\n\nTypes\n\nTypes are used to define entities that your business logic needs to handle. For\nexample, options and modifications to items a user is ordering. Synonyms for\ntype values make the Assistant NLU more effective at extracting information from\nwhat a user says. Even a simple `yes` type value should have synonyms like\n`yeah` or `okay`, as a user might use a different word for affirmation.\n\nWhen localizing synonyms for type values, it's important to consider different\nlanguages can have a varying number of synonyms for the same concept, depending\non factors like the evolution of the local language and culture.\n\nAn example that helps clarify this is the concept of snow. In English, there are\na handful of words for snow, including flurry, blizzard, slush, and powder. In\ncontrast, the Sámi family of languages spoken in Northern Europe, has well over\n100 words for snow.\n\nThere are two points that you should consider when localizing a hypothetical\ntype, like snow:\n\n- **Variety of words**: In a conversation, a speaker of Sámi would expect a larger variety of options to express snow, as opposed to an English user.\n- **Specialization of words** : Some available expressions in a given language may be too specific to be useful as part of a conversational experience. For example, consider the Sámi word *guoldu*, which means \"a cloud of snow which blows up from the ground when there is a hard frost without very much wind\". While this term is technically a way to indicate a type of snow, it may not be of any practical use to a Sámi-speaking user of your Action.\n\nPrompts\n\nPrompts are used to guide users through conversations with your Action. These\ninform the user of what your Action can do, as well as ask for specific\ninformation you need to fulfill their requests.\n\nWhen localizing prompts, it's important to consider different languages and\ncultures can have different expectations about what constitutes a \"good\nconversation\".\n\nFor example, the Japanese language has an extensive grammatical system to\nexpress politeness and formality, that translates to three main politeness\nlevels: *kudaketa* (the plain form), *teinei* (the simple polite form), and\n*keigo* (the advanced polite form).\n\nChoosing which form to use depends on a variety of factors that determine which\nlevel of formality each individual should use when addressing another\nindividual. For the Japanese localization of your Action this means two things:\n\n- Understanding which level to use when addressing your users.\n- Providing localized prompts for the required level(s) of formality."]]