How can I get Siri to recognize "43rd and Broadway"?

Hi all,

This is a simplification of an AppIntent where I need my phrases to recognize three "regions" and a specific set of numbers associated with those regions.

I am having trouble defining the AppEntity and associated AppShortcut phrases that works well with Siri, which is having trouble extracting numbers for some reason...

Now the example:

Imagine my app provides information surrounding Starbucks establishments on three major thoroughfares in NYC, such as:

Broadway & 26, 40, 43, 54, 63, 75, 86, 95

Madison & 44, 50, 84, 96

Lexington & 43, 48, 55, 63, 67, 77, 85, 96

I need AppEntities, AppShortcuts, and friends that best work with Siri when launched with phrases such as:

"Show 'example' for Madison and 50th in \(.applicationName)",

"Show 'example' on 43rd and Broadway in \(.applicationName)",

Long story short, Siri is picking up my phrases well, but then asking me to answer whether the value is 44, 50, 84, or 96, instead of just hearing that I said: "Madison and 50th"

I've defined streets like this:

public let nycStreetDisplayRepresentations: [DisplayRepresentation] =
[
	DisplayRepresentation(title: "26", synonyms: ["twenty six", "twenty sixth"]),
	DisplayRepresentation(title: "40", synonyms: ["forty", "fortieth"]),
	DisplayRepresentation(title: "43", synonyms: ["forty three", "forty third"]),
	DisplayRepresentation(title: "48", synonyms: ["forty eight", "forty eighth"]),
	DisplayRepresentation(title: "50", synonyms: ["fifty", "fiftieth"]),
	DisplayRepresentation(title: "54", synonyms: ["fifty four", "fifty fourth"]),
	DisplayRepresentation(title: "55", synonyms: ["fifty five", "fifty fifth", "five five"]),
	DisplayRepresentation(title: "63", synonyms: ["sixty three", "sixty third"]),
	DisplayRepresentation(title: "67", synonyms: ["sixty seven", "sixty seventh"]),
	DisplayRepresentation(title: "75", synonyms: ["seventy five", "seventy fifth"]),
	DisplayRepresentation(title: "77", synonyms: ["seventy seven", "seventy seventh", "seven seven"]),
	DisplayRepresentation(title: "84", synonyms: ["eighty four", "eighty fourth"]),
	DisplayRepresentation(title: "85", synonyms: ["eighty five", "eighty fifth"]),
	DisplayRepresentation(title: "86", synonyms: ["eighty six", "eighty sixth"]),
	DisplayRepresentation(title: "95", synonyms: ["ninety five", "ninety fifth"]),
	DisplayRepresentation(title: "96", synonyms: ["ninety six", "ninety sixth"])
]

And an entity like this:

public struct MadisonThings: AppEntity, Identifiable {
	
	public let id: Int

	public var displayRepresentation: DisplayRepresentation {
		nycStreetDisplayRepresentations[id-1]
	}

	public static var typeDisplayRepresentation = TypeDisplayRepresentation(
		name: "Madison"
		, synonyms: ["Madison Ave"]
	)

	public static var defaultQuery = MadisonTHingsQuery()
}

An EntityQuery:

public struct MadisonThingsQuery: EntityQuery, EntityStringQuery
{
	...attempts to find synonyms in the phrase
}

Intent:

public struct ShowMadisonThingsIntent: AppIntent {
{
    @Parameter(
        title: "Street Number",
        description: "The street number (e.g., 5, 12, 44)"
    )
    var streetNumber: MadisonThings // I have also tried just plain 'int' to no avail
}

And finally the shortcuts:

	static var appShortcuts: [AppShortcut] {
		return [
			AppShortcut(
				intent: ShowMadisonThingsIntent(),
				phrases: [
					"Show example for Madison and \(\.$streetNumber) in \(.applicationName)",
					"Show example on \(\.$streetNumber) in \(.applicationName)",
...

This should be very simple, I think, and I've tried multiple ways of extracting numbers from my speech, but for some reason this is not working well at all.

Thanks for your help!

Answered by Frameworks Engineer in 891912022

App Shortcut phrases are meant to be short and memorable. Complex phrases with many possibilities are beyond what people can be expected to remember, and what the system can understand. It also places additional burden on your app to understand the different language people may use to refer to locations.

We suggest making a single, or few App Shortcut phrases that initiate a voice experience. For example, "Show examples in (.applicationName)". From there, you can ask the person for the region or thoroughfare, either with a requestValue(), or a requestDisambiguation() dialog request. With a requestDisambiguation() you could potentially ask the person to choose from a subset of entities relevant to them, rather than having to parse their input from a requestValue().

This adds an additional step for the person using your App Shortcut, but ultimately it will help them take the action they meant to take.

The short version of the question is: How can I define and extract numeric parameters (4, four, fourth) from shortcut phrases, reliably?

Siri keeps asking me to choose the number via a dialog

App Shortcut phrases are meant to be short and memorable. Complex phrases with many possibilities are beyond what people can be expected to remember, and what the system can understand. It also places additional burden on your app to understand the different language people may use to refer to locations.

We suggest making a single, or few App Shortcut phrases that initiate a voice experience. For example, "Show examples in (.applicationName)". From there, you can ask the person for the region or thoroughfare, either with a requestValue(), or a requestDisambiguation() dialog request. With a requestDisambiguation() you could potentially ask the person to choose from a subset of entities relevant to them, rather than having to parse their input from a requestValue().

This adds an additional step for the person using your App Shortcut, but ultimately it will help them take the action they meant to take.

duplicate -- sorry

How can I get Siri to recognize "43rd and Broadway"?
 
 
Q