---
schema_version: "1"
id: c4cb787384bdfe065d9756d1341e91935828767533ae779672ef2c8d7baa433f
title: エンベディング操作の設定
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/mulesoft-vectors-connector/1.0/configuring-embedding-operations.md
canonical_url: https://docs.mulesoft.com/jp/mulesoft-vectors-connector/1.0/configuring-embedding-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 80b50a12637126662267e4fcb180f652340d2a1a8313799a51c891b134198cbf
description: MuleSoft Documentation Site
release: "1.0"
latest: true
---
# エンベディング操作の設定

**\[Embedding\] Generate from text**​ 操作を設定します。

## [](#embedding-generate-from-text-操作の設定)Embedding Generate from Text 操作の設定

**\[Embedding\] Generate from text**​ 操作では、テキストを、指定されたサイズのチャンクに分割し、各テキストチャンクの数値ベクトルを作成します。

**\[Embedding\] Generate from text**​ 操作の後に ​**\[Store\] Add**​ 操作または ​**\[Store\] Query**​ 操作を続けることができます。いずれの操作も ​**\[Embedding\] Generate from text**​ 操作の出力ペイロードを変換なしで使用できます。​**\[Embedding\] Generate from text**​ 操作の後に次の操作を使用した場合の動作を次に示します。

- **\[Store\] Add**​ 操作: テキストを生成済みのエンベディングと共にベクトルストアに取り込むことができます。
- **\[Store\] Query**​ 操作: まずテキストを使用してエンベディングを生成し、次にそのエンベディングを使用してベクトルストアに対してクエリを実行します。
    
    <table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">クエリ目的でテキストからエンベディングを生成する場合、セグメンテーション項目を指定しないでください。​<strong>[Max Segment Size (Characters) (最大セグメントサイズ (文字数))]</strong>​ 項目と ​<strong>[Max Overlap Size (Characters) (最大重複サイズ (文字数))]</strong>​ 項目は空白のままにしてください。</td></tr></tbody></table>

**\[Embedding\] Generate from text**​ 操作を設定する手順は、次のとおりです。

Unresolved include directive in modules/ROOT/pages/configuring-embedding-operations.adoc - include::connectors::partial$t-configure-operations.adoc\[\] \* **Input Texts (入力テキスト)**

\+ エンベディングの生成元であるテキストの入力リストを入力します。 \* **Max Segment Size (Characters) (最大セグメントサイズ (文字数))**

\+ ドキュメントを分割するセグメントサイズを入力します。 これは省略可能な入力のため、空白のままにできます。 \* **Max Overlap Size (Characters) (最大重複サイズ (文字数))**

\+ セグメントの重複サイズを入力して類似検索を微調整します。これは省略可能な入力のため、空白のままにできます。 \* **Model (Deployment) Name (モデル (デプロイメント) 名)**

\+ エンベディングモデル (デプロイメント) 名を入力します。

この操作の XML を次に示します。

```xml
<ms-vectors:embedding-generate-from-text
  doc:name="[Embedding] Generate from text"
  doc:id="92c7a561-7b99-4840-8ffb-f680c9e392dc"
  config-ref="MuleSoft_Vectors_Connector_Embedding_config"
  maxSegmentSizeInChar="3000"
  maxOverlapSizeInChars="300"
  embeddingModelName="sfdc_ai__DefaultOpenAITextEmbeddingAda_002">
  <ms-vectors:text ><![CDATA[#[payload.text]]]></ms-vectors:text>
</ms-vectors:embedding-generate-from-text>
```

### [](#出力設定)出力設定

この操作の応答には JSON ペイロードが含まれます。応答の例を次に示します。

```json
{
    "embeddings": [
      [-0.00683132, -0.0033572172, 0.02698761, -0.01291587, ...],
      [-0.0047172513, -0.03481483, 0.02046227, -0.037395656, ...],
      ...
    ]
    "text-segments": [
        {
            "metadata": {
                "index": "0"
            },
            "text": "In the modern world, technological advancements have become .",
        },
        {
            "metadata": {
                "index": "1"
            },
            "text": "E-commerce giants like Amazon and Alibaba have redefined ..",
        },
        ...
    ],
    "dimension": 1536
}
```

- `embeddings`​: 生成されたエンベディングのリスト。
    
    - `list-item`​ (エンベディング)
- `text-segments`​: セグメントのリスト。
    
    - `list-item`​ (テキストセグメント)
        
        - `text`​: テキストセグメント。
        - `metadata`​: メタデータのキー-値ペア。
            
            - `index`​: アップロードされたデータソースのセグメントまたはチャンク番号。
- `dimension`​: エンベディングのディメンション。

この操作では、メイン JSON ペイロード内に含まれない属性も返されます。これには、トークン利用状況に関する情報が含まれます。次に例を示します。

```json
{
  "embeddingModelDimension": 1536,
  "embeddingModelName": "sfdc_ai__DefaultOpenAITextEmbeddingAda_002",
  "tokenUsage": {
      "outputCount": 9,
      "totalCount": 18,
      "inputCount": 9
  },
  "additionalAttributes": {}
}
```

- `embeddingModelDimension`​: 使用されたエンベディングモデルのディメンション。
- `embeddingModelName`​: 使用されたエンベディングモデル名。
- `tokenUsage`​: 属性として返されるトークン利用状況メタデータ
    
    - `outputCount`​: 出力の生成で使用されたトークン数
    - `totalCount`​: 入力と出力で使用されたトークンの合計数。
    - `inputCount`​: 入力の処理で使用されたトークン数。

## [](#関連情報)関連情報

- [MuleSoft Vectors Connector の概要](https://docs.mulesoft.com/jp/mulesoft-vectors-connector/1.0/)
- [MuleSoft Vectors Connector リファレンス](https://docs.mulesoft.com/jp/mulesoft-vectors-connector/1.0/mulesoft-vectors-connector-reference)
- [MuleSoft ヘルプセンター](https://help.mulesoft.com)