开始使用媒体推荐

您可以快速构建领先的媒体推荐应用。借助媒体推荐,您的受众群体可以发现更加个性化的内容,例如接下来要观看或阅读的内容,并提供根据优化目标自定义的 Google 品质的结果。

如需了解有关媒体的代理搜索的一般信息,请参阅媒体搜索和推荐简介

在本入门教程中,您将使用 Movielens 数据集来演示如何将媒体内容目录和用户事件上传到 Agent Search 并训练个性化影片推荐模型。Movielens 数据集包含电影(文档)清单和用户电影评分(用户事件)。

在本教程中,您将训练一个针对点击率 (CTR) 进行优化的“您可能喜欢的其他内容”类型的推荐模型。训练完成后,模型可以根据用户 ID 和种子电影推荐电影。

为了满足模型的最低数据要求,每个正面的电影评分(4 分或以上)都被视为一个视图项事件。

预计完成本教程所需的时间:

  • 训练该模型的初始步骤:大约 1.5 小时。
  • 等待模型训练:大约 24 小时。(训练模型
  • 评估模型预测和清理:大约 30 分钟。(预览建议

如果您已完成媒体搜索使用入门教程,但仍有数据存储区(建议名称为 quickstart-media-data-store),则可以使用该数据存储区,无需另外创建一个。在这种情况下,您应该从创建用于媒体推荐的应用这一步开始学习本教程。

目标

  • 了解如何将媒体文档和用户事件数据从 BigQuery 导入 Agent Search。
  • 训练和评估推荐模型。

在学习本教程之前,确保您已完成准备工作中的步骤。


如需在 Google Cloud 控制台中直接遵循有关此任务的分步指导,请点击操作演示

操作演示


准备工作

  1. 登录您的 Google Cloud 账号。如果您是 Google Cloud新手,请 创建一个账号来评估我们的产品在实际场景中的表现。新客户还可获享 $300 赠金,用于运行、测试和部署工作负载。
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Agent Search (Discovery Engine), Cloud Storage, BigQuery APIs.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the APIs

  5. Make sure that you have the following role or roles on the project: Discovery Engine Admin and BigQuery Admin.

    Check for the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.

    4. For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.

    Grant the roles

    1. In the Google Cloud console, go to the IAM page.

      Go to IAM
    2. Select the project.
    3. Click Grant access.
    4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

    5. Click Select a role, then search for the role.
    6. To grant additional roles, click Add another role and add each additional role.
    7. Click Save.
  6. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.