API and Amazon Echo - amazon-web-services

My group and I are first-year computer science students and have been working on a project for school the last two months or so. We want to create a faculty directory for our university using the Amazon Echo. We already have an API (http://moonlight.cs.sonoma.edu/api/v1/directory/person/). What we want to do is have the user ask Alexa what is a faculty member's phone number, email, building name, and office, and she will return with the answer from this API.
We do not know how to do this, unfortunately. How do we write a code that reads from this API and how do we implement it? Since our skill is written in Javascript, I think we would prefer to stick with that. We are completely stuck, however. I apologize if this is a vague.
Cheers!

You would need to split your solution up into a few different things... you'll need to configure an "Intent Schema" on the Amazon Developer Platform -- this defines the functions that your skill can perform.
For each intent you will then need some sample utterances, which will tell Alexa what sort of phrases to listen for. You may also need some Custom Slot Type definitions depending on what you are doing... for example if you want to have Alexa answer questions such as "Alexa ask what time is the next train from "... would be a Custom Slot with values containing all the station names that your API can get times for.
You can implement your Skill using JavaScript with AWS Lambda, or provide your own backend (e.g. Node JS running on AWS Elastic Beanstalk or Heroku or anywhere you want to put it). I have a blog post that will walk you through the process -- this uses Python as a demonstration but the majority of the setup and configuration will be exactly the same if implementing in JavaScipt.
If implementing in JavaScript, I recommend looking at the Alexa Skills Kit for Node which is provided by Amazon.

Related

Positive/Negative Feedback from Amazon Lex/CloudFormation

Please forgive the completely noob question.
Background: I am not a developer - at best a hobby programmer who has enough knowledge to be dangerous/useful to my superiors. The AWS/Cloud expert at my company just left, gave me a 30 minutes whirlwind tour of AWS and said I'm now the expert...
AWS Cloudformation allows me to provide (basically) a "user" utterance that signifies Positive/Negative Feedback from the user of the bot: WebAppConfNegativeFeedback WebAppConfPositiveFeedback.
How do I process those utterances to provide useful information to improve the bot's responses?
It's stateless, so I'm not sure how to grab the context of the question and feedback to notify our company that some question provided a bad answer (good answer not so important.)
Any help you can provide, at least to point to me how to interpret this information is more than welcome. I hate feeling like a fish out of water...
Hi there and sorry to hear about your predicament.
AWS Cloudformation is a tool set that allows a developer to script the creation of resources; Cloudformation itself is not processing your user's requests.
As you've alluded to, AWS Lex is the service that is used to interact with users.
Here's a link to the Getting Started guide which I hope will help you get a better understanding of just how Lex works so that the rest of this answer makes more sense.
Essentially Lex uses a combination of intents with slots to complete a task. An intent uses utterances as an entry point to understanding what action a user wants to take while slots are used to collect the detail surrounding that action.
As an example, we could have an utterance "set my alarm clock" that activates an intent called SetAlarm. We then need to ask the user for the time that they'd like the alarm to be set for. This value is store in a slot of type date.
We then harness the power of AWS Lambda functions to 'fulfill' the intent. In this case, we will use the given information to set the alarm at the user's specified time.
With regards to your scenario, I am making an assumption that you have two fields called WebAppConfNegativeFeedback and WebAppConfPositiveFeedback somewhere in your Cloudformation script. These contain positive and negative utterances respectively. Again, making an assumption then that these fields are used to either build a Lex bot or it could be that these values are used in a supporting Lambda function to categorise the utterance as either positive or negative.
If it is a case that you have a Lambda function, you should be able to use that function to fire all another process should it be determined that the user's interaction was negative. That process could be an email to a support team etc. The Lambda function would have the conversation state passed in as an argument. You could interrogate this argument to get the context of the conversation.
Please provide more insight if you can so that a more specific answer can be provided.

Differences between using Lex and Alexa

I'm building an Alexa skill that will allow Alexa users to interact with a consumer facing e-commerce site. There is functionality to call a representative that already exists on the site. Now, I want to build out a voice app as a side project that extends that same option via a conversation. There will be a need for slots like location, category of call, etc. It's basically an Application/Transactional bot.
In the future, if this is successful, I'd like that same general app to be accessible on different IoT devices (like Google Home Assistant, etc.) Therefore, I'd like to abstract out the voice interactions and have the same (general) flow and API to interact with.
This leaves me doing some research on different technologies like api.ai, wit.ai, Lex, etc.
But, since this is an app for Alexa and I already rely on AWS and Amazon in general, I think I'd prefer to use Lex or just write a native Alexa app for now.
I'm having a hard time understanding the differences between the two. I understand that Alexa was built using Lex and I see that they have similar concepts like intent, slots, etc.
But, I'm looking for any differences between the two services:
Would using Lex allow me to more easily integrate with other devices? Or is there any benefit?
Would using Lex allow me greater flexibility in designing/modifying the flow of a conversation? It seems like Lex is a little more complex and, therefore, might allow greater functionality.
Or is it just that Lex offers nearly the exact same functionality and is just meant for devices that aren't Alexa?
Does Lex offer any more analytics processing than Alexa? In Alexa I can only see intents/slots, but if I could see the actual text in Lex, that would be ideal.
Alexa Skills Kit (ASK) is used to build skills for use in the Alexa ecosystem and devices and lets developers take advantage of all Alexa capabilities such as the Smart Home and Flash Briefing API, streaming audio and rich GUI experiences. Amazon Lex bots support both voice and text and can be deployed across mobile and messaging platforms.
Lex Faqs
In my view (very limited Alexa dev experience) AWS Lex allows greater control over the bot dialog. It defines separate validation and fulfilment code hooks, enables specific prompts for slots on the UI, supports programmatic transitions between intents, gives proper versioning and alias handling, etc... so it seems it's more of an enterprise offering as opposed to "consumer-level" Alexa skills.
But surprisingly it lacks a few important features, e.g. it does not have a built in "boolean" slot type, so you have to code around yes/no questions. Or there are no Cloudwatch logs for lex at all. Also the (growing) list of integrations will make it more generic.
But despite being a huge AWS fan, I have to say that api.ai seems to be a reasonably more polished, feature rich proposition at least for now.
With regards to integrations with other devices, I do not think any of these platforms promise that. It seems that if you target Google home, than it's their platform, if you target Alexa, then hmm it's alexa or api.ai (not sure if Google will push this in the future). But if you plan to integrate with chat platforms, or directly into web applications, then I think all major platforms can give you that, or in the near future.
By the way, have you checked IBM Watson or Microsoft Bot framework (with LUIS)? They are also very capable, complete frameworks, too, don't discount them!
There is a risk using an external NLP service to process raw text delivered by Alexa over its native hobbled interaction model. Amazon may not certify your skill. This is unfortunate to hear, but their excuse is the threat of exposing private user data users may not realize they're sending. This is sickening because to do anything robust you must avoid Alexa's native NLP system. And I don't believe LEX is advanced much beyond it. You're caught in a bind. This is what will set Alexa back perhaps in the long run with respect to natural conversation. We've been preparing our skis in stealth mode, and an Amazon rep said our approach was a "hack" and may not get certification when published. I'm not yet sure what the answer is. Does this raw text issue exist with Google Home or other voice platforms? Beware.
"Alexa for Business is intended to enable organizations to take advantage of Amazon’s voice enabled assistant, Alexa. Alexa for Business provides Alexa capabilities that make workers more productive, while working alongside all of the other capabilities that Alexa has today like music, smart home controls, shopping, and thousands of third party skills.
Amazon Lex is intended to help build custom conversational interfaces and chat bots for use cases like call centers or application based bots. Bots built with Lex can be highly customized and exist separately from Alexa but they do not take advantage of Alexa’s built in capabilities or third party skills. Both Alexa for Business and Amazon Lex use Amazon’s deep learning capabilities that provide Automatic Speech Recognition (ASR) and Natural Language Understanding (NLU)."

Displaying Current Amazon Prices In Website

This is just a general question, but I'm wondering if there's an existing API that displays the current price for an item on Amazon? As in, if the price changes, the site will reflect that change as well.
If not, would building a web crawler to go through and find the Amazon items of my choice be the best way to build my own version of this? If so, what language would you recommend to begin this sort of project.
I'm not sure if I should have actually asked this in SuperUser but I appreciate the input. Thanks guys!
There are plenty of web crawling services for this task.
https://import.io/
https://www.kimonolabs.com/
http://www.diffbot.com/
If you want to make your own, I recommend node.js because it's asynchronous behavior.

Amazon AWS / Rakuten API - Inventory Management

I am sure this question may seem a bit lacking, but I literally do not know where to begin with. I want to develop a solution that will allow me to manage ALL of my Amazon and Rakuten/Buy.com inventory from my own website.
My main concern is keeping the inventory in sync, so the process would be as follows:
1.Fetch Orders sold today
a.Subtract the respective quantities
2.Fetch Rakuten orders sold
a.Subtract the respective quantities
3.Update Internal DB of products
a.Send out updated feeds to Amazon and Rakuten.
Again, I apologize if this question may seem a bit lacking, but I am having trouble understanding how exactly to implement this, any tips would be appreciated
For the Amazon part look at https://developer.amazonservices.com/
Rakuten, I think you will be able to do what you want with it via the FTP access, I'm still researching this. If I find more I'll respond with a better answer.
In order to process orders, you'll need to use be registered with Rakuten in order to get an authorisation token. For the API doc etc... try sending an email to support#rakuten.co.uk.
Incidentally, to send out updated feeds, you'll need to use the inventory API in order to update stock quantities (given that you'll be selling the same item Amazon etc..).

Free service that allows storing game data online?

I have created a small game in Java and I would like to add the ability for a player to publish his highscores online.
I'm willing to write the server software myself (it's easy these days with Ruby Mongrel, or even C++). I just need to have some sort hosting. One solution that immediately comes to mind is Amazon EC2. But that's kind of expensive for my needs. Since the requirements are very minimal (I don't even need a website, just a web service) I think there may be a cheaper solution out there.
Does anyone know of a free or cheap provider for this kind of thing?
Update
For those interested, this is solution I came up with:
a SliceHost
purchased a domain name
C++ HTTP server
built upon the Poco HTTPServer
uses SQLite database via Poco Data
Server implements a REST API supporting
High Score table
/hs content type deduced from accept header
/hs.xml forces xml
/hs.txt forces plain text
/hs/add html form, does a POST using XMLHttpRequest
/hof Hall of Fame, content type deduced from accept header
/hof.txt forces plain text
/hof.xml forces xml
game: my own Tetris clone written in Clojure
Something like Slicehost or any other small-scale VPS provider could probably work. You might even be able to write it as a small app and publish it on Google App Engine, which is free up to a certain point.
google app engine comes to mind: http://code.google.com/appengine/