googleapis / googleapis/google-cloud-node

V2 adaption > inlinePhraseSet not working

Đang mở
#5,259 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
3.2k
Fork
712
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
99

Mô tả

Problem you have encountered:
We're moving from v1p1beta1 with speechContexts to v2 with adaption and inlinePhraseSet. adapation doesn't seem to work.

What you expected to happen:
Use the correct phrase set for translation similar to speechContexts

Steps to reproduce:

Updated the previous working function to the following code:

const client = new speech.v2.SpeechClient();
const phraseSet = {
phrases: [
{ value: "one", boost: 20 },
{ value: "zero", boost: 20 },
{ value: "thousand", boost: 20 },
],
};
const adaptation = {
phraseSets: [{ inlinePhraseSet: phraseSet }],
};

const transcriptionRequest = {
recognizer: recognizerName,
config: {
autoDecodingConfig: {},
adaptation: adaptation,
},
content: audiotrack,
};

Other information (workarounds you have tried, documentation consulted, etc):
Have tried in 6.5.0 and still does not work. There is no documentation for Typescript (only Python) so this is code taken from various websites.

I tired changing the boost to 50 (according to the documentation, you should get an error for any boost value that is not between 0 -20):

phrases: [
{
value: "one",
boost: 50,
},
{
value: "zero",
boost: 50,
},
{
value: "thousand",
boost: 50,
},
],

There is no error reported in the logs but no response comes back from await client.recognize(transcriptionRequest) so the phrases array must be being passed.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.