Translation Pipeline

November 2, 2018

Translation Pipeline

The pipeline is in three distinct parts: * Audio input A is transcribed into text output A * Text input A is translated into text output B * Text input B is verbalized into audio output B

Actions

Each component works in a similar and decoupled manner. Input arrives to an S3 bucket which triggers a Lambda function that uses a niche machine learning service of AWS on that input and places the output in another bucket.

Code

The code is can be found in various branches of this repo. If you have any questions about the code send an email or ask during a meeting.

Style

This whole project is done in CloudFormation. This takes longer to write, but is more effective and sustainable in the long run.

Example Template CloudFormation

{
	"AWSTemplateFormatVersion": "2010-09-09",
	"Parameters": {
		"S3Bucket": {
			"Type": "String",
			"Default": "initial-resources"
		},
		"S3Key": {
			"Type": "String",
			"Default": "mobile_api_0.zip"
		}
	},
	"Resources": {
		"MobileProxyLogGroup": {
			"Type": "AWS::Logs::LogGroup",
			"Properties": {
				"RetentionInDays": 7
			}
		},
		"MobileProxyRole": {
			"Type": "AWS::IAM::Role",
			"Properties": {
				"AssumeRolePolicyDocument": {
					"Version": "2012-10-17",
					"Statement": [
						{
							"Effect": "Allow",
							"Principal": {
								"Service": [
									"lambda.amazonaws.com"
								]
							},
							"Action": [
								"sts:AssumeRole"
							]
						}
					]
				},
				"Path": "/mobileapi/",
				"Policies": [
					{
						"PolicyName": "MobileBackendPermissions",
						"PolicyDocument": {
							"Version": "2012-10-17",
							"Statement": [
								{
									"Effect": "Allow",
									"Action": [
										"logs:CreateLogStream",
										"logs:PutLogEvents"
									],
									"Resource": null
								}
							]
						}
					}
				]
			}
		},
		"MobileProxyLambda": {
			"Type": "AWS::Lambda::Function",
			"Properties": {
				"Code": {
					"S3Bucket": null,
					"S3Key": null
				},
				"Description": "Proxy for Mobile Api",
				"Handler": "mobile_proxy.lambda_handler",
				"Role": null,
				"Runtime": "python3.6"
			}
		}
	},
	"Timeout": "60"
}