Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Extract embeddings values using PredictionServiceClient

オープン
#3,601 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
google-cloud, javascript, node.js

調査の方向性

参照されている行の ai-platform/snippets/predict-text-embeddings.js から始めて、PredictionServiceClient のレスポンスがどのように表現されているかを確認します。embeddings の値にアクセスする方法と、issue に示されている JSON 形式と出力を一致させるためにサンプルまたはそのドキュメントに明確化が必要かどうかを判断します。

索引モデルが issue の本文から書いたものです。

説明

samples

Hi! I'm trying to find how to extract the embeddings values to add them to a json files following this format following the example https://github.com/GoogleCloudPlatform/nodejs-docs-samples/blob/62253bb75d6068e1b44047eac5572246dfaa217b/ai-platform/snippets/predict-text-embeddings.js#L76C69-L76C69:

{"id":"0","embedding":[0.005268869,-0.019839672,0.0035084013,0.0536439,-0.028307509,0.0037563213, ...]}

But not sure how to access or put them into an array. The type is google.protobuf.IValue so in the example it iterates over an array google.protobuf.IValue[]. I'm doing:

const predictions = response.predictions;
for (const prediction of predictions) {
     const value: google.protobuf.IValue = prediction;
     console.log(`\t\tPrediction`, value.structValue); // structValue is the only one not returning undefined
     // this returns: **fields: { embeddings: { structValue: [Object], kind: 'structValue' } }**
}

Thanks

主要言語
JavaScript
スター
3k
フォーク
2k
平均マージ
3日 23時間
マージ済み PR(30日)
30

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

GoogleCloudPlatform/nodejs-docs-samples のほかの issue

GoogleCloudPlatform/nodejs-docs-samples の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。