{"id":27098638,"url":"https://github.com/edonosotti/auto-translated-chatbot","last_synced_at":"2025-04-06T11:51:05.614Z","repository":{"id":35672946,"uuid":"192405079","full_name":"edonosotti/auto-translated-chatbot","owner":"edonosotti","description":"A multi-language chatbot with automated translation, using AWS Lex, Translate, Lambda and API Gateway.","archived":false,"fork":false,"pushed_at":"2022-12-30T17:51:57.000Z","size":1837,"stargazers_count":6,"open_issues_count":8,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-08T07:59:56.359Z","etag":null,"topics":["api-gateway","aws","aws-api-gateway","aws-lambda","aws-lambda-node","aws-lex","aws-translate","chatbot","claudia-bot-builder","claudiajs","lambda","lex","nodejs","translate"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edonosotti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-17T19:18:57.000Z","updated_at":"2023-03-21T14:54:08.000Z","dependencies_parsed_at":"2023-01-16T02:42:55.563Z","dependency_job_id":null,"html_url":"https://github.com/edonosotti/auto-translated-chatbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edonosotti%2Fauto-translated-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edonosotti%2Fauto-translated-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edonosotti%2Fauto-translated-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edonosotti%2Fauto-translated-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edonosotti","download_url":"https://codeload.github.com/edonosotti/auto-translated-chatbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478295,"owners_count":20945265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","aws","aws-api-gateway","aws-lambda","aws-lambda-node","aws-lex","aws-translate","chatbot","claudia-bot-builder","claudiajs","lambda","lex","nodejs","translate"],"created_at":"2025-04-06T11:51:04.898Z","updated_at":"2025-04-06T11:51:05.608Z","avatar_url":"https://github.com/edonosotti.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/edonosotti/auto-translated-chatbot.svg?branch=master)](https://travis-ci.org/edonosotti/auto-translated-chatbot)\n[![codebeat badge](https://codebeat.co/badges/38afd549-026d-4646-ba9f-74f03ef6e381)](https://codebeat.co/projects/github-com-edonosotti-auto-translated-chatbot-master)\n[![Maintainability](https://api.codeclimate.com/v1/badges/b9865934da283638a381/maintainability)](https://codeclimate.com/github/edonosotti/auto-translated-chatbot/maintainability)\n\n# A multi-language chatbot with automated translation\n\n\n## Description\n\nThis is a sample chatbot application using [`Amazon Lex`](https://aws.amazon.com/lex/)\nand [`Amazon Translate`](https://aws.amazon.com/translate/) to automatically translate\nincoming requests, process them and translate the responses back to their original language.\n\nIt is based on [`claudia-bot-builder`](https://github.com/claudiajs/claudia-bot-builder)\nand it is compatible with many\n[messaging platforms](https://github.com/claudiajs/claudia-bot-builder#supported-platforms),\nsuch as `Facebook Messenger`, `Telegram`, `Skype`, `Slack` and also `Amazon Echo (Alexa)`.\n`claudia-bot-builder` runs on [`Amazon Lambda`](https://aws.amazon.com/lambda/) and\n[`Amazon API Gateway`](https://aws.amazon.com/api-gateway/).\n\nRead [this article](https://medium.com/rockedscience/building-a-multi-language-chatbot-with-automated-translations-e2acd053bc5c)\nto find out more.\n\n### Caveats\n\n * This chatbot is meant to prototype a new service or product and run the first iterations\n   over it. Although it can scale virtually infinitely using the Amazon platform, for the long\n   run it is most probably better to switch to human-curated translations and save on the\n   requests issued to Lex and Translate, that are billed per-use.\n\n * The AWS free tier *SHOULD* allow you to test this bot for free, but please read its terms\n   and conditions carefully. You may be charged for AWS services usage. In particular, Lex\n   and Translate free tiers only last for 12 months after the first request\n   (at the time of writing). So if your account is older than that you may have already\n   used up your free tier. Also, all services subject to the free tier do enforce usage\n   limits for it. Make sure that your usage is within those limits. Be safe and set an\n   [AWS Budget](https://aws.amazon.com/aws-cost-management/aws-budgets/)\n   to detect unwanted or excessive charges early on. You are responsible for that.\n\n * The training data (city names) provided to the chatbot for the `Location` slot is very\n   minimal and not enough for the machine learning to properly determine its nature, so\n   stick to the provided list of cities when testing the bot. Other cities might not work.\n\n\n## Requirements\n\n * `Node.JS v10.x.x`\n\n\n## Deployment\n\n### `Claudia.JS` notes\n\nThis bot is built on `claudia-bot-builder` and uses `Claudia.JS`\nfor deployments on `AWS`. Since version 2 of the bot framework\nwas released, `Claudia.JS` was decoupled from the framework\nand *MUST* be installed separately. `Claudia.JS` can be either\ninstalled as a *global* package or a *local* dependency.\nIn order to make the distribution of this package easier for\nusers and for it to coexist with other versions of `Claudia.JS`,\nit has been included as a *local* dependency.\n\n### First deployment\n\n#### 1. Creating the Lex bot\n\nZip the [`aws/lex/WeatherBot_Export.json`](aws/lex/WeatherBot_Export.json)\nfile and import it using the `Lex` console:\n\n 1. Sign in to the AWS Management Console and open the [Amazon Lex console, Bots page](https://console.aws.amazon.com/lex/home?#bots:).\n 2. From `Actions`, choose `Import`.\n 3. From `Import Bot`, choose the `.zip` archive that contains the `JSON` file that contains the bot to import.\n 4. Press `Import`.\n 5. Press `Build` to build the bot.\n 6. Press `Publish` and name the deployment: `Development`.\n\n#### 2. Deploying the backend\n\nInstall the required dependencies first:\n\n```\n$ npm install\n```\n\nRun the following command, replacing `{AWS_REGION}` with your\nAWS region of choice:\n\n```\n$ ./node_modules/.bin/claudia create \\\n    --region {AWS_REGION} \\\n    --api-module bot \\\n    --version development \\\n    --policies aws/iam/policies.json \\\n    --set-env-from-json aws/lambda/env.json\n```\n\nIf you have multiple AWS profiles configured on your machine,\nspecify the profile\n\n```\n$ AWS_PROFILE={PROFILE_NAME} \\\n  ./node_modules/.bin/claudia create \\\n    --region {AWS_REGION} \\\n    --api-module bot \\\n    --version development \\\n    --policies aws/iam/policies.json \\\n    --set-env-from-json aws/lambda/env.json\n```\n\n#### 3. Connecting the bot to a messaging platform\n\nFor detailed information on connecting a bot to a messaing\nplatform, please see the\n[`claudia-bot-builder` Hello World Chat Bot doc](https://claudiajs.com/tutorials/hello-world-chatbot.html).\n\n##### Telegram\n\nTo get started quickly and test a bot, [`Telegram`](https://telegram.org)\nis a very good place to start from. Creating and configuring a bot takes\nonly [a few steps](https://core.telegram.org/bots#3-how-do-i-create-a-bot).\n\n 1. [Create a bot on Telegram](doc/telegram.md)\n 2. Deploy the chatbot as described in **First deployment** above\n 3. Run\n    ```\n    $ ./node_modules/.bin/claudia --configure-telegram-bot\n    ```\n    and follow the instructions shown on the screen.\n\n\n## Usage\n\nThis bot uses the [`MetaWeather API`](https://www.metaweather.com/api/) to deliver the\nweather forecast. You can ask it:\n\n```\nHow is the weather in Milan?\nHow will the weather be like in Boston on monday?\n```\n\nin any language supported by `Amazon Translate` that can be translated to English.\nPlease read the **Caveats** paragraph above and see the\n[`aws/lex/WeatherBot_Export.json`](aws/lex/WeatherBot_Export.json) file for the list\nof cities that are safe to use in this demo.\n\n\n## Tests\n\nRun:\n\n```\n$ npm install\n$ npm test\n```\n\n\n## License\n\nThis code is released under the [`MIT license`](LICENSE).\nPlease read it carefully before using it.\n\n![Screenshot on Telegram](doc/img/telegram.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedonosotti%2Fauto-translated-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedonosotti%2Fauto-translated-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedonosotti%2Fauto-translated-chatbot/lists"}