Skip to main content
In the Weave Python SDK, use the column_map attribute on a scorer to map its expected parameter names to your dataset’s column names. The mapping format is {scorer_parameter: dataset_column}.The following example maps the output and target parameters to a dataset’s model_output and answer columns:
from weave.scorers import EmbeddingSimilarityScorer

similarity_scorer = EmbeddingSimilarityScorer()

similarity_scorer.column_map = {
    "output": "model_output",  # The model's generated text
    "target": "answer"         # The expected or reference response
}
For more details on scorer column mapping, see Mapping Column Names with column_map.