> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coreweave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# データセットの列をマッピングする

> データセットの列を別の名前にマッピングします。これにより、データセットの列名を Scorer が想定する列名に合わせることができます。

<Tabs>
  <Tab title="Python">
    Weave Python SDK では、Scorer の `column_map` 属性を使用して、Scorer が想定するパラメーター名をデータセットの列名にマッピングします。マッピングの形式は `{scorer_parameter: dataset_column}` です。

    次の例では、`output` パラメーターと `target` パラメーターを、データセットの `model_output` 列と `answer` 列にそれぞれマッピングします。

    ```python theme={"system"}
    from weave.scorers import EmbeddingSimilarityScorer

    similarity_scorer = EmbeddingSimilarityScorer()

    similarity_scorer.column_map = {
        "output": "model_output",  # モデルが生成したテキスト
        "target": "answer"         # 期待される応答または参照応答
    }
    ```

    Scorer の列マッピングの詳細については、[`column_map` による列名のマッピング](/ja/products/wandb/weave/guides/evaluation/scorers#mapping-column-names-with-column_map)を参照してください。
  </Tab>

  <Tab title="TypeScript">
    Weave TypeScript SDK では、列マッピングは個々の Scorer ではなく、`Evaluation` オブジェクトの `columnMapping` オプションで設定します。マッピングの形式は `{scorer_key: dataset_column}` です。

    次の例では、Scorer が使用する `expectedOutputTimesTwo` を、データセットの `expected` 列にマッピングします。

    ```typescript twoslash theme={"system"}
    // @noErrors
    import * as weave from 'weave';

    const myScorer = weave.op(
      ({modelOutput, datasetRow}) => {
        return modelOutput * 2 === datasetRow.expectedOutputTimesTwo;
      },
      {name: 'myScorer'}
    );

    const myEval = new weave.Evaluation({
      id: 'my-evaluation',
      dataset: [{expected: 2}],
      scorers: [myScorer],
      columnMapping: {expectedOutputTimesTwo: 'expected'},
    });
    ```

    TypeScript における Scorer の引数の詳細については、[Scorer のキーワード引数](/ja/products/wandb/weave/guides/evaluation/scorers#scorer-keyword-arguments)を参照してください。
  </Tab>
</Tabs>


## Related topics

- [データセットを収集してトラッキングする](/ja/products/wandb/weave/guides/core-types/datasets.md)
