通过语音为 Bixby 捕获街道地址
Capturing Street Address Through Voice for Bixby
我正在写一个 Bixby 胶囊,其中一个输入是街道地址。
我尝试过的一种方法是创建以下结构:
structure (FullAddress) {
description (Address of a house)
property (addressNumber) {
type (geo.StreetNumber)
min (Required)
description (Address Number)
}
property (addressStreet) {
type (geo.StreetName)
min (Required)
description (Street Name)
}
property (addressSuffix) {
type (geo.StreetSuffix)
min (Required)
description (Street Name)
}
}
使用构造函数将 3 个输入放在一起。
我看到给定一个地址 19 Fake Fields Street
,输入的 geo.StreetName
有时能够理解 Fake Fields
,有时只能理解 Fake
并丢弃 Fields
.
此外,对于 geo.StreetSuffix
值,Bixby 的文本语音有时会听到 app
或 have
而不是 ave
,这会提示用户输入后缀。
有没有办法让 Bixby 更准确地理解街道地址?
基本上你需要更多的训练样本,其中包括2或3个单词作为街道名称。尝试使用 xxx fakexxx fields street 至少 3 个示例,并在模拟器中测试话语 yyy fakeyyy fields street 以查看 Bixby 是否可以捕获 fields 作为地址名称的一部分。这里的目标是训练 Bixby 了解 addressSuffix 之前可能有 2 个甚至 3 个单词。之后,您可以在训练中尝试使用话语 zzz fakezzz creek street,而无需使用 creek,以确认 Bixby 不仅学会了 fields。请在 this article 中阅读更多内容。
语音识别没有简单的方法。您可以包含 vocab model 以强制 "app" 成为 "ave",但是如果用户真的想说 app 或 怎么办?有?我认为用户可以输入 ave 或 blvd,但需要说 avenue 而不是 ave,并且 boulevard 而不是 blvd.
另一种选择是在训练中使用 viv.geo.SearchTerm,在操作中使用 viv.geo.NamedPoint。这让用户可以说出一些不完整的内容,例如“1 Market Street, California”,Bixby 将使用 HERE 地图搜索在旧金山找到它。
要使用,请设置一个 NamedPoint 概念(导入后 viv.geo)
structure (InputAddress) {
role-of (geo.NamedPoint)
}
然后在您的操作中,您可以执行以下操作:
input (namedPoint) {
type (InputAddress)
min (Required) max (One)
default-select {
with-learning
with-rule {
select-first
}
}
}
在这个例子中,使用学习和select-first会自动select第一个地址。如果没有这个,Bixby 将自动建议地址。
namedPoint 将被传递到您的端点,您可以根据需要进行解析。
在训练中,使用geo.SearchTerm——例如:
[g:GetAddressAction] My address is {[g:InputAddress] (665 Clyde Ave Mountain View California)[v:geo.SearchTerm]}
或者对于提示,您可以使用:
[g:GetAddressAction:continue:InputAddress] {[g:InputAddress] (60 S Market)[v:geo.SearchTerm]}
您可以通过使用 viv.geo.ResolveAddressByPlaceID 目标让 Bixby 处理它来获得格式更完整的地址。下面是使用 NamedPoint 和 ResolveAddressByPlaceID 的完整操作。请注意评论中相关文档的链接
action (GetAddressAction) {
type(Search)
description (Get Address)
collect {
// See https://bixbydevelopers.com/dev/docs/dev-guide/developers/library.geo#using-searchterm - used in training
// and https://bixbydevelopers.com/dev/docs/dev-guide/developers/library.geo#namedpoint - used below and for computed-input
input (namedPoint) {
type (InputAddress)
min (Required) max (One)
default-select {
with-learning
with-rule {
select-first
}
}
// hidden - Hide if all you need is address
}
computed-input (address){
type (geo.Address)
min (Optional) max (One)
compute {
intent {
goal: viv.geo.ResolveAddressByPlaceID
value: $expr(namedPoint.placeID)
}
}
}
}
output (geo.Address)
}
我正在写一个 Bixby 胶囊,其中一个输入是街道地址。
我尝试过的一种方法是创建以下结构:
structure (FullAddress) {
description (Address of a house)
property (addressNumber) {
type (geo.StreetNumber)
min (Required)
description (Address Number)
}
property (addressStreet) {
type (geo.StreetName)
min (Required)
description (Street Name)
}
property (addressSuffix) {
type (geo.StreetSuffix)
min (Required)
description (Street Name)
}
}
使用构造函数将 3 个输入放在一起。
我看到给定一个地址 19 Fake Fields Street
,输入的 geo.StreetName
有时能够理解 Fake Fields
,有时只能理解 Fake
并丢弃 Fields
.
此外,对于 geo.StreetSuffix
值,Bixby 的文本语音有时会听到 app
或 have
而不是 ave
,这会提示用户输入后缀。
有没有办法让 Bixby 更准确地理解街道地址?
基本上你需要更多的训练样本,其中包括2或3个单词作为街道名称。尝试使用 xxx fakexxx fields street 至少 3 个示例,并在模拟器中测试话语 yyy fakeyyy fields street 以查看 Bixby 是否可以捕获 fields 作为地址名称的一部分。这里的目标是训练 Bixby 了解 addressSuffix 之前可能有 2 个甚至 3 个单词。之后,您可以在训练中尝试使用话语 zzz fakezzz creek street,而无需使用 creek,以确认 Bixby 不仅学会了 fields。请在 this article 中阅读更多内容。
语音识别没有简单的方法。您可以包含 vocab model 以强制 "app" 成为 "ave",但是如果用户真的想说 app 或 怎么办?有?我认为用户可以输入 ave 或 blvd,但需要说 avenue 而不是 ave,并且 boulevard 而不是 blvd.
另一种选择是在训练中使用 viv.geo.SearchTerm,在操作中使用 viv.geo.NamedPoint。这让用户可以说出一些不完整的内容,例如“1 Market Street, California”,Bixby 将使用 HERE 地图搜索在旧金山找到它。
要使用,请设置一个 NamedPoint 概念(导入后 viv.geo)
structure (InputAddress) {
role-of (geo.NamedPoint)
}
然后在您的操作中,您可以执行以下操作:
input (namedPoint) {
type (InputAddress)
min (Required) max (One)
default-select {
with-learning
with-rule {
select-first
}
}
}
在这个例子中,使用学习和select-first会自动select第一个地址。如果没有这个,Bixby 将自动建议地址。
namedPoint 将被传递到您的端点,您可以根据需要进行解析。
在训练中,使用geo.SearchTerm——例如:
[g:GetAddressAction] My address is {[g:InputAddress] (665 Clyde Ave Mountain View California)[v:geo.SearchTerm]}
或者对于提示,您可以使用:
[g:GetAddressAction:continue:InputAddress] {[g:InputAddress] (60 S Market)[v:geo.SearchTerm]}
您可以通过使用 viv.geo.ResolveAddressByPlaceID 目标让 Bixby 处理它来获得格式更完整的地址。下面是使用 NamedPoint 和 ResolveAddressByPlaceID 的完整操作。请注意评论中相关文档的链接
action (GetAddressAction) {
type(Search)
description (Get Address)
collect {
// See https://bixbydevelopers.com/dev/docs/dev-guide/developers/library.geo#using-searchterm - used in training
// and https://bixbydevelopers.com/dev/docs/dev-guide/developers/library.geo#namedpoint - used below and for computed-input
input (namedPoint) {
type (InputAddress)
min (Required) max (One)
default-select {
with-learning
with-rule {
select-first
}
}
// hidden - Hide if all you need is address
}
computed-input (address){
type (geo.Address)
min (Optional) max (One)
compute {
intent {
goal: viv.geo.ResolveAddressByPlaceID
value: $expr(namedPoint.placeID)
}
}
}
}
output (geo.Address)
}