Alexa ignoring "arrive" in sample utterance and mapping to wrong intent - alexa

I have two intents set up for my Alexa Skill, NextTrainIntent and TrainArrivalIntent. In my sample utterances, I map them like this:
NextTrainIntent what is the next train to {DestinationCity}
NextTrainIntent what's the next train to {DestinationCity}
NextTrainIntent when is the next train to {DestinationCity}
NextTrainIntent when is the next train from {OriginCity}
NextTrainIntent when is the next train from {OriginCity} to {DestinationCity}
NextTrainIntent when is the next train
TrainArrivalIntent when does train {TrainNumber} arrive at {DestinationCity}
TrainArrivalIntent when does train {TrainNumber} arrive
TrainArrivalIntent when does train {TrainNumber} get in
...
When I test this using Amazon's Service Simulator, if I enter the following utterance as text: "when does train 9306 arrive", the
Service Request json shows that it has mapped the utterance to the NextTrainIntent, even though it is an exact match for a sample utterance for the TrainArrivalIntent:
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.ccafa51d-38de-4500-b17b-f94bbee1ad93",
"intent": {
"name": "NextTrainIntent",
If, however, I test the utterance: "When does train 9305 get in", it maps correctly to TrainArrivalIntent.
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.7a415e55-14b3-4789-9a83-0f6cf2f16a6c",
"intent": {
"name": "TrainArrivalIntent",
What's wrong here? In this case, the presence of the word "arrive" is critical to discerning between the two intents. However, Alexa seems to ignore it. How can I make it "arrive" get used?

I removed the "what is the" and the "when is" statements from my samples and it started working.
NextTrainIntent next train from {OriginCity} to {DestinationCity}
NextTrainToFromIntent next train to {DestinationCity} from {OriginCity}
TrainArrivalIntent train {TrainNumber} arrive at {DestinationCity}
TrainArrivalIntent train {TrainNumber} arrive
TrainArrivalIntent train {TrainNumber} get in
TrainArrivalIntent train {TrainNumber} arrive at {DestinationCity}
TrainArrivalIntent train {TrainNumber} get in to {DestinationCity}
TrainArrivalIntent train number {TrainNumber} arrive at {DestinationCity}
TrainArrivalIntent train number {TrainNumber} get in to {DestinationCity}
TrainArrivalIntent train number {TrainNumber} arrive
TrainArrivalIntent train number {TrainNumber} get in
Because there are a few other changes to the speech samples above, I'm not positive that removing the question prefixes is what fixed the problem. As always with machine learning, you often can't get an answer to "why" something works. Whatever the reason, the above sample utterances did make the utterance in the question get recognized properly.

Related

How can I get MarketCapRank from CoinGecko's API

I can use this:
https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd&include_24hr_change=true&include_market_cap=true
to get:
{"bitcoin":{"usd":47498,"usd_market_cap":902977262894.0303,"usd_24h_change":1.1530010412374174}}
Which includes the total market cap of the given coin but I'm wanting to get it's rank, as in BTC should give '1', ETH would give '2', ADA '7' etc.
Basically all the data I'm after is available through the "markets" API but I can't workout how the get a "market block" for a specific coin.
An example of the URL to deliver the top 4 coins by market cap is:
https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=4
Can anyone tell me how to get that data for a specific coin?
I believe you are looking for this:
https://api.coingecko.com/api/v3/coins/bitcoin
Search in the result for: "market_cap_rank":

Azure Search Working with Complex Collections

Our data structure is similar to HotelId 1 example in the link https://learn.microsoft.com/en-us/azure/search/search-howto-complex-data-types
Our requirement is as follows:
Input: City = New York, StateProvince = NY, BaseRate = $100
Select fields: HotelId, HotelName, Description, Tags, Address, Rooms
Filter: Only rooms where BaseRate is less than or equal to Input rate and Address City and State matches input values. In this example, it should only select the first room from Rooms, not all Rooms.
Desired output:
{
"HotelId": "1",
"HotelName": "Secret Point Motel",
"Description": "Ideally located on the main commercial artery of the city in the heart of New York.",
"Tags": ["Free wifi", "on-site parking", "indoor pool", "continental breakfast"]
"Address": {
"StreetAddress": "677 5th Ave",
"City": "New York",
"StateProvince": "NY"
},
"Rooms": [
{
"Description": "Budget Room, 1 Queen Bed (Cityside)",
"RoomNumber": 1105,
"BaseRate": 96.99,
}
]
}
Any help or direction on how to write a query for this or any pointers would be welcome.
The records in the hotels sample index consist of hotels, not rooms. Think of it as an index with Documents and Paragraphs. You may search for a Document (hotel) which has something within a Paragraph (room). The result you get would always be a list of Documents. From what I know there is no way to remove certain complex types from a record in a response.
The query to do what you ask (except filtering out rooms) is this by the way:
search=Address/City:"New York" AND Address/StateProvince:"NY"&$select=HotelId,HotelName,Description,Tags,Address,Rooms&$count=true&searchMode=all&queryType=full&$filter=Rooms/any(room: room/BaseRate lt 100.0)
Possible workarounds:
Design your index with rooms as records
Filter out rooms above the selected base rate in your frontend application.

AWS Blazing text supervised hyperparameter not logging objective metric

I am running a Hyperparameter tuning job using Sagemakers built in training image for Blazing text (blazingtext:latest) however when my jobs complete they only log out #train accuracy:
...
06:00:36 ##### Alpha: 0.0000 Progress: 100.00% Million Words/sec: 0.00 #####
06:13:19 Training finished.
06:13:19 Average throughput in Million words/sec: 0.00
06:13:19 Total training time in seconds: 1888.88
06:13:19 #train_accuracy: 0.4103
06:13:19 Number of train examples: 55783
The Hyperparameter job does not allow for me to pick #train_accuracy as an objective metric, only "validation:accuracy" or train:mean_rho appear in the dropdown.
After the job completes under "Best training job" tab I see:
Best training job summary data is available when you have completed training jobs that are emiting metrics.
Am I missing something obvious?
Ensure there is a validation channel in addition to the "train" channel :

Windows - Extract text from SMS using D-LINK DWM-157

My Industrial Engineering final year project is based upon a weight scale that measures LPG content inside a cylinder, and relays this information to consumers and refillers via SMS.
The SMS reads as follows:
Total Weight: 7.705 kg
LPG Weight: 3.305 kg
LPG Remaining: 82.621%
Wednesday 07.03.2018 -- 17:16:03
I have a D-LINK DWM-157 plugged into my computer, where the SMS messages are received in D-LINK's software. I need to somehow extract the contents of these messages and process/store them in a database.
I personally have minimal programming experience, so I need advice on how to extract this SMS data for further processing.

Alexa sample utterance can't discern slots based on connector words

I have two simple Alexa questions I am trying to get working:
when is the next train from chicago to new york
when is the next train to new york from chicago
In both questions above, the first city gets mapped to the origin and the second to the destination, effectively yielding:
when is the next train *from* new york *to* chicago
instead of
when is the next train *to* new york *from* chicago
I have my sample utterances set up like this:
NextTrainIntent next train from {OriginCity} to {DestinationCity}
NextTrainIntent next train to {DestinationCity} from {OriginCity}
I realize that the connector words are being ignored. But in cases like this, they are critical, because this is how the english language works. Is there any way to make both questions work?
Implement these utterances into two different Intents.
FirstIntent ... {OriginCity} to {DestinationCity}
SecondIntent ...{DestinationCity} from {OriginCity}
Alexa will listen more carefully then.
Or try the Alexa Skill Builder (BETA).

Resources