alexa-js / alexa-utterances Goto Github PK
View Code? Open in Web Editor NEWgenerate expanded utterances for Amazon Alexa from a template string
License: MIT License
generate expanded utterances for Amazon Alexa from a template string
License: MIT License
Hi,
I wanted to ask you if there is any way to basically compress the samples. Let's say I have three utterances as input:
"why is it happening tonight",
"where is it happening tonight",
"when is it happening tonight"
and as output I want to get an alexa alike utterance syntax that "compresses" my utterances:
"(why|where|when) is it happening tonight"
Is something like this possible to create using your library? I'd appreciate your feedback and help. Thank you!
Best regards,
Ana
This patch is currently needed to support custom slot types:
Would you be willing to apply this change to master/npm?
Thanks a lot!
I have been writing out the output of the utterances to a file. From there I need to paste it into the developer console. The issue arose last night as my interaction model was not saved. I did a bit of research and it came down to a tab character between the intent and the utterance. Sure enough if I replace the tab with a space Amazon does not balk. I realize this is on Amazon a bit but ATM its a bit fragile. Any chance of changing the delimiter to a space vs. a tab?
LMK if you want coveralls for code coverage like in alexa-app and others, I'll contribute.
I need my Utterance to output something like
nearbyPOIHotel closest {Query} near my hotel
Query
being of AMAZON.SearchQuery type. Is this possible?
Would you like to move this repo into the newly created alexa-js organization, https://github.com/alexa-js?
This would reduce bus factor as currently only @mreinstein can add contributors to this project. By moving org admins can at least add new people, currently that's @matt-kruse and myself.
If you do want to do this, because Github requires one be admin of both source and destination, transfer the repo to me (@dblock) and I'll immediately move it to the org.
I'd like to be able to provide something like "turn {thing,on}" to receive both "turn thing on" and "turn on thing". Any thoughts on that? (i might even be able to do a PR on it, if i find some time in the near future, but would like some input on the syntax, if anyone knows of anything that would make more sense)
Nested groups are valuable when alternating pronouns or articles of speech in an utterance. For example:
(The best|(A|My) favorite) movie is {Movie}
should expand to:
The best movie is {Movie}
A favorite movie is {Movie}
My favorite movie is {Movie}
I'll work on creating a PR for this functionality.
sorry for delay on this. There are several issues #2 #5 #6 that deal with changes related to Amazon Alexa's recent improved built-ins and custom slot types.
I've come to the conclusion that much of the functionality in this module is duplication of the new capabilities. There are the 2 bits that are still useful IMO:
Here are my thoughts on what might be done in 2.x:
LITERAL
slot typeNUMBER
, DATE
, TIME
, and DURATION
to the AMAZON.NUMBER
, AMAZON.DATE
, etc. equivalentsI haven't done any of this yet, just talking about next steps. Open for feedback, ideas, etc.
Here is a repl example with what I'm toying around with https://repl.it/repls/EminentWisePlane
Basically I would expect to get all permutations of the shower
slot as well but it just uses the same value every time, is this intended or am I doing something wrong?
Amazon is deprecating the use of Literals in Alexa by Nov 30 2016. It was a little hard to read the README.md in the context of this, although I assume we can count on using the custom slot syntax in the future.
Great stuff!
Cheers
I know I can use {-|Fruit}
to leave the {Fruit}
custom slot unparsed.
But is there a way to combine that with the "Optional Words" syntax, {favorite |}
, to render one version with the slot, and one without it?
For example, something like I like {-|Fruit|} ice cream
which would return both I like {Fruit} ice cream
and I like ice cream
.
@mreinstein There seems to be a bug in the server generation of utterance permutations. For example the following:
"utterances": ['{to|} set temperature to {64-80|number}']
generates utterances as follows:
setTempsIntent to set temperature to {sixty four|number}
setTempsIntent set temperature to {sixty five|number}
setTempsIntent to set temperature to {sixty six|number}
setTempsIntent set temperature to {sixty seven|number}
...
but what I believe should be generated is:
setTempsIntent to set temperature to {sixty four|number}
setTempsIntent set temperature to {sixty four|number}
setTempsIntent to set temperature to {sixty five|number}
setTempsIntent set temperature to {sixty five|number}
setTempsIntent to set temperature to {sixty six|number}
setTempsIntent set temperature to {sixty six|number}
setTempsIntent to set temperature to {sixty seven|number}
setTempsIntent set temperature to {sixty seven|number}
...
Add your +1 if you want danger-js as well, for now it can be as simple as nagging that the contributor hasn't updated CHANGELOG.
This is excellent work! Just wondering if you wouldn't mind adding a license to the project, so folks can contribute back. Thanks!
utterances not keeping braces around slot names when generating content.
Also slots are optional, please remove if empty.
From this:
{
"slots": {"date": "AMAZON.DATE", "city": "AMAZON.US_CITY"},
"utterances": [
"what movies are playing {on |} {date}",
"what movies are playing {in|near|around} {city}",
"what movies are playing {in|near|around} {city} {on |} {date}",
"what movies are playing {on |} {date} {in|near|around} {city}"
]
}
Generates this:
{
"intents": [
{
"intent": "AMAZON.HelpIntent",
"slots": []
},
{
"intent": "AMAZON.StopIntent",
"slots": []
},
{
"intent": "AMAZON.CancelIntent",
"slots": []
},
{
"intent": "GetMoviesIntent",
"slots": [
{
"name": "date",
"type": "AMAZON.DATE"
},
{
"name": "city",
"type": "AMAZON.US_CITY"
}
]
}
]
}
GetMoviesIntent what movies are playing on date
GetMoviesIntent what movies are playing date
GetMoviesIntent what movies are playing in city
GetMoviesIntent what movies are playing near city
GetMoviesIntent what movies are playing around city
GetMoviesIntent what movies are playing in city on date
GetMoviesIntent what movies are playing near city on date
GetMoviesIntent what movies are playing around city on date
GetMoviesIntent what movies are playing in city date
GetMoviesIntent what movies are playing near city date
GetMoviesIntent what movies are playing around city date
GetMoviesIntent what movies are playing on date in city
GetMoviesIntent what movies are playing date in city
GetMoviesIntent what movies are playing on date near city
GetMoviesIntent what movies are playing date near city
GetMoviesIntent what movies are playing on date around city
GetMoviesIntent what movies are playing date around city
I made this online demo tool to help my people test the utterance generation. I thought you might like to see it because a lot of the other utterance expanders have an online demonstration.
Thanks for such a neat project!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.