700 以上のラボとコースにアクセス

Cloud SQL for PostgreSQL でベクトル検索を構成する

ラボ 1時間 universal_currency_alt クレジット: 1 show_chart 入門
info このラボでは、学習をサポートする AI ツールが組み込まれている場合があります。
700 以上のラボとコースにアクセス

GSP1287

Google Cloud セルフペース ラボのロゴ

概要

アプリケーションで Cloud SQL for PostgreSQL データベースを検索すると、入力した検索フレーズが実際に保存されているテキストに含まれていないとしても、関連するデータをすばやく特定できるとしたらどうでしょうか。Vertex AI テキスト エンベディングの力を活用して、Cloud SQL for PostgreSQL 内でベクトル検索を行うことが可能になりました。

Cloud SQL for PostgreSQL は、エンタープライズ対応の PostgreSQL 向けフルマネージド リレーショナル データベース サービスです。このサービスは費用対効果に優れていて、デベロッパーにとって使いやすいだけでなく、AI 機能を活用して、生成 AI アプリケーションを構築したり、特定の検索語句との関連性に基づいて Cloud SQL for PostgreSQL データベース内のデータを表面化したりするなどのタスクも実行できます。

ベクトル検索とは、(キーワードの完全一致ではなく)セマンティックな意味に基づいて同様のアイテムをすばやく見つけるために使用できる手法のことで、音声、画像、動画、テキストをはじめ、さまざまな種類のデータに適用できます。特にテキストでは、ベクトル検索を適用することで、検索語や検索フレーズとコンテンツが完全に一致していなくても、類似したテキスト アイテムを検索できます。

このラボでは、Cloud SQL for PostgreSQL でベクトル検索を構成する際の基礎として、まず、テキスト エンベディング(テキストのセマンティックな意味を数値で表すベクトル)を生成して保存する方法を学びます。次に、これらのテキスト エンベディングを使用して、高速の類似検索を行う方法を学びます。このハンズオンラボでは、例として特許データを使用します。特許データのような長く、技術的な要約の場合、基本的な概念をすぐに把握するのは難しいため、キーワード一致を使用した検索では不正確な結果が生じがちです。こうしたデータに対して、Cloud SQL for PostgreSQL ではベクトル検索を活用できることを明らかにします。

学習内容

このラボでは、次の方法について学びます。

  • ベクトル検索をサポートするように Cloud SQL for PostgreSQL データベースを構成する
  • Cloud SQL for PostgreSQL でテーブルを作成してデータを読み込む
  • Cloud SQL for PostgreSQL でテキスト エンベディングを生成して保存する
  • テキスト エンベディングを使用して Cloud SQL for PostgreSQL でベクトル検索を行う

設定と要件

[ラボを開始] ボタンをクリックする前に

こちらの説明をお読みください。ラボには時間制限があり、一時停止することはできません。タイマーは、Google Cloud のリソースを利用できる時間を示しており、[ラボを開始] をクリックするとスタートします。

このハンズオンラボでは、シミュレーションやデモ環境ではなく実際のクラウド環境を使って、ラボのアクティビティを行います。そのため、ラボの受講中に Google Cloud にログインおよびアクセスするための、新しい一時的な認証情報が提供されます。

このラボを完了するためには、下記が必要です。

  • 標準的なインターネット ブラウザ(Chrome を推奨)
注: このラボの実行には、シークレット モード(推奨)またはシークレット ブラウジング ウィンドウを使用してください。これにより、個人アカウントと受講者アカウント間の競合を防ぎ、個人アカウントに追加料金が発生しないようにすることができます。
  • ラボを完了するための時間(開始後は一時停止できません)
注: このラボでは、受講者アカウントのみを使用してください。別の Google Cloud アカウントを使用すると、そのアカウントに料金が発生する可能性があります。

ラボを開始して Google Cloud コンソールにログインする方法

  1. [ラボを開始] ボタンをクリックします。ラボの料金をお支払いいただく必要がある場合は、表示されるダイアログでお支払い方法を選択してください。 左側の [ラボの詳細] ペインには、以下が表示されます。

    • [Google Cloud コンソールを開く] ボタン
    • 残り時間
    • このラボで使用する必要がある一時的な認証情報
    • このラボを行うために必要なその他の情報(ある場合)
  2. [Google Cloud コンソールを開く] をクリックします(Chrome ブラウザを使用している場合は、右クリックして [シークレット ウィンドウで開く] を選択します)。

    ラボでリソースがスピンアップし、別のタブで [ログイン] ページが表示されます。

    ヒント: タブをそれぞれ別のウィンドウで開き、並べて表示しておきましょう。

    注: [アカウントの選択] ダイアログが表示されたら、[別のアカウントを使用] をクリックします。
  3. 必要に応じて、下のユーザー名をコピーして、[ログイン] ダイアログに貼り付けます。

    {{{user_0.username | "Username"}}}

    [ラボの詳細] ペインでもユーザー名を確認できます。

  4. [次へ] をクリックします。

  5. 以下のパスワードをコピーして、[ようこそ] ダイアログに貼り付けます。

    {{{user_0.password | "Password"}}}

    [ラボの詳細] ペインでもパスワードを確認できます。

  6. [次へ] をクリックします。

    重要: ラボで提供された認証情報を使用する必要があります。Google Cloud アカウントの認証情報は使用しないでください。 注: このラボでご自身の Google Cloud アカウントを使用すると、追加料金が発生する場合があります。
  7. その後次のように進みます。

    • 利用規約に同意してください。
    • 一時的なアカウントなので、復元オプションや 2 要素認証プロセスは設定しないでください。
    • 無料トライアルには登録しないでください。

その後、このタブで Google Cloud コンソールが開きます。

注: Google Cloud のプロダクトやサービスにアクセスするには、ナビゲーション メニューをクリックするか、[検索] フィールドにサービス名またはプロダクト名を入力します。 ナビゲーション メニュー アイコンと検索フィールド

Cloud Shell をアクティブにする

Cloud Shell は、開発ツールと一緒に読み込まれる仮想マシンです。5 GB の永続ホーム ディレクトリが用意されており、Google Cloud で稼働します。Cloud Shell を使用すると、コマンドラインで Google Cloud リソースにアクセスできます。

  1. Google Cloud コンソールの上部にある「Cloud Shell をアクティブにする」アイコン 「Cloud Shell をアクティブにする」アイコン をクリックします。

  2. ウィンドウで次の操作を行います。

    • Cloud Shell 情報ウィンドウで操作を進めます。
    • Cloud Shell が認証情報を使用して Google Cloud API を呼び出すことを承認します。

接続した時点で認証が完了しており、プロジェクトに各自の Project_ID が設定されます。出力には、このセッションの PROJECT_ID を宣言する次の行が含まれています。

Your Cloud Platform project in this session is set to {{{project_0.project_id | "PROJECT_ID"}}}

gcloud は Google Cloud のコマンドライン ツールです。このツールは、Cloud Shell にプリインストールされており、タブ補完がサポートされています。

  1. (省略可)次のコマンドを使用すると、有効なアカウント名を一覧表示できます。
gcloud auth list
  1. [承認] をクリックします。

出力:

ACTIVE: * ACCOUNT: {{{user_0.username | "ACCOUNT"}}} To set the active account, run: $ gcloud config set account `ACCOUNT`
  1. (省略可)次のコマンドを使用すると、プロジェクト ID を一覧表示できます。
gcloud config list project

出力:

[core] project = {{{project_0.project_id | "PROJECT_ID"}}} 注: Google Cloud における gcloud ドキュメントの全文については、gcloud CLI の概要ガイドをご覧ください。

タスク 1. ベクトル検索をサポートするように Cloud SQL for PostgreSQL データベースを構成する

このラボ環境内には、patent-instance という名前の Cloud SQL for PostgreSQL インスタンスと patent-db という名前のデータベースがすでにプロビジョニングされています。

このタスクではまず、Vertex AI リソースにアクセスするために使用する Cloud SQL サービス アカウントに、Identity and Access Management(IAM)を使用して適切な Vertex AI ロールを付与します。次に、patent-db という名前のデフォルトの Cloud SQL for PostgreSQL データベースで主要な拡張機能を有効にして、ベクトル検索用のテキスト エンベディングの生成、保存、クエリをサポートするために必要な権限を付与します。

Cloud SQL サービス アカウントに Vertex AI ユーザーロールを付与する

  1. Cloud Shell で次のコマンドを実行して、Cloud SQL サービス アカウントを特定します。
gcloud sql instances describe patent-instance \ --format="value(serviceAccountEmailAddress)"

次の手順で使用するために、このサービス アカウントをコピーします。

サービス アカウントは次のようになります。

p567201276916-f6skvu@gcp-sa-cloud-sql.iam.gserviceaccount.com
  1. Google Cloud コンソールのナビゲーション メニューナビゲーション メニュー アイコン)で、[IAM と管理] > [IAM] を選択します。

  2. [アクセス権を付与] をクリックします。

  3. [新しいプリンシパル] に、ステップ 1 でコピーした Cloud SQL サービス アカウント ID を入力します(例: p567201276916-f6skvu@gcp-sa-cloud-sql.iam.gserviceaccount.com)。

  4. [ロールを選択] で、[Vertex AI] > [Vertex AI ユーザー] を選択します。

  5. [保存] をクリックします。

ベクトル検索をサポートするように Cloud SQL for PostgreSQL データベースを構成する

次に、Cloud SQL for PostgreSQL データベースに Vertex AI を統合します。それには、Cloud SQL Studio を使用して patent-db という名前のデータベースに接続し、ベクトルをサポートして Vertex AI エンドポイントへのアクセスを許可するために、vector および google_ml_integration 拡張機能のそれぞれを有効にします。

  1. Google Cloud コンソールのナビゲーション メニューナビゲーション メニュー アイコン)で、[SQL] をクリックします。

  2. patent-instance というインスタンス ID をクリックします。

  3. [プライマリ インスタンス] メニューで [Cloud SQL Studio] をクリックします。

  4. 次の情報を入力してログインし、[認証] をクリックします。

プロパティ
データベース [patent-db] を選択します。
認証方法 [組み込みデータベース認証] を選択します。
ユーザー [postgres] を選択します。
パスワード supersecret!
  1. Cloud SQL Studio ページで、[新しい SQL エディタタブ] をクリックして新しいクエリ ウィンドウを開きます。

  2. google_ml_integration 拡張機能を有効にするために、次のクエリをコピーしてクエリ ウィンドウに貼り付け、[実行] をクリックします。

CREATE EXTENSION google_ml_integration;

クエリが正常に実行されると、「ステートメントは正常に実行されました」というメッセージが表示されます。

  1. クエリエディタ ウィンドウで、[実行] と同じメニューバーにある [クリア] をクリックして、前のクエリを削除します。

  2. vector 拡張機能を有効にするために、次のクエリをコピーしてクエリ ウィンドウに貼り付け、[実行] をクリックします。

CREATE EXTENSION vector;

クエリが正常に実行されると、「ステートメントは正常に実行されました」というメッセージが表示されます。

  1. クエリエディタ ウィンドウで、[実行] と同じメニューバーにある [クリア] をクリックして、前のクエリを削除します。

  2. postgres という名前のデータベース ユーザーにエンベディング関数を実行する権限を付与するために、次のクエリをコピーして貼り付けます。

GRANT EXECUTE ON FUNCTION embedding TO postgres;

クエリが正常に実行されると、「ステートメントは正常に実行されました」というメッセージが表示されます。

[進行状況を確認] をクリックして、目標に沿って進んでいることを確認します。 ベクトル検索をサポートするように Cloud SQL for PostgreSQL データベースを構成する

タスク 2. 新しいテーブルを作成して特許データを読み込む

Google 特許検索公開データは、各特許の完全な要約からなる、特許出版物の大規模データセットです。特許の要約は長く、複雑なテキストであることが多いため、ベクトル検索の対象として最適です。

このタスクでは、特許ソースデータのさまざまな列に加えて、要約テキストのベクトル エンベディング(次のタスクで生成)を格納するための列からなる、新しいテーブルを作成します。最後に、Cloud SQL for PostgreSQL で新しく作成したテーブルに、完全な特許データから抜粋したサンプルを読み込みます。

  1. クエリエディタ ウィンドウで、[実行] と同じメニューバーにある [クリア] をクリックして、前のクエリを削除します。

  2. 特許データ用の新しいテーブルを作成するために、次のクエリをコピーしてクエリ ウィンドウに貼り付け、[実行] をクリックします。

CREATE TABLE patents_data (id VARCHAR(25), type VARCHAR(25), number VARCHAR(20), country VARCHAR(2), date VARCHAR(20), abstract VARCHAR(300000), title VARCHAR(100000), kind VARCHAR(5), num_claims BIGINT, filename VARCHAR(100), withdrawn BIGINT, abstract_embeddings vector(768));

テーブルの最後の列(abstract_embeddings)の型は vector です。この列に、次のタスクで作成するベクトル値を格納できます。

クエリが正常に実行されると、「ステートメントは正常に実行されました」というメッセージが表示されます。

  1. Cloud SQL Studio のクエリエディタで、[実行] と同じメニューバーにある [クリア] をクリックして、前のクエリを削除します。

  2. テーブルにデータを読み込むには、次のクエリをコピーしてクエリ ウィンドウに貼り付け、[実行] をクリックします。

読み込むデータは完全な特許データセットから抜粋したサンプルですが、50 件の特許それぞれについて、すべての情報がテーブルに読み込まれます。

insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10326103','utility','10326103','US','6/18/2019','A display device includes a first substrate having a display area and a non-display area around the display area, a seal pattern in the non-display area and offset from the display area, and one or more buffer patterns between the seal pattern and the display area and having a viscosity of 5000 cps to 50000 cps.','Display device having buffer patterns','B2',15,'ipg190618.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10326507','utility','10326507','US','6/18/2019','A network device receives, from a network management system (NMS), a first traffic distribution associated with the FD-MIMO antenna site, and receives a first service reliability requirement associated with the FD-MIMO antenna site. The network device determines, based on physical constraints, a maximum number of a plurality of antenna base blocks that can be placed at a full-dimension multiple input multiple output (FD-MIMO) antenna site, wherein each of the plurality of antenna base blocks includes a plurality of antennas. The network device further determines a first number of antennas to switch into the FD-MIMO antenna site based on the determined maximum number of the plurality of antenna base blocks, the first traffic distribution, and the first service reliability requirement; and causes the first number of antennas to be switched into the FD-MIMO antenna site.','System and method for a dynamically active FD-MIMO antenna array adjustment system','B2',20,'ipg190618.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10328303','utility','10328303','US','6/25/2019','An exercise treadmill is disclosed. The treadmill can be constructed with no obstructing front rails, with one or more side rails, and/or with a structural flat or ramped surface at the front allowing the user to exercise with unconstrained motion. The treadmill can further include one or more accommodations to help the user stay safe, remain longitudinally centered, and/or adjust speed with controls built into the treadmill, or automatically based on body position relative to sensors built into the side rails. The treadmill belt may be motor driven, or be user driven and dynamically moderated by resistance. The treadmill configuration can be utilized to provide a virtualized exercise experience for the user.','Exercise treadmill','B2',27,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10328431','utility','10328431','US','6/25/2019','A storage system for storing samples, such as frozen biological samples in RFID-tagged vials. The storage system has (i) a storage device having a device antenna and (ii) a plurality of storage components adapted to be stored within the storage device, each storage component having a component circuit. Each storage component is configured to store one or more samples. The storage device is configured to (i) transmit electrical power and downlink data signals wirelessly to each storage component via the device antenna and the corresponding component circuit and to (ii) receive uplink data signals from each storage component wirelessly via the corresponding component circuit and the device antenna such that a control system located outside of the dewar can identify any specified storage component stored within the storage device.','Storage devices for RFID-tracked biological and other samples','B2',19,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10328505','utility','10328505','US','6/25/2019','A circular saw includes a worktable, a sliding unit including a mounting base mounted on the worktable and providing an accommodation slot and two sliding shafts axially slidably inserted through the mounting base at two opposite sides of the accommodation slot in a parallel manner, and a cutting unit including a saw arm pivotally connected between the two sliding shafts and providing an accommodation portion and a saw blade pivotally mounted at the saw arm. Thus, when the saw arm is in an upper limit position, the accommodation of the saw arm is partially disposed outside the accommodation slot. When the saw arm is in a lower limit position, the accommodation portion is received in the accommodation slot. Subject to the design described above, the circular saw achieves the effects of reduced overall dimension, low vibration and high cutting accuracy.','Circular saw','B2',3,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10328822','utility','10328822','US','6/25/2019','An improved system to raise and lower a seat by a simplified substantially parallelogram or non-parallelogram motion. By replacing two of the links of a parallelogram seat lift system with an arc, or a straight link as a mechanically defined path for a pivot to follow, space and material can be saved to fit an adjustable seat on an ATV or any type of support system. The system can be useful on many varieties of vehicles and other adjustable supports.','Adjustable seat and support system','B2',9,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10329100','utility','10329100','US','6/25/2019','A tie plate straightener includes a plurality of rollers having varying cross-section and differing elevations. The tie plate straightener includes directional wheels between the rollers and disposed in alignment with the lower elevations of the rollers. The straightener receives tie plates at an input and rotates the tie plates when the tie plate engages the directional wheels. The tie plate is thereby oriented and/or positioned so that the tie plate is supported above the directional wheels.','Plate straightener','B1',19,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10329436','utility','10329436','US','6/25/2019','A self-healing polymer is described herein, including a first carbon nanotube filled with at least a first healing agent, wherein the first carbon nanotube has first and second ends, wherein a first end cap is closed on the first end of the first carbon nanotube and a second end cap is closed on the second end of the first carbon nanotube, and a second carbon nanotube filled with at least a second healing agent, wherein the second carbon nanotube has first and second ends, wherein a first end cap is closed on the first end of the second carbon nanotube and a second end cap is closed on the second end of the second carbon nanotube.','Self-healing polymer compositions','B2',18,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10330945','utility','10330945','US','6/25/2019','There is provided a medical image display apparatus including: a display control section that performs control such that a left-eye image and a right-eye image that form a medical image are displayed in a time division manner on a predetermined display section; and a communication section that transmits a synchronization signal in accordance with display timings of the left-eye image and the right-eye image on the display section to shutter glasses that include a left-eye shutter and a right-eye shutter, and receives a response to the synchronization signal from the shutter glasses. The display control section performs the control such that only any one of the left-eye image and the right-eye image is displayed on the display section in accordance with a reception status of the response.','Medical image display apparatus, medical information processing system, and medical image display control method','B2',10,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10331073','utility','10331073','US','6/25/2019','In an example implementation, a method of cleaning a silicon photoconductor includes contacting the silicon photoconductor with a base-peroxide solution, rinsing the silicon photoconductor with a liquid, and heating the silicon photoconductor to evaporate the liquid.','Cleaning a silicon photoconductor','B2',18,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10331564','utility','10331564','US','6/25/2019','Technologies for secure I/O with MIPI camera devices include a computing device having a camera controller coupled to a camera and a channel identifier filter. The channel identifier filter detects DMA transactions issued by the camera controller and related to the camera. The channel identifier filter determines whether a DMA transaction includes a secure channel identifier or a non-secure channel identifier. If the DMA transaction includes the non-secure channel identifier, the channel identifier filter allows the DMA transaction. If the DMA transaction includes the secure channel identifier, the channel identifier filter determines whether the DMA transaction is targeted to a memory address in a protected memory range associated with the secure channel identifier. If so, the channel identifier filter allows the DMA transaction. If not, the channel identifier filter blocks the DMA transaction. Other embodiments are described and claimed.','Technologies for secure I/O with MIPI camera device','B2',25,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10331881','utility','10331881','US','6/25/2019','Techniques are described herein for loading a user-mode component of a security agent based on an asynchronous procedure call (APC) built by a kernel-mode component of the security agent. The APC is executed while a process loads, causing the process to load the user-mode component. The user-mode component then identifies slack space of the process, stores instructions in the slack space, and hooks function(s) of the process, including modifying instruction(s) of the function(s) to call the instructions stored in the slack space. When those modified instruction(s) call the stored instructions, the stored instructions invoke the user-mode component, which receives data from the hooked function(s). Also, the security agent may bypass a control-flow protection mechanism of the operating system by setting a pointer of the control-flow protection mechanism to point to an alternate verification function.','User-mode component injection techniques','B2',20,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10332201','utility','10332201','US','6/25/2019','A computer-assisted method of presenting a plurality of financial accounts as a unitary financial account. The method includes displaying, on a graphical display, a graphical representation of a first financial account and displaying, on the graphical display, a graphical representation of a second financial account, wherein the graphical representation of the first financial account and the graphical representation of the second financial account are displayed as a unitary graphical representation that conveys to a user that the first financial account and the second financial account are a partitioned unitary financial account. The method also includes enabling the user to transfer monetary funds between the first financial account and the second financial account by manipulation of the unitary graphical representation.','Bundled financial accounts','B1',12,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10333086','utility','10333086','US','6/25/2019','A flexible display panel fabrication method and a flexible display panel where the method first subjects a photoresist layer to patterning to form a plurality of mutually spaced photoresist zones, a through hole being formed between every two adjacent ones of the photoresist zones; and then, subjecting the flexible backing plate to cavity formation with the photoresist zones as a mask so as to form a plurality of mutually parallel backing cavities respectively at locations corresponding to the through holes; and then, depositing a metal film and subsequently removing the photoresist zones and portions of the metal layer located thereon to form a plurality of metal patterns embedded in the plurality of mutually parallel backing cavities, each of the metal patterns including a scan line and a plurality of gate electrodes; and then, forming a plurality of TFTs arranged in an array and OLED light emissive elements.','Flexible display panel fabrication method and flexible display panel','B2',13,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10333126','utility','10333126','US','6/25/2019','The present invention relates to a composite separation membrane for a lithium secondary battery having excellent lifetime and safety improvement effects, and a preparation method therefor and, more specifically, to a composite separation membrane for a lithium secondary battery, including: a porous base layer; a heat resistant layer formed on one surface or both surfaces of the porous base layer; and a fusion layer formed on the outermost layer. Inorganic particles in the heat resistant layer are connected and fixed by a binder polymer, and the fusion layer is prepared by comprising amorphous polymer particles having a glass transition temperature of 30 to 90° C. and a difference between a fusion temperature and the glass transition temperature of 60° C. or lower.','Fusion type composite separation membrane for lithium secondary battery, and preparation method therefor','B2',11,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10333949','utility','10333949','US','6/25/2019','The present disclosure relates to systems and methods for blocking an infection vector. In some embodiments, a method may include detecting, at a first device, a synchronization event with a second device, the first device and the second device operating with a proprietary mobile operating system. In some examples, the method may include recognizing, by the first device, that the first device is attempting to send a data package to the second device, and identifying the data package as malware. The method may further include blocking the data package from being received at the second device based at least in part on the identifying.','Proactive protection of mobile operating system malware via blocking of infection vector','B1',16,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10334023','utility','10334023','US','6/25/2019','The present invention discloses a content distribution method, system and a server. In one embodiment, the method includes: receiving a content distribution request form a client; obtaining all receiving ends designated by the content distribution request, and marking at least a portion of the receiving ends with a first status code; judging whether all the at least a portion of the receiving ends complete the distribution task, if not, controlling an internal distribution process until all the at least a portion of the receiving ends complete the distribution task.','Content distribution method, system and server','B2',18,'ipg190625.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10334962','utility','10334962','US','7/2/2019','A portable, stable and rigid baby changing station which can be easily collapsed for storage or expanded for use and which can be safely and securely worn by a user, to form a firm bed for changing a baby when no other clean or useable surfaces are available.','Wearable portable baby changing table','B2',15,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10335619','utility','10335619','US','7/2/2019','A multifunction NFPA escape and ladder belt having multiple functions for firefighter and rescue worker work. The belt includes a front buckle and right and left side buckles, straps coupling the left and right side buckles to the front buckle and to one another. At least one of said straps includes a stitched loop portion formed with a stitching pattern configured to fail, and for the loop portion to unfold, when the side straps are under a sufficient tension load exceeding the breaking strength of the stitching pattern; that failure will occur before a structural failure in any other element or component of the belt.','Firefighter multifunction ladder and escape belt','B2',14,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10336444','utility','10336444','US','7/2/2019','A rotor includes a blade retention cuff configured to receive a rotor blade; a yoke coupled to the blade retention cuff; and a rigid propeller shaped hub configured to enclose at least a portion of the blade retention cuff and at least a portion of the yoke.','Composite stiffened rigid propeller shaped main rotor hub','B2',18,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10337814','utility','10337814','US','7/2/2019','A dearmer positioning system has two assemblies, each of which circumscribes a dearmers barrel. Each of the two assemblies includes two half rings and a one-piece outer ring. The two half rings are joined to one another to define a full ring having a first central opening defining a first diameter. The full ring has a periphery defining a second diameter. The one-piece outer ring has a second central opening defining a third diameter, and a periphery defining a fourth diameter. The third diameter is greater than the second diameter such that the full ring slidingly fits in the central opening of the outer ring. Threaded fasteners engage the outer ring and extend radially through the outer ring and into its central opening to engage the periphery of the full ring.','Dearmer positioning system','B1',18,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10338067','utility','10338067','US','7/2/2019','Method and compositions using transition metal salts and/or ammonium chloride to liberate toxins and other molecules from cyanobacteria, useful for assaying for total cyanobacterial toxins in lakes, reservoirs and other waters.','Rapid analysis for cyanobacterial toxins','B1',11,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10338681','utility','10338681','US','7/2/2019','One illustrative system disclosed herein includes a processor configured to determine a haptic effect, wherein the haptic effect includes a static ESF effect or a confirmation ESF effect; and transmit a haptic signal associated with the haptic effect. The illustrative system also includes an ESF controller in communication with the processor, the ESF controller configured to receive the haptic signal, determine an ESF signal based at least in part on the haptic signal, and transmit the ESF signal. The illustrative system further includes an ESF device in communication with the ESF controller, the ESF device including an ESF cell and configured to receive the ESF signal and output the haptic effect.','Systems and methods for multi-output electrostatic haptic effects','B2',20,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10338956','utility','10338956','US','7/2/2019','An application profiling system, initiating profiling a software application; including: apparatus to receive user input information of a software application profiling target and execution requirements, to store profiler specifications; to determine which profiler satisfies the execution requirements, based on the specifications, and to generate needed profiling tasks, each task specifying an application profiler; to select hardware resources the tasks; and to initiate execution of the tasks.','Application profiling job management system, program, and method','B2',15,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10339572','utility','10339572','US','7/2/2019','A seemingly infinite and continuous stream of online content can be tracked by a movement tracker that can track an amount of movement of a stream of content. For example, such a movement tracker can track the amount of movement per session of a client-side application, such as per session of a web browser. In an example, the tracking of the movement can occur by tracking a measurable parameter of the stream that indicates the amount of movement, such as scroll distance. The movement tracker may also be configured to determine user interaction data according to the tracked amount of movement.','Tracking user interaction with a stream of content','B2',20,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10339617','utility','10339617','US','7/2/2019','An order management system that employs profile locking is provided for managing clinical orders in patient profiles. The system allows users to initiate lockable order actions (e.g., order actions requiring a profile lock for conflict checking) in a profile locked by another user. When a user attempts to initiate a lockable order action, the system provides a notification to the user indicating that the patient profile is locked by another user. The user may elect to continue initiating the lockable order action. When the profile becomes available, the system provides a notification to the user, who may then obtain the profile lock and process the lockable order action, including having the system perform conflict checking. The system may also provide for the initiation of an instant messaging session between the user attempting to enter a lockable order action in a locked profile and another user who has the profile lock.','Order profile safeguarding mechanism','B2',20,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10340545','utility','10340545','US','7/2/2019','A method and apparatus is provided for harvesting electricity from a biofilm retained in a zero chamber, no interphase container, the biofilm having a portion supporting aerobic microbial activity and a second portion supporting anaerobic microbial activity, wherein the first and the second portion are in direct physical contact. A power harvester is electrically connected, directly or indirectly, to the second portion of the biofilm.','Method and apparatus for converting chemical energy stored in wastewater into electrical energy','B2',29,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10341086','utility','10341086','US','7/2/2019','A method is performed by a server for searching for information contained in encrypted data without revealing the information to the server. The server receives from a client: an encrypted matrix containing the information to be searched for in files and linking the information to the files; for each of the files, a merged secret key; and an encrypted vector having a length corresponding to a number of the information. The encrypted data is evaluated by performing a multiplication of the matrix with entries in the vector using a multikey homomorphic encryption scheme. For each of the files, a value of the multiplication of the matrix is decrypted using the corresponding merged secret key so as to determine which of the files contains the information. The files containing the information are sent to the client.','Method and system for providing encrypted data for searching of information therein and a method and system for searching of information on encrypted data','B2',12,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10341990','utility','10341990','US','7/2/2019','An electronic apparatus and a controlling method thereof are provided. The electronic apparatus includes: a first communication module configured to communicate in a first communication method, and a second communication module configured to communicate in a second communication method. The first communication module is further configured to change a transmission output level of the first communication module from a first transmission output level to a second transmission output level in response to the second communication module receiving data, and change the transmission output level from the second transmission output level to the first transmission output level in response to the second communication module completing the reception of the data.','Electronic apparatus and controlling method thereof','B2',17,'ipg190702.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10342895','utility','10342895','US','7/9/2019','A pulverulent semisynthetic material, derived from a natural marine biomaterial, namely the aragonitic inner layer of the shell of bivalve molluscs selected from the group including Pinctadines, notably Pinctada maxima, margaritifera, and Tridacnes, notably Tridacnagigas, maxima, derasa, tevaroa, squamosa, crocea, Hippopushippopus, Hippopusporcelanus, in pulverulent form, with addition of insoluble and soluble biopolymers and calcium carbonate transformed by carbonation; it also relates to the method of preparation thereof and to the uses thereof.','Pulverulent semisynthetic material obtained by modifying the composition of a natural marine biomaterial, method of manufacture thereof, and applications thereof','B2',7,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10343251','utility','10343251','US','7/9/2019','In a cam grinding method, a common surface of a first cam and a second cam is acquired in a common surface setting step. In a first common surface grinding step performed after a first cam grinding step, traverse movement of a grinding wheel is performed such that the grinding wheel is aligned with an area from the first cam to the second cam while the first cam and the second cam are rotated, and the common surface is ground. In a second common surface grinding step performed after a second cam grinding step, traverse movement of the grinding wheel is performed such that the grinding wheel is aligned with an area from the second cam to the first cam while the first cam and the second cam are rotated, and the common surface is ground.','Cam grinding machine and cam grinding method','B2',6,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10343997','utility','10343997','US','7/9/2019','An ursolic acid derivative can have the following structural formula: The ursolic acid derivative exhibits potent selective calcium channel blocker activities and may be used to treat a disease or condition for which calcium channel regulation is useful.','Ursolic acid derivatives','B1',11,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10344433','utility','10344433','US','7/9/2019','A ground stabilisation system is used for stabilising a subgrade region which includes a peat layer under a railway having rails supported across rail ties on a ballast layer over the subgrade region. The system uses a plurality of drain members submerged in an upright orientation within the peat layer of the subgrade region in which each drain member has a hollow interior and a plurality of openings therein which allow communication of fluid from the peat layer surrounding the drain member into the hollow interior of the drain member so as to be arranged to reduce fluid pressure in the peat layer when the peat layer undergoes dynamic loading from a passing train. Each drain member is a semi-rigid pipe having an axial stiffness greater than a dynamic stiffness of the peat layer to reduce loading on the peat layer under dynamic loading from a passing train.','Subgrade peat stabilisation system for railway','B2',16,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10344992','utility','10344992','US','7/9/2019','Embodiments of the invention provide a lighting and ventilating system including a main housing. The main housing can include an inlet through which air can be received within the main housing and an outlet through which the air can exit the main housing. A fan wheel can be supported in the main housing and it can be operable to generate a flow of air. A grille can be coupled to the main housing and the grille can comprise at least one aperture. The system can include a plate coupled to the grille and the plate can include a recess. Also, a set of illumination devices can be at least partially disposed within the recess.','Lighting and ventilating system and method','B2',34,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10345589','utility','10345589','US','7/9/2019','An apparatus includes a holographic film having one or more reflective holograms recorded therein. One or more light sources positioned to direct light toward a corresponding one of the one or more holograms, and a dynamic mask positioned between the one or more light sources and the holographic film to spatially modulate light traveling between the one or more light sources and the one or more reflective holograms but not spatially modulate ambient light traveling through the hologram.','Compact near-eye hologram display','B1',20,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10346746','utility','10346746','US','7/9/2019','A method and apparatus for generating a training model based on feedback are provided. The method for generating a training model based on feedback, includes calculating an eigenvector of a sample among a plurality of samples; obtaining scores granted by a user for one or more of the plurality of samples in a round, obtaining scores granted by the user for a first number of samples; obtaining scores granted by the user for a second number of samples in response to detecting, based on the eigenvector, an inconsistency between the scores granted by the user for the first number of samples; and generating a training model based on the scores granted by the user for the first and second numbers of samples. A corresponding apparatus is also provided.','Generating a training model based on feedback','B2',8,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10347147','utility','10347147','US','7/9/2019','A system, a method, and a computer program product for managing answer feasibility in a Question and Answering (QA) system. A set of candidate situations is established. The set of candidate situations corresponds to a first set of answers. A QA system establishes the set of candidate situations by analyzing a corpus. The first set of answers will answer a question. The QA system identifies a subset of the set of candidate situations. The subset of candidate situations corresponds to a portion of contextual data. The portion of contextual data is from a set of contextual data. The set of contextual data relates to the question. The question-answering system determines a set of answer feasibility factors. The set of answer feasibility factors is determined using the subset of candidate situations. The set of answer feasibility factors indicates the feasibility of the answers in the first set of answers.','Managing answer feasibility','B2',14,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10347243','utility','10347243','US','7/9/2019','Disclosed herein is a method for analyzing an utterance meaning. The method includes collecting a voice signal of an utterer; converting the collected voice signal into information in a text form, extracting a keyword of the text information from the text information, and deriving at least one utterance topic on the basis of the extracted keywords of the text information.','Apparatus and method for analyzing utterance meaning','B2',26,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10347623','utility','10347623','US','7/9/2019','A switch includes an input terminal and an output terminal. The switch also includes a first stack having transistors coupled in series, and a second stack having transistors coupled in series. The first stack and the second stack are connected in parallel with one another.','Switch having first and second switching elements connected in parallel with one another','B2',16,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10347660','utility','10347660','US','7/9/2019','The present disclosure discloses an array substrate, the array substrate comprises a substrate as well as a thin film transistor and a pixel electrode formed on the substrate, wherein the top of the thin film transistor is formed a floating gate electrode, at least portion of the floating gate electrode and the pixel electrode are made of the same material. The present disclosure also discloses a manufacturing method of an array substrate. Through this way, the present disclosure simultaneously forms a floating gate electrode in the manufacturing process of the pixel electrode, the pixel electrode and the floating gate electrode is formed by a mask, there is no need to add a mask, thus achieving the manufacture of the dual gate thin film transistor and the array substrate, briefing the process, reducing the production costs.','Array substrate and manufacturing method thereof','B2',11,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10348905','utility','10348905','US','7/9/2019','A computer-based system and method for responding to customer calls. The method includes automatically determining whether at least one incoming call meets existing customer criteria and further automatically determining a market segment of the at least one incoming call. The market segment may indicate whether a specific customer prefers: (i) no voice or face-to-face interaction with a representative; (ii) a face-to-face interaction with a representative; and/or (iii) a voice only interaction with a representative. The method further includes automatically routing the at least one incoming call based upon the determined market segment to one of: (1) an automated voice prompt; (2) a gaming system having two-way video capability; or (3) a person-to-person voice call system to facilitate answering incoming calls in a customer-friendly or customer preferred manner.','System and method for responding to customer calls','B1',16,'ipg190709.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10349594','utility','10349594','US','7/16/2019','The present invention relates to a Lactuca sativa seed designated 45-227 RZ. The present invention also relates to a Lactuca sativa plant produced by growing the 45-227 RZ seed. The invention further relates to methods for producing the lettuce cultivar, represented by lettuce variety 45-227 RZ.','Lettuce variety 45-227 RZ','B2',29,'ipg190716.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10350762','utility','10350762','US','7/16/2019','A cleaning robot which performs a predetermined task while autonomously moving includes: a driver which makes the cleaning robot move; an image capturer which detects a movement state indicating whether a different cleaning robot existing in front of the cleaning robot is moving along an obstacle, a direction in which the different cleaning robot exists relative to the cleaning robot, and a distance between the cleaning robot and the different cleaning robot; and a following run controller which controls the driver in order for the cleaning robot to move following the different cleaning robot while keeping a position diagonally behind the different cleaning robot at an opposite side of the different cleaning robot from the obstacle, if the movement state indicates that the different cleaning robot is moving along the obstacle.','Autonomously moving body, movement controlling method, and recording medium storing movement controlling program','B2',14,'ipg190716.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10351196','utility','10351196','US','7/16/2019','A foldable-chair carrier for a bicycle includes a frame that defines a plurality of generally planar, inclined chair-supporting surfaces over the rear wheel of the bicycle. The frame includes a pair of enlarged hooks at the forward, upper portion of the frame, with the hooks being arranged to receive opposite ends of one of the structural tubes of the chair in its folded configuration. The hooks may be sufficiently large to receive two or more of the folded chairs, in a stacked array. The hooks are configured so that even if the bicycle is running on uneven ground, the chairs will be unlikely to be thrown from the frame even in the absence of supplementary tie-downs.','Bicycle attachment for carrying a folding chair','B2',9,'ipg190716.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10351891','utility','10351891','US','7/16/2019','The present invention provides a hydroxyacyl-coenzyme A dehydrogenase gene, an acyl-coenzyme A thiolase gene, genetically engineered strains and a use thereof. The hydroxyacyl-coenzyme A dehydrogenase gene encodes a protein (i) or (ii) as follows: (i) having an amino acid sequence according to SEQ ID NO 2; (ii) derived by substituting, deleting or inserting one or more amino acids in the amino acid sequence defined by (i) and having the same function as that of the protein of (i). The present invention constructs genetically engineered Mycobacterium strains lacking of a hydroxyacyl-coenzyme A dehydrogenase gene or an acyl-coenzyme A thiolase gene, which are used in the preparation of steroidal compounds, such as 1,4-BNA, 4-BNA, 9-OH-BNA, etc. Further, the invention improves the production efficiency and product quality of steroidal drug, improves the utilization of drug precursors, reduces the production costs, and provides the advantages of mild reaction conditions, environmentally friendly, and high economic and social benefits.','Hydroxyacyl-coenzyme A dehydrogenase gene, an acyl-coenzyme A thiolase gene, genetically engineered strains and a use thereof','B2',1,'ipg190716.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10353986','utility','10353986','US','7/16/2019','Some embodiments provide a method for displaying text content on a device. The method receives a set of text content arranged in a single column. The method identifies a separable segment of the text content for display on a device. Based on properties of the text content and the device, the method determines whether the separable segment of the text content meets a set of characteristics for dividing the segment of text content into more than one column for display. When the separable segment of text content meets the set of characteristics, the method displays the segment of text content using more than one column.','Automatically dividing text into multiple columns','B2',25,'ipg190716.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10353994','utility','10353994','US','7/16/2019','Systems, methods, and computer-readable media are disclosed for enhancing an email application to automatically analyze an email thread and generate a compact content summary. The content summary is based on relative content contributions provided by the constituent email messages in the email thread. The content summary may be presented in a special window without disturbing or modifying the email thread or its constituent email messages. The distinctive content summary disclosed herein comprises certain sentences that are automatically gleaned from the email thread, analyzed relative to other sentences, and presented in a chronological sequence so that the user can quickly determine what the email thread is about and/or the current status of the conversation. The content summary is based on email weights, word weights, and intersecting sentence pairs.','Summarization of email on a client computing device based on content contribution to an email thread using classification and word frequency considerations','B2',20,'ipg190716.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10354362','utility','10354362','US','7/16/2019','Methods of detecting an object in an image using a convolutional neural network based architecture that processes multiple feature maps of differing scales from differing convolution layers within a convolutional network to create a regional-proposal bounding box. The bounding box is projected back to the feature maps of the individual convolution layers to obtain a set of regions of interest. These regions of interest are then processed to ultimately create a confidence score representing the confidence that the object detected in the bounding box is the desired object. These processes allow the method to utilize deep features encoded in both the global and the local representation for object regions, allowing the method to robustly deal with challenges in the problem of robust object detection. Software for executing the disclosed methods within an object-detection system is also disclosed.','Methods and software for detecting objects in images using a multiscale fast region-based convolutional neural network','B2',20,'ipg190716.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10355310','utility','10355310','US','7/16/2019','Multi-functional additives containing at least one solid electrolyte interface (SEI) forming group and at least one SEI modifying group are advantageously employed in electrolyte compositions for electrochemical devices. The SEI forming group may comprise an organic carbonate moiety and the SEI modifying group may comprise a heteroatom functional group such as a sulfur containing organic moiety. The electrochemical devices include lithium ion batteries.','Electrolyte compositions for electrochemical devices','B2',20,'ipg190716.xml',0); insert into patents_data(id, type, number, country, date, abstract, title, kind, num_claims, filename, withdrawn) values('10355956','utility','10355956','US','7/16/2019','Methods, systems, and devices are described for wireless communications. A wireless station includes a transmitter to generate a wideband contiguous waveform in a band. The transmitter transmits the waveform that conforms to spectral masking attributes and spectral flatness attributes. The wireless station, or another device supporting spectrum analysis functions, detects a wideband contiguous waveform and performs spectrum analysis of the waveform. The wireless station includes a resolution bandwidth of 25 KHz and a video bandwidth of 7.5 KHz.','Spectral masking for wideband wireless local area network transmissions','B2',20,'ipg190716.xml',0);

クエリが正常に実行されると、「ステートメントは正常に実行されました」というメッセージが表示されます。

[進行状況を確認] をクリックして、目標に沿って進んでいることを確認します。 新しいテーブルを作成して特許データを読み込む

タスク 3. 特許データのテキスト エンベディングを生成して保存する

これまでのところで、ベクトル検索をサポートするようにデータベースを構成し、検索するデータを読み込みました。次は、特許の要約のテキスト エンベディングを生成して patents_data テーブルに追加します。

このタスクではまず、text-embedding-005 という名前の Vertex AI テキスト エンベディング モデルを使用してエンベディングを生成するために、テストクエリを実行します。テストが成功したら、完全なクエリを実行し、patents_data テーブルを更新して、要約テキストに対して生成されたエンベディングを追加します。

テキスト エンベディングを生成するクエリをテストする

  1. Cloud SQL Studio のクエリエディタで、[実行] と同じメニューバーにある [クリア] をクリックして、前のクエリを削除します。

  2. エンベディングを生成するクエリをテストするには、次のクエリをコピーしてクエリ ウィンドウに貼り付け、[実行] をクリックします。

SELECT embedding('text-embedding-005', 'Cloud SQL is a managed, cloud-hosted SQL database service.'); 注: postgresql error: Permission denied on the resource というエラー メッセージが表示された場合は、タスク 1 で割り当てた権限が完全に反映されるまで数分待ってから、クエリを再度実行してください。

正常な出力は次のようになります。

{-0.069205195,0.014191614,-0.05495163,0.07412431,-0.041930363,0.020848516,-0.038112275,-0.008370851,-0.04076421,-0.045720845,-0.03756072,-0.025186405,-0.042957906,-0.051989086,...

abstract_embeddings 列を更新して、生成されたテキスト エンベディングを保存する

  1. Cloud SQL Studio のクエリエディタで、[実行] と同じメニューバーにある [クリア] をクリックして、前のクエリを削除します。

  2. テキスト エンベディングを abstract_embeddings という名前の列に追加するために、次のクエリをコピーしてクエリ ウィンドウに貼り付け、[実行] をクリックします。

UPDATE patents_data set abstract_embeddings = embedding('text-embedding-005', abstract);

クエリが正常に実行されると、「ステートメントは正常に実行されました」というメッセージが表示されます。

[進行状況を確認] をクリックして、目標に沿って進んでいることを確認します。 特許データのテキスト エンベディングを生成して保存する

タスク 4. Cloud SQL for PostgreSQL でテキスト エンベディングを使用してベクトル検索を行う

特許の要約のテキスト エンベディングを生成して保存したので、データに対して初のリアルタイムのベクトル検索を行う準備が整いました。

このタスクでは、クエリを実行して「new natural language processing related machine learning model」というフレーズに基づく類似検索を行い、特許データにこのテキストの完全一致が含まれていないとしても関連性が最も高い上位 10 件の特許をすばやく取得します。

  1. Cloud SQL Studio のクエリエディタで、[実行] と同じメニューバーにある [クリア] をクリックして、前のクエリを削除します。

  2. テキスト エンベディングを使用してベクトル検索を行うには、次のクエリをコピーしてクエリ ウィンドウに貼り付け、[実行] をクリックします。

SELECT id, title, abstract FROM patents_data ORDER BY abstract_embeddings <=> embedding('text-embedding-005', 'A new Natural Language Processing related Machine Learning Model')::vector LIMIT 10;

このクエリは、abstract_embeddings 列の値を使用して、検索フレーズ「new natural language processing related machine learning model」と意味的に最も類似している上位 10 件のデータベース行を検索します。

注目する点として、検索フレーズのエンベディングは、このクエリで動的に生成されます。上記のコード内の「new natural language processing related machine learning model」を任意の新しい検索語句に置き換えて、このクエリをさらに詳しく調べてみてください。

出力は次のようになります。

id title abstract
10347243 Apparatus and method for analyzing utterance meaning Disclosed herein is a method for analyzing an utterance meaning. The ...
10346746 Generating a training model based on feedback A method and apparatus for generating a training model based on feedback ...
10347147 Managing answer feasibility A system, a method, and a computer program product for managing answer feasibility ...
10353994 Summarization of email on a client computing device based on content ... Systems, methods, and computer-readable media are disclosed for ...
10354362 Methods and software for detecting objects in images ... Methods of detecting an object in an image using a convolutional neural network ...
10353986 Automatically dividing text into multiple columns Some embodiments provide a method for displaying text content on a device ...
10348905 System and method for responding to customer calls A computer-based system and method for responding to customer calls ...
10350762 Autonomously moving body, movement controlling method, and recording A cleaning robot which performs a predetermined task while autonomously moving ...
10338681 Systems and methods for multi-output electrostatic haptic effects One illustrative system disclosed herein ...
10338956 Application profiling job management system, program, and method An application profiling system, initiating profiling a software application ...

お疲れさまでした

このラボでは、ベクトル検索をサポートするように Cloud SQL for PostgreSQL データベースを構成する方法、テキスト エンベディングを生成して Cloud SQL for PostgreSQL テーブルに保存する方法、保存されたテキスト エンベディングを使用して Cloud SQL for PostgreSQL でベクトル検索を行う方法の基礎を学習しました。

次のステップと詳細情報

Google Cloud トレーニングと認定資格

Google Cloud トレーニングと認定資格を通して、Google Cloud 技術を最大限に活用できるようになります。必要な技術スキルとベスト プラクティスについて取り扱うクラスでは、学習を継続的に進めることができます。トレーニングは基礎レベルから上級レベルまであり、オンデマンド、ライブ、バーチャル参加など、多忙なスケジュールにも対応できるオプションが用意されています。認定資格を取得することで、Google Cloud テクノロジーに関するスキルと知識を証明できます。

マニュアルの最終更新日: 2025 年 2 月 4 日

ラボの最終テスト日: 2025 年 2 月 4 日

Copyright 2025 Google LLC. All rights reserved. Google および Google のロゴは Google LLC の商標です。その他すべての企業名および商品名はそれぞれ各社の商標または登録商標です。

始める前に

  1. ラボでは、Google Cloud プロジェクトとリソースを一定の時間利用します
  2. ラボには時間制限があり、一時停止機能はありません。ラボを終了した場合は、最初からやり直す必要があります。
  3. 画面左上の [ラボを開始] をクリックして開始します

シークレット ブラウジングを使用する

  1. ラボで使用するユーザー名パスワードをコピーします
  2. プライベート モードで [コンソールを開く] をクリックします

コンソールにログインする

    ラボの認証情報を使用して
  1. ログインします。他の認証情報を使用すると、エラーが発生したり、料金が発生したりする可能性があります。
  2. 利用規約に同意し、再設定用のリソースページをスキップします
  3. ラボを終了する場合や最初からやり直す場合を除き、[ラボを終了] はクリックしないでください。クリックすると、作業内容がクリアされ、プロジェクトが削除されます

このコンテンツは現在ご利用いただけません

利用可能になりましたら、メールでお知らせいたします

ありがとうございます。

利用可能になりましたら、メールでご連絡いたします

1 回に 1 つのラボ

既存のラボをすべて終了して、このラボを開始することを確認してください

シークレット ブラウジングを使用してラボを実行する

このラボの実行には、シークレット モードまたはシークレット ブラウジング ウィンドウを使用してください。これにより、個人アカウントと受講者アカウントの競合を防ぎ、個人アカウントに追加料金が発生することを防ぎます。