bigframes.ml.llm.GeminiTextGenerator.score#
- GeminiTextGenerator.score(X: DataFrame | Series | DataFrame | Series, y: DataFrame | Series | DataFrame | Series, task_type: Literal['text_generation', 'classification', 'summarization', 'question_answering'] = 'text_generation') DataFrame[source]#
- Calculate evaluation metrics of the model. Only support
“gemini-1.5-pro-002”, “gemini-1.5-flash-002”, “gemini-2.0-flash-lite-001”, and “gemini-2.0-flash-001”.
Note
This product or feature is subject to the “Pre-GA Offerings Terms” in the General Service Terms section of the Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available “as is” and might have limited support. For more information, see the launch stage descriptions (https://cloud.google.com/products#product-launch-stages).
Note
Output matches that of the BigQuery ML.EVALUATE function. See: https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-evaluate#remote-model-llm for the outputs relevant to this model type.
- Parameters:
X (bigframes.dataframe.DataFrame or bigframes.series.Series or pandas.core.frame.DataFrame or pandas.core.series.Series) – A BigQuery DataFrame as evaluation data, which contains only one column of input_text that contains the prompt text to use when evaluating the model.
y (bigframes.dataframe.DataFrame or bigframes.series.Series or pandas.core.frame.DataFrame or pandas.core.series.Series) – A BigQuery DataFrame as evaluation labels, which contains only one column of output_text that you would expect to be returned by the model.
task_type (str) – The type of the task for LLM model. Default to “text_generation”. Possible values: “text_generation”, “classification”, “summarization”, and “question_answering”.
- Returns:
The DataFrame as evaluation result.
- Return type: