Giter Club home page Giter Club logo

complete-shakespeare's Introduction

Complete Shakespeare Alexa skill

Alexa skill that queries the works of Shakespeare from Dgraph's Slash GraphQL database.

This project is split across 3 repositories:

  1. dgraph-shakespeare-data: Contains the RDF file and GraphQL schema needed to setup DGraph.
  2. complete-shakespeare (current repository): Contains code for Alexa skill.
  3. GraphiQL explorer

GraphiQL explorer

https://secretshardul.github.io/shakespeare-api/

Update: the skill is live on Amazon

Install link

Demo video

Complete shakespeare demo The demo was recorded when the skill was pending approval. The skill is now live. You can directly test it on your Alexa device without going to the Alexa console.

Architecture

Architecture

Instructions to run code

These steps are for building the skill from its code.

Setup Dgraph database (optional)

  1. Follow instructions from dgraph-shakespeare-data repository to setup your Dgraph database on Slash.
  2. Fork this repository.
  3. Find the GraphQL endpoint in lambda/api.js and replace it with your own.
  4. Commit changes and push to github.

Alternately you can use my repository and skip the above steps. The endpoint https://lowly-statement.ap-south-1.aws.cloud.dgraph.io/graphql is provided in code. The slash cluster for this endpoint is up and running.

Setup Alexa skill

  1. Sign up on Alexa developer portal

  2. Create new skill: Set model to custom and set hosting method to Alexa hosted(Node.js). Give the skill any name of your choice. Set the default language to English(IN) (this is important). Press create skill. Skill type

  3. In the choose a template screen, press import skill button. Pass the link to this repository https://github.com/secretshardul/complete-shakespeare.git. Alternately if you created your own backend, pass the link of your forked repo. The link must end with .git. import repo

  4. Change invocation name: Go to build > invocation > add the name complete shakespeare. Press save and build buttons.

  5. To test this skill: Go to test menu and change Skill testing is enabled in option to development.

Usage

Invoke the skill by saying or typing complete shakespeare. Currently the skill has 4 intents:

  1. Who said what and where?

    Valid inputs:

    "who said {phase}"
    "who said the phase {phase}"
    

    Eg. Who said et tu, Brute?

    who said et tu, Brute?

  2. Who is the character X?

    Valid inputs:

    "who is {name}"
    "who is the character {name}"
    

    Eg. who is Orlando?

    Who is Orlando?

  3. List the works from a particular genre:

    The genres are history, tragedy, comedy, poem and sonnet. The genre word is stemmed, so "what are the tragedies of shakespeare" is valid input.

    Valid inputs:

    "what are the {genre} of shakespeare",
    "tell me about the {genre} of shakespeare",
    "list the {genre} of shakespeare",
    "list the works of shakespeare of the genre {genre}",
    "what are the works of shakespeare of the genre {genre}"
    

    Eg. What are the tragedies of Shakespeare? What are the tragedies of Shakespeare?

  4. Tell a random quote:

    Valid inputs are of formats:

    "quote",
    "tell me a quote",
    "tell me a shakespeare quote",
    "shakespeare quote"
    

    Eg. Tell me a quote Quote

Code structure

  1. /lambda: It contains Node.js code. This is executed by AWS Lambda when Alexa sends an intent. AWS Lambda generates the output message and passes it to Alexa for speech generation.
  2. /skill-package/interactionModels/custom/en-IN.json: Contains the intents and slots.

Caveats

  1. For the same email, Alexa hosted skill resources are hosted separately from your AWS account.
  2. Environment variables are not supported in AWS hosted skills. Endpoint needs to be hard coded.
  3. A separate git repository is created in AWS Codecommit when code is imported from git. Any code changes go here and they remain separate from your Github repository.

complete-shakespeare's People

Contributors

secretshardul avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

manikant92

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.