Giter VIP home page Giter VIP logo

alexa-latin-trainer's Introduction

Alexa Skill - Latein Trainer - Latintrainer

An AWS Lambda function to learn Latin vocabulary.

To learn more about the LatinTrainer Project click here.

Features

  • Choose direction of translation (Latin-German or German-Latin)
  • Choose the mode of learning (Progress, Random und Chapter)
  • Highscore functionality implemented

Setup

To run this skill you need to do two things. The first is to deploy the example code in lambda, and the second is to configure the Alexa skill to use Lambda.

AWS Lambda Setup

Refer to Hosting a Custom Skill as an AWS Lambda Function reference for a walkthrough on creating a AWS Lambda function with the correct role for your skill. When creating the function, select the “Author from scratch” option, and select the Java 8 runtime.

To build the sample, open a terminal and go to the directory containing pom.xml, and run 'mvn org.apache.maven.plugins:maven-assembly-plugin:2.6:assembly -DdescriptorId=jar-with-dependencies package'. This will generate a zip file named "latintrainer-1.0-jar-with-dependencies.jar" in the target directory.

Once you've created your AWS Lambda function and configured “Alexa Skills Kit” as a trigger, upload the JAR file produced in the previous step and set the handler to the fully qualified class name of your handler function. Finally, copy the ARN for your AWS Lambda function because you’ll need it when configuring your skill in the Amazon Developer console.

Alexa Skill Setup

Now that the skill code has been uploaded to AWS Lambda we're ready to configure the skill with Alexa. First, navigate to the Alexa Skills Kit Developer Console. Click the “Create Skill” button in the upper right. Enter “LatinTrainer” as your skill name. On the next page, select “Custom” and click “Create skill”.

Now we're ready to define the interaction model for the skill. Under “Invocation” tab on the left side, define your Skill Invocation Name to be Latintrainer.

Now it’s time to add an intent to the skill. Click the “Add” button under the Intents section of the Interaction Model. Leave “Create custom intent” selected, enter “SetConfigIntent” for the intent name, and create the intent. Now it’s time to add some sample utterances that will be used to invoke the intent. For this example, we’ve provided the following sample utterances, but feel free to add others.

Konfigurieren
Settings
Einstellungen

Now we need to add some Intents to configure the skill. There are three more Intents concerning configuration options. "SetModeIntent" with the utterances:

Waehle Modus {mode}

Let's add a Slot Type. You can find it below Built-In Intents.Click "Add Slot Type" and under "Create custom slot type", enter the name as "LIST_OF_MODES". Add below values one at a time for this slot type.

Kapitel
Fortschritt
Zufall

Second configuration option is triggered with the "SetDirectionIntent".

Waehle Richtung {dir}

It has an own Slot Type named "LIST_OF_DIRS" containing the values:

Deutsch
Lateinisch

Finally you can choose the chapter to start with by triggering "SetChapterIntent".

Waehle Kapitel {chap}

Create a slot "chap" and select AMAZON.NUMBER als Slot Type.

In de_DE.json model-file there are more intents listed. You must create utterances but don't need any special Slot Types.

Since AMAZON.CancelIntent, AMAZON.HelpIntent, and AMAZON.StopIntent are built-in Alexa intents, sample utterances do not need to be provided as they are automatically inherited.

The Developer Console alternately allows you to edit the entire skill model in JSON format by selecting “JSON Editor” on the navigation bar. For this sample, the following JSON schema can be used.

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "lateintrainer",
            "intents": [
                {
                    "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "SetModeIntent",
                    "slots": [
                        {
                            "name": "mode",
                            "type": "LIST_OF_MODES"
                        }
                    ],
                    "samples": [
                        "Waehle Modus {mode}",
                        "Modus {mode}"
                    ]
                },
                {
                    "name": "SetDirectionIntent",
                    "slots": [
                        {
                            "name": "dir",
                            "type": "LIST_OF_DIRS"
                        }
                    ],
                    "samples": [
                        "Waehle Richtung {dir}",
                        "Richtung {dir}",
                        "{dir}"
                    ]
                },
                {
                    "name": "SetConfigIntent",
                    "slots": [],
                    "samples": [
                        "Konfigurieren",
                        "Einstellungen",
                        "config",
                        "Settings",
                        "Session bearbeiten"
                    ]
                },
                {
                    "name": "NextWordIntent",
                    "slots": [],
                    "samples": [
                        "Starte direkt",
                        "Neues Wort",
                        "Ueberspringen",
                        "Next"
                    ]
                },
                {
                    "name": "CheckAnswerIntent",
                    "slots": [
                        {
                            "name": "Answer",
                            "type": "LIST_OF_ANSWERS"
                        }
                    ],
                    "samples": [
                        "Die Antwort ist {Answer}",
                        "check {Answer}"
                    ]
                },
                {
                    "name": "NoIdeaIntent",
                    "slots": [],
                    "samples": [
                        "weiß nicht",
                        "keine Ahnung",
                        "kein Plan"
                    ]
                },
                {
                    "name": "TellMeIntent",
                    "slots": [],
                    "samples": [
                        "Auflösen",
                        "Sags mir"
                    ]
                },
                {
                    "name": "WhatsMySuccessIntent",
                    "slots": [],
                    "samples": [
                        "Wie ist mein Fortschritt",
                        "In welchem Kapitel bin ich",
                        "Wie stehe ich",
                        "Wo stehe ich",
                        "Welches Kapitel",
                        "Fortschritt"
                    ]
                },
                {
                    "name": "RepeatWordIntent",
                    "slots": [],
                    "samples": [
                        "Wiederholen",
                        "Nochmal",
                        "Wie bitte"
                    ]
                },
                {
                    "name": "WhatsMyHighscoreIntent",
                    "slots": [],
                    "samples": [
                        "Punktestand",
                        "Wie viele Punkte hab ich gerade",
                        "Was ist mein Highscore",
                        "Highscore"
                    ]
                },
                {
                    "name": "AMAZON.PauseIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.ResumeIntent",
                    "samples": []
                },
                {
                    "name": "SetChapterIntent",
                    "slots": [
                        {
                            "name": "chap",
                            "type": "AMAZON.NUMBER"
                        }
                    ],
                    "samples": [
                        "waehle Kapitel {chap}",
                        "Kapitel {chap}"
                    ]
                },
                {
                    "name": "AMAZON.NavigateHomeIntent",
                    "samples": []
                }
            ],
            "types": [
                {
                    "name": "LIST_OF_ANSWERS",
                    "values": [
                        {
                            "name": {
                                "value": "Sonne"
                            }
                        },
                        {
                            "name": {
                                "value": "Haus"
                            }
                        },
                        {
                            "name": {
                                "value": "Freund"
                            }
                        },
                        {
                            "name": {
                                "value": "Lehrer"
                            }
                        },
                        {
                            "name": {
                                "value": "Eifer"
                            }
                        },
                        {
                            "name": {
                                "value": "lieben"
                            }
                        },
                        {
                            "name": {
                                "value": "vor"
                            }
                        },
                        {
                            "name": {
                                "value": "Berg"
                            }
                        },
                        {
                            "name": {
                                "value": "Wort"
                            }
                        },
                        {
                            "name": {
                                "value": "Recht"
                            }
                        },
                        {
                            "name": {
                                "value": "Gesetz"
                            }
                        },
                        {
                            "name": {
                                "value": "anvertrauen"
                            }
                        },
                        {
                            "name": {
                                "value": "tapfer"
                            }
                        },
                        {
                            "name": {
                                "value": "versuchen"
                            }
                        },
                        {
                            "name": {
                                "value": "zurückkehren"
                            }
                        },
                        {
                            "name": {
                                "value": "gut"
                            }
                        },
                        {
                            "name": {
                                "value": "schwer"
                            }
                        },
                        {
                            "name": {
                                "value": "nur"
                            }
                        },
                        {
                            "name": {
                                "value": "kommen"
                            }
                        },
                        {
                            "name": {
                                "value": "sehen"
                            }
                        }
                    ]
                },
                {
                    "name": "LIST_OF_DIRS",
                    "values": [
                        {
                            "name": {
                                "value": "Deutsch"
                            }
                        },
                        {
                            "name": {
                                "value": "Lateinisch"
                            }
                        }
                    ]
                },
                {
                    "name": "LIST_OF_MODES",
                    "values": [
                        {
                            "name": {
                                "value": "Zufall"
                            }
                        },
                        {
                            "name": {
                                "value": "Fortschritt"
                            }
                        },
                        {
                            "name": {
                                "value": "Kapitel"
                            }
                        }
                    ]
                }
            ]
        }
    }
}

Once you’re done editing the interaction model don't forget to save and build the model.

Let's move on to the skill configuration section. Under “Endpoint” select “AWS Lambda ARN” and paste in the ARN of the function you created previously. The rest of the settings can be left at their default values. Click “Save Endpoints” and proceed to the next section.

Finally you're ready to test the skill! In the “Test” tab of the developer console you can simulate requests, in text and voice form, to your skill. Use the invocation name along with one of the sample utterances we just configured as a guide. You should also be able to go to the Echo webpage and see your skill listed under “Your Skills”, where you can enable the skill on your account for testing from an Alexa enabled device.

At this point, feel free to start experimenting with your Intent Schema as well as the corresponding request handlers in your skill's implementation. Once you're finished iterating, you can optionally choose to move on to the process of getting your skill certified and published so it can be used by Alexa users worldwide.

alexa-latin-trainer's People

Contributors

ekupris avatar eulersexception avatar gsocher avatar suglio avatar

Watchers

 avatar

alexa-latin-trainer's Issues

Choose direction

As the user, I want to be able to choose whether Alexa asks for German or Latin words.

Acceptance Criteria:

  • Translation direction can be chosen.

Add words

As user, i want to be able to add new words so that my vocabulary is getting bigger. Acceptance Criteria: - New words can be added.

Save progress

As the user, I want Alexa to know which words I already repeatedly answered correctly, and which words I don't know that well.

Acceptance criteria:

  • Alexa saves my success/ failure

Aufgabe 4

bitte Aufgabe 4 aus SWE1 Praktikum implementieren

Evaluate answer

As the user, I want to know whether my answer is correct or not.

Acceptance criteria:

  • Alexa gives accurate feedback

Save Progress

As user, i want to be able to save my progress so that i can continue at the point i stopped at. Acceptance Criteria: - State can be saved.

Get answer

As a user, I want to be able to get the correct answer to the current question.

Acceptance criteria:

  • Alexa says the correct translation.

Choose Chapter

As a user I want to be able to choose a certain chapter to repeat its words.

Acceptance criteria:

  • Alexa changes the chapter to the one I wanted and asks words from that chapter

Highscore

As a user I want to know what both my current session-highscore and my all-time-highscore are.

Acceptance criteria:

  • Alexa says both highscores

Get Results

As the user, I want to be able to get my results to see how many words I already answered correctly in each chapter.

Acceptance criteria:

  • Alexa tells me my results.

Redo word

As the user, I want to be able to have another try to answer in case I didn't get the correct answer the first time.

Acceptance criteria:

  • Alexa repeats this word and I get another shot at answering it.

Start Skill

As a user, I want to be able to start the Latin Trainer Skill with a variation of sentences.

Acceptance criteria:
Alexa starts the skill when I tell her to

Aufgabe 5

Zeichne zu Klassendiagramm aus Aufgabe 4 für folgenden Sachverhalt ein
Objektdiagramm

Help

As a user, I want to be able to ask Alexa for help, if I don't know how the skill's process works.

Acceptance criteria:
If I say "Help", Alexa gives a quick insight of how the skill works and what kind of features I can use.

Load Progress

As the user, I want to be able to continue at the point/chapter I stopped at.

Acceptance Criteria:

  • Saved state can be loaded.

Choose mode

As the user, I want to be able to choose whether I continue with my previous chapter or get asked random words from all chapters.

Acceptance criteria:

  • mode can be chosen

Stop

As the user, I want to be able to stop whenever I want.

Acceptance criteria:

  • Alexa stops when I tell her to.

(Get data)

(As Jeff Bezos, i want to be able to get as much data as i can so that i can convert it into money. Acceptance Criteria: - Dollar.)

Skip word

As the user, I want to be able to skip the current word and answer another.

Acceptance criteria:

  • Alexa asks for the translation of a new word.

Delete words

As user, i want to be able to delete words so that i can get rid of any unnecessary stuff. Acceptance Criteria: - Words can be deleted.

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.