Skip to content

Instantly share code, notes, and snippets.

@ranman
Created May 2, 2019 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranman/5dc07e663b1d2ce3ef0db876b18a1ef9 to your computer and use it in GitHub Desktop.
Save ranman/5dc07e663b1d2ce3ef0db876b18a1ef9 to your computer and use it in GitHub Desktop.
Atlanta Summit Code
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import boto3\n",
"comprehend = boto3.client(\"comprehend\")"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'Entities': [{'Score': 0.9917439818382263,\n",
" 'Type': 'PERSON',\n",
" 'Text': 'Randall',\n",
" 'BeginOffset': 25,\n",
" 'EndOffset': 32},\n",
" {'Score': 0.9841945767402649,\n",
" 'Type': 'LOCATION',\n",
" 'Text': 'Atlanta, GA',\n",
" 'BeginOffset': 45,\n",
" 'EndOffset': 56}],\n",
" 'ResponseMetadata': {'RequestId': '4973c54b-6d17-11e9-9f95-3718b6319247',\n",
" 'HTTPStatusCode': 200,\n",
" 'HTTPHeaders': {'x-amzn-requestid': '4973c54b-6d17-11e9-9f95-3718b6319247',\n",
" 'content-type': 'application/x-amz-json-1.1',\n",
" 'content-length': '208',\n",
" 'date': 'Thu, 02 May 2019 20:17:19 GMT'},\n",
" 'RetryAttempts': 0}}"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"comprehend.detect_entities(Text=\"Hello, World! My Name is Randall and I am in Atlanta, GA\", LanguageCode=\"en\")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on method translate_text in module botocore.client:\n",
"\n",
"translate_text(*args, **kwargs) method of botocore.client.Translate instance\n",
" Translates input text from the source language to the target language. It is not necessary to use English (en) as either the source or the target language but not all language combinations are supported by Amazon Translate. For more information, see `Supported Language Pairs <http://docs.aws.amazon.com/translate/latest/dg/pairs.html>`__ .\n",
" \n",
" \n",
" \n",
" \n",
" * Arabic (ar) \n",
" \n",
" * Chinese (Simplified) (zh) \n",
" \n",
" * Chinese (Traditional) (zh-TW) \n",
" \n",
" * Czech (cs) \n",
" \n",
" * Danish (da) \n",
" \n",
" * Dutch (nl) \n",
" \n",
" * English (en) \n",
" \n",
" * Finnish (fi) \n",
" \n",
" * French (fr) \n",
" \n",
" * German (de) \n",
" \n",
" * Hebrew (he) \n",
" \n",
" * Indonesian (id) \n",
" \n",
" * Italian (it) \n",
" \n",
" * Japanese (ja) \n",
" \n",
" * Korean (ko) \n",
" \n",
" * Polish (pl) \n",
" \n",
" * Portuguese (pt) \n",
" \n",
" * Russian (ru) \n",
" \n",
" * Spanish (es) \n",
" \n",
" * Swedish (sv) \n",
" \n",
" * Turkish (tr) \n",
" \n",
" \n",
" \n",
" \n",
" To have Amazon Translate determine the source language of your text, you can specify ``auto`` in the ``SourceLanguageCode`` field. If you specify ``auto`` , Amazon Translate will call Amazon Comprehend to determine the source language.\n",
" \n",
" \n",
" \n",
" See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/translate-2017-07-01/TranslateText>`_\n",
" \n",
" \n",
" **Request Syntax** \n",
" ::\n",
" \n",
" response = client.translate_text(\n",
" Text='string',\n",
" TerminologyNames=[\n",
" 'string',\n",
" ],\n",
" SourceLanguageCode='string',\n",
" TargetLanguageCode='string'\n",
" )\n",
" :type Text: string\n",
" :param Text: **[REQUIRED]** \n",
" \n",
" The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.\n",
" \n",
" \n",
" \n",
" \n",
" :type TerminologyNames: list\n",
" :param TerminologyNames: \n",
" \n",
" The TerminologyNames list that is taken as input to the TranslateText request. This has a minimum length of 0 and a maximum length of 1.\n",
" \n",
" \n",
" \n",
" \n",
" - *(string) --* \n",
" \n",
" \n",
" \n",
" :type SourceLanguageCode: string\n",
" :param SourceLanguageCode: **[REQUIRED]** \n",
" \n",
" The language code for the language of the source text. The language must be a language supported by Amazon Translate. \n",
" \n",
" \n",
" \n",
" To have Amazon Translate determine the source language of your text, you can specify ``auto`` in the ``SourceLanguageCode`` field. If you specify ``auto`` , Amazon Translate will call Amazon Comprehend to determine the source language.\n",
" \n",
" \n",
" \n",
" \n",
" :type TargetLanguageCode: string\n",
" :param TargetLanguageCode: **[REQUIRED]** \n",
" \n",
" The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.\n",
" \n",
" \n",
" \n",
" \n",
" \n",
" :rtype: dict\n",
" :returns: \n",
" \n",
" **Response Syntax** \n",
" \n",
" \n",
" ::\n",
" \n",
" {\n",
" 'TranslatedText': 'string',\n",
" 'SourceLanguageCode': 'string',\n",
" 'TargetLanguageCode': 'string',\n",
" 'AppliedTerminologies': [\n",
" {\n",
" 'Name': 'string',\n",
" 'Terms': [\n",
" {\n",
" 'SourceText': 'string',\n",
" 'TargetText': 'string'\n",
" },\n",
" ]\n",
" },\n",
" ]\n",
" }\n",
" **Response Structure** \n",
" \n",
" \n",
" \n",
" - *(dict) --* \n",
" \n",
" \n",
" - **TranslatedText** *(string) --* \n",
" \n",
" The the translated text. The maximum length of this text is 5kb.\n",
" \n",
" \n",
" \n",
" \n",
" - **SourceLanguageCode** *(string) --* \n",
" \n",
" The language code for the language of the source text. \n",
" \n",
" \n",
" \n",
" \n",
" - **TargetLanguageCode** *(string) --* \n",
" \n",
" The language code for the language of the target text. \n",
" \n",
" \n",
" \n",
" \n",
" - **AppliedTerminologies** *(list) --* \n",
" \n",
" The names of the custom terminologies applied to the input text by Amazon Translate for the translated text response.\n",
" \n",
" \n",
" \n",
" \n",
" - *(dict) --* \n",
" \n",
" The custom terminology applied to the input text by Amazon Translate for the translated text response. This is optional in the response and will only be present if you specified terminology input in the request. Currently, only one terminology can be applied per TranslateText request.\n",
" \n",
" \n",
" \n",
" \n",
" - **Name** *(string) --* \n",
" \n",
" The name of the custom terminology applied to the input text by Amazon Translate for the translated text response.\n",
" \n",
" \n",
" \n",
" \n",
" - **Terms** *(list) --* \n",
" \n",
" The specific terms of the custom terminology applied to the input text by Amazon Translate for the translated text response. A maximum of 250 terms will be returned, and the specific terms applied will be the first 250 terms in the source text. \n",
" \n",
" \n",
" \n",
" \n",
" - *(dict) --* \n",
" \n",
" The term being translated by the custom terminology.\n",
" \n",
" \n",
" \n",
" \n",
" - **SourceText** *(string) --* \n",
" \n",
" The source text of the term being translated by the custom terminology.\n",
" \n",
" \n",
" \n",
" \n",
" - **TargetText** *(string) --* \n",
" \n",
" The target text of the term being translated by the custom terminology.\n",
"\n"
]
}
],
"source": [
"import boto3\n",
"\n",
"translate = boto3.client(\"translate\")\n",
"\n",
"help(translate.translate_text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import boto3\n",
"import pyaudio\n",
"\n",
"polly = boto3.client(\"polly\")\n",
"audio = pyaudio.PyAudio()\n",
"\n",
"def speak(text, voice):\n",
" resp = polly.synthesize_speech(\n",
" Text=text,\n",
" TextType=\"text\",\n",
" OutputFormat=\"pcm\",\n",
" VoiceId=voice\n",
" )\n",
" stream = audio.open(\n",
" format=audio.get_format_from_width(width=2),\n",
" channels=1, rate=16000, output=True\n",
" )\n",
" stream.write(resp['AudioStream'].read())\n",
" stream.stop_stream()\n",
" stream.close()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"speak(\"We all float down here\", \"Justin\")"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on Polly in module botocore.client object:\n",
"\n",
"class Polly(BaseClient)\n",
" | Polly(serializer, endpoint, response_parser, event_emitter, request_signer, service_model, loader, client_config, partition, exceptions_factory)\n",
" | \n",
" | Method resolution order:\n",
" | Polly\n",
" | BaseClient\n",
" | builtins.object\n",
" | \n",
" | Methods defined here:\n",
" | \n",
" | delete_lexicon(self, *args, **kwargs)\n",
" | Deletes the specified pronunciation lexicon stored in an AWS Region. A lexicon which has been deleted is not available for speech synthesis, nor is it possible to retrieve it using either the ``GetLexicon`` or ``ListLexicon`` APIs.\n",
" | \n",
" | \n",
" | \n",
" | For more information, see `Managing Lexicons <http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html>`__ .\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DeleteLexicon>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.delete_lexicon(\n",
" | Name='string'\n",
" | )\n",
" | :type Name: string\n",
" | :param Name: **[REQUIRED]** \n",
" | \n",
" | The name of the lexicon to delete. Must be an existing lexicon in the region.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {}\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --*\n",
" | \n",
" | describe_voices(self, *args, **kwargs)\n",
" | Returns the list of voices that are available for use when requesting speech synthesis. Each voice speaks a specified language, is either male or female, and is identified by an ID, which is the ASCII version of the voice name. \n",
" | \n",
" | \n",
" | \n",
" | When synthesizing speech ( ``SynthesizeSpeech`` ), you provide the voice ID for the voice you want from the list of voices returned by ``DescribeVoices`` .\n",
" | \n",
" | \n",
" | \n",
" | For example, you want your news reader application to read news in a specific language, but giving a user the option to choose the voice. Using the ``DescribeVoices`` operation you can provide the user with a list of available voices to select from.\n",
" | \n",
" | \n",
" | \n",
" | You can optionally specify a language code to filter the available voices. For example, if you specify ``en-US`` , the operation returns a list of all available US English voices. \n",
" | \n",
" | \n",
" | \n",
" | This operation requires permissions to perform the ``polly:DescribeVoices`` action.\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/DescribeVoices>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.describe_voices(\n",
" | LanguageCode='cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR',\n",
" | IncludeAdditionalLanguageCodes=True|False,\n",
" | NextToken='string'\n",
" | )\n",
" | :type LanguageCode: string\n",
" | :param LanguageCode: \n",
" | \n",
" | The language identification tag (ISO 639 code for the language name-ISO 3166 country code) for filtering the list of voices returned. If you don't specify this optional parameter, all available voices are returned. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type IncludeAdditionalLanguageCodes: boolean\n",
" | :param IncludeAdditionalLanguageCodes: \n",
" | \n",
" | Boolean value indicating whether to return any bilingual voices that use the specified language as an additional language. For instance, if you request all languages that use US English (es-US), and there is an Italian voice that speaks both Italian (it-IT) and US English, that voice will be included if you specify ``yes`` but not if you specify ``no`` .\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type NextToken: string\n",
" | :param NextToken: \n",
" | \n",
" | An opaque pagination token returned from the previous ``DescribeVoices`` operation. If present, this indicates where to continue the listing.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {\n",
" | 'Voices': [\n",
" | {\n",
" | 'Gender': 'Female'|'Male',\n",
" | 'Id': 'Geraint'|'Gwyneth'|'Mads'|'Naja'|'Hans'|'Marlene'|'Nicole'|'Russell'|'Amy'|'Brian'|'Emma'|'Raveena'|'Ivy'|'Joanna'|'Joey'|'Justin'|'Kendra'|'Kimberly'|'Matthew'|'Salli'|'Conchita'|'Enrique'|'Miguel'|'Penelope'|'Chantal'|'Celine'|'Lea'|'Mathieu'|'Dora'|'Karl'|'Carla'|'Giorgio'|'Mizuki'|'Liv'|'Lotte'|'Ruben'|'Ewa'|'Jacek'|'Jan'|'Maja'|'Ricardo'|'Vitoria'|'Cristiano'|'Ines'|'Carmen'|'Maxim'|'Tatyana'|'Astrid'|'Filiz'|'Vicki'|'Takumi'|'Seoyeon'|'Aditi'|'Zhiyu'|'Bianca'|'Lucia'|'Mia',\n",
" | 'LanguageCode': 'cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR',\n",
" | 'LanguageName': 'string',\n",
" | 'Name': 'string',\n",
" | 'AdditionalLanguageCodes': [\n",
" | 'cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR',\n",
" | ]\n",
" | },\n",
" | ],\n",
" | 'NextToken': 'string'\n",
" | }\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | \n",
" | - **Voices** *(list) --* \n",
" | \n",
" | A list of voices with their properties.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | Description of the voice.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Gender** *(string) --* \n",
" | \n",
" | Gender of the voice.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Id** *(string) --* \n",
" | \n",
" | Amazon Polly assigned voice ID. This is the ID that you specify when calling the ``SynthesizeSpeech`` operation.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LanguageCode** *(string) --* \n",
" | \n",
" | Language code of the voice.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LanguageName** *(string) --* \n",
" | \n",
" | Human readable name of the language in English.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Name** *(string) --* \n",
" | \n",
" | Name of the voice (for example, Salli, Kendra, etc.). This provides a human readable voice name that you might display in your application.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **AdditionalLanguageCodes** *(list) --* \n",
" | \n",
" | Additional codes for languages available for the specified voice in addition to its default language. \n",
" | \n",
" | \n",
" | \n",
" | For example, the default language for Aditi is Indian English (en-IN) because it was first used for that language. Since Aditi is bilingual and fluent in both Indian English and Hindi, this parameter would show the code ``hi-IN`` .\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **NextToken** *(string) --* \n",
" | \n",
" | The pagination token to use in the next request to continue the listing of voices. ``NextToken`` is returned only if the response is truncated.\n",
" | \n",
" | generate_presigned_url(self, ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)\n",
" | Generate a presigned url given a client, its method, and arguments\n",
" | \n",
" | :type ClientMethod: string\n",
" | :param ClientMethod: The client method to presign for\n",
" | \n",
" | :type Params: dict\n",
" | :param Params: The parameters normally passed to\n",
" | ``ClientMethod``.\n",
" | \n",
" | :type ExpiresIn: int\n",
" | :param ExpiresIn: The number of seconds the presigned url is valid\n",
" | for. By default it expires in an hour (3600 seconds)\n",
" | \n",
" | :type HttpMethod: string\n",
" | :param HttpMethod: The http method to use on the generated url. By\n",
" | default, the http method is whatever is used in the method's model.\n",
" | \n",
" | :returns: The presigned url\n",
" | \n",
" | get_lexicon(self, *args, **kwargs)\n",
" | Returns the content of the specified pronunciation lexicon stored in an AWS Region. For more information, see `Managing Lexicons <http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html>`__ .\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/GetLexicon>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.get_lexicon(\n",
" | Name='string'\n",
" | )\n",
" | :type Name: string\n",
" | :param Name: **[REQUIRED]** \n",
" | \n",
" | Name of the lexicon.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {\n",
" | 'Lexicon': {\n",
" | 'Content': 'string',\n",
" | 'Name': 'string'\n",
" | },\n",
" | 'LexiconAttributes': {\n",
" | 'Alphabet': 'string',\n",
" | 'LanguageCode': 'cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR',\n",
" | 'LastModified': datetime(2015, 1, 1),\n",
" | 'LexiconArn': 'string',\n",
" | 'LexemesCount': 123,\n",
" | 'Size': 123\n",
" | }\n",
" | }\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | \n",
" | - **Lexicon** *(dict) --* \n",
" | \n",
" | Lexicon object that provides name and the string content of the lexicon. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Content** *(string) --* \n",
" | \n",
" | Lexicon content in string format. The content of a lexicon must be in PLS format.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Name** *(string) --* \n",
" | \n",
" | Name of the lexicon.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LexiconAttributes** *(dict) --* \n",
" | \n",
" | Metadata of the lexicon, including phonetic alphabetic used, language code, lexicon ARN, number of lexemes defined in the lexicon, and size of lexicon in bytes.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Alphabet** *(string) --* \n",
" | \n",
" | Phonetic alphabet used in the lexicon. Valid values are ``ipa`` and ``x-sampa`` .\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LanguageCode** *(string) --* \n",
" | \n",
" | Language code that the lexicon applies to. A lexicon with a language code such as \"en\" would be applied to all English languages (en-GB, en-US, en-AUS, en-WLS, and so on.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LastModified** *(datetime) --* \n",
" | \n",
" | Date lexicon was last modified (a timestamp value).\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LexiconArn** *(string) --* \n",
" | \n",
" | Amazon Resource Name (ARN) of the lexicon.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LexemesCount** *(integer) --* \n",
" | \n",
" | Number of lexemes in the lexicon.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Size** *(integer) --* \n",
" | \n",
" | Total size of the lexicon, in characters.\n",
" | \n",
" | get_speech_synthesis_task(self, *args, **kwargs)\n",
" | Retrieves a specific SpeechSynthesisTask object based on its TaskID. This object contains information about the given speech synthesis task, including the status of the task, and a link to the S3 bucket containing the output of the task.\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/GetSpeechSynthesisTask>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.get_speech_synthesis_task(\n",
" | TaskId='string'\n",
" | )\n",
" | :type TaskId: string\n",
" | :param TaskId: **[REQUIRED]** \n",
" | \n",
" | The Amazon Polly generated identifier for a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {\n",
" | 'SynthesisTask': {\n",
" | 'TaskId': 'string',\n",
" | 'TaskStatus': 'scheduled'|'inProgress'|'completed'|'failed',\n",
" | 'TaskStatusReason': 'string',\n",
" | 'OutputUri': 'string',\n",
" | 'CreationTime': datetime(2015, 1, 1),\n",
" | 'RequestCharacters': 123,\n",
" | 'SnsTopicArn': 'string',\n",
" | 'LexiconNames': [\n",
" | 'string',\n",
" | ],\n",
" | 'OutputFormat': 'json'|'mp3'|'ogg_vorbis'|'pcm',\n",
" | 'SampleRate': 'string',\n",
" | 'SpeechMarkTypes': [\n",
" | 'sentence'|'ssml'|'viseme'|'word',\n",
" | ],\n",
" | 'TextType': 'ssml'|'text',\n",
" | 'VoiceId': 'Geraint'|'Gwyneth'|'Mads'|'Naja'|'Hans'|'Marlene'|'Nicole'|'Russell'|'Amy'|'Brian'|'Emma'|'Raveena'|'Ivy'|'Joanna'|'Joey'|'Justin'|'Kendra'|'Kimberly'|'Matthew'|'Salli'|'Conchita'|'Enrique'|'Miguel'|'Penelope'|'Chantal'|'Celine'|'Lea'|'Mathieu'|'Dora'|'Karl'|'Carla'|'Giorgio'|'Mizuki'|'Liv'|'Lotte'|'Ruben'|'Ewa'|'Jacek'|'Jan'|'Maja'|'Ricardo'|'Vitoria'|'Cristiano'|'Ines'|'Carmen'|'Maxim'|'Tatyana'|'Astrid'|'Filiz'|'Vicki'|'Takumi'|'Seoyeon'|'Aditi'|'Zhiyu'|'Bianca'|'Lucia'|'Mia',\n",
" | 'LanguageCode': 'cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR'\n",
" | }\n",
" | }\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | \n",
" | - **SynthesisTask** *(dict) --* \n",
" | \n",
" | SynthesisTask object that provides information from the requested task, including output format, creation time, task status, and so on.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskId** *(string) --* \n",
" | \n",
" | The Amazon Polly generated identifier for a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskStatus** *(string) --* \n",
" | \n",
" | Current status of the individual speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskStatusReason** *(string) --* \n",
" | \n",
" | Reason for the current status of a specific speech synthesis task, including errors if the task has failed.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **OutputUri** *(string) --* \n",
" | \n",
" | Pathway for the output speech file.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **CreationTime** *(datetime) --* \n",
" | \n",
" | Timestamp for the time the synthesis task was started.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **RequestCharacters** *(integer) --* \n",
" | \n",
" | Number of billable characters synthesized.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SnsTopicArn** *(string) --* \n",
" | \n",
" | ARN for the SNS topic optionally used for providing status notification for a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LexiconNames** *(list) --* \n",
" | \n",
" | List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | - **OutputFormat** *(string) --* \n",
" | \n",
" | The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SampleRate** *(string) --* \n",
" | \n",
" | The audio frequency specified in Hz.\n",
" | \n",
" | \n",
" | \n",
" | The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", and \"22050\". The default value is \"22050\".\n",
" | \n",
" | \n",
" | \n",
" | Valid values for pcm are \"8000\" and \"16000\" The default value is \"16000\". \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SpeechMarkTypes** *(list) --* \n",
" | \n",
" | The type of speech marks returned for the input text.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | - **TextType** *(string) --* \n",
" | \n",
" | Specifies whether the input text is plain text or SSML. The default value is plain text. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **VoiceId** *(string) --* \n",
" | \n",
" | Voice ID to use for the synthesis. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LanguageCode** *(string) --* \n",
" | \n",
" | Optional language code for a synthesis task. This is only necessary if using a bilingual voice, such as Aditi, which can be used for either Indian English (en-IN) or Hindi (hi-IN). \n",
" | \n",
" | \n",
" | \n",
" | If a bilingual voice is used and no language code is specified, Amazon Polly will use the default language of the bilingual voice. The default language for any voice is the one returned by the `DescribeVoices <https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html>`__ operation for the ``LanguageCode`` parameter. For example, if no language code is specified, Aditi will use Indian English rather than Hindi.\n",
" | \n",
" | list_lexicons(self, *args, **kwargs)\n",
" | Returns a list of pronunciation lexicons stored in an AWS Region. For more information, see `Managing Lexicons <http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html>`__ .\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListLexicons>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.list_lexicons(\n",
" | NextToken='string'\n",
" | )\n",
" | :type NextToken: string\n",
" | :param NextToken: \n",
" | \n",
" | An opaque pagination token returned from previous ``ListLexicons`` operation. If present, indicates where to continue the list of lexicons.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {\n",
" | 'Lexicons': [\n",
" | {\n",
" | 'Name': 'string',\n",
" | 'Attributes': {\n",
" | 'Alphabet': 'string',\n",
" | 'LanguageCode': 'cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR',\n",
" | 'LastModified': datetime(2015, 1, 1),\n",
" | 'LexiconArn': 'string',\n",
" | 'LexemesCount': 123,\n",
" | 'Size': 123\n",
" | }\n",
" | },\n",
" | ],\n",
" | 'NextToken': 'string'\n",
" | }\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | \n",
" | - **Lexicons** *(list) --* \n",
" | \n",
" | A list of lexicon names and attributes.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | Describes the content of the lexicon.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Name** *(string) --* \n",
" | \n",
" | Name of the lexicon.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Attributes** *(dict) --* \n",
" | \n",
" | Provides lexicon metadata.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Alphabet** *(string) --* \n",
" | \n",
" | Phonetic alphabet used in the lexicon. Valid values are ``ipa`` and ``x-sampa`` .\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LanguageCode** *(string) --* \n",
" | \n",
" | Language code that the lexicon applies to. A lexicon with a language code such as \"en\" would be applied to all English languages (en-GB, en-US, en-AUS, en-WLS, and so on.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LastModified** *(datetime) --* \n",
" | \n",
" | Date lexicon was last modified (a timestamp value).\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LexiconArn** *(string) --* \n",
" | \n",
" | Amazon Resource Name (ARN) of the lexicon.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LexemesCount** *(integer) --* \n",
" | \n",
" | Number of lexemes in the lexicon.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **Size** *(integer) --* \n",
" | \n",
" | Total size of the lexicon, in characters.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **NextToken** *(string) --* \n",
" | \n",
" | The pagination token to use in the next request to continue the listing of lexicons. ``NextToken`` is returned only if the response is truncated.\n",
" | \n",
" | list_speech_synthesis_tasks(self, *args, **kwargs)\n",
" | Returns a list of SpeechSynthesisTask objects ordered by their creation date. This operation can filter the tasks by their status, for example, allowing users to list only tasks that are completed.\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/ListSpeechSynthesisTasks>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.list_speech_synthesis_tasks(\n",
" | MaxResults=123,\n",
" | NextToken='string',\n",
" | Status='scheduled'|'inProgress'|'completed'|'failed'\n",
" | )\n",
" | :type MaxResults: integer\n",
" | :param MaxResults: \n",
" | \n",
" | Maximum number of speech synthesis tasks returned in a List operation.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type NextToken: string\n",
" | :param NextToken: \n",
" | \n",
" | The pagination token to use in the next request to continue the listing of speech synthesis tasks. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type Status: string\n",
" | :param Status: \n",
" | \n",
" | Status of the speech synthesis tasks returned in a List operation\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {\n",
" | 'NextToken': 'string',\n",
" | 'SynthesisTasks': [\n",
" | {\n",
" | 'TaskId': 'string',\n",
" | 'TaskStatus': 'scheduled'|'inProgress'|'completed'|'failed',\n",
" | 'TaskStatusReason': 'string',\n",
" | 'OutputUri': 'string',\n",
" | 'CreationTime': datetime(2015, 1, 1),\n",
" | 'RequestCharacters': 123,\n",
" | 'SnsTopicArn': 'string',\n",
" | 'LexiconNames': [\n",
" | 'string',\n",
" | ],\n",
" | 'OutputFormat': 'json'|'mp3'|'ogg_vorbis'|'pcm',\n",
" | 'SampleRate': 'string',\n",
" | 'SpeechMarkTypes': [\n",
" | 'sentence'|'ssml'|'viseme'|'word',\n",
" | ],\n",
" | 'TextType': 'ssml'|'text',\n",
" | 'VoiceId': 'Geraint'|'Gwyneth'|'Mads'|'Naja'|'Hans'|'Marlene'|'Nicole'|'Russell'|'Amy'|'Brian'|'Emma'|'Raveena'|'Ivy'|'Joanna'|'Joey'|'Justin'|'Kendra'|'Kimberly'|'Matthew'|'Salli'|'Conchita'|'Enrique'|'Miguel'|'Penelope'|'Chantal'|'Celine'|'Lea'|'Mathieu'|'Dora'|'Karl'|'Carla'|'Giorgio'|'Mizuki'|'Liv'|'Lotte'|'Ruben'|'Ewa'|'Jacek'|'Jan'|'Maja'|'Ricardo'|'Vitoria'|'Cristiano'|'Ines'|'Carmen'|'Maxim'|'Tatyana'|'Astrid'|'Filiz'|'Vicki'|'Takumi'|'Seoyeon'|'Aditi'|'Zhiyu'|'Bianca'|'Lucia'|'Mia',\n",
" | 'LanguageCode': 'cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR'\n",
" | },\n",
" | ]\n",
" | }\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | \n",
" | - **NextToken** *(string) --* \n",
" | \n",
" | An opaque pagination token returned from the previous List operation in this request. If present, this indicates where to continue the listing.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SynthesisTasks** *(list) --* \n",
" | \n",
" | List of SynthesisTask objects that provides information from the specified task in the list request, including output format, creation time, task status, and so on.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | SynthesisTask object that provides information about a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskId** *(string) --* \n",
" | \n",
" | The Amazon Polly generated identifier for a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskStatus** *(string) --* \n",
" | \n",
" | Current status of the individual speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskStatusReason** *(string) --* \n",
" | \n",
" | Reason for the current status of a specific speech synthesis task, including errors if the task has failed.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **OutputUri** *(string) --* \n",
" | \n",
" | Pathway for the output speech file.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **CreationTime** *(datetime) --* \n",
" | \n",
" | Timestamp for the time the synthesis task was started.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **RequestCharacters** *(integer) --* \n",
" | \n",
" | Number of billable characters synthesized.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SnsTopicArn** *(string) --* \n",
" | \n",
" | ARN for the SNS topic optionally used for providing status notification for a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LexiconNames** *(list) --* \n",
" | \n",
" | List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | - **OutputFormat** *(string) --* \n",
" | \n",
" | The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SampleRate** *(string) --* \n",
" | \n",
" | The audio frequency specified in Hz.\n",
" | \n",
" | \n",
" | \n",
" | The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", and \"22050\". The default value is \"22050\".\n",
" | \n",
" | \n",
" | \n",
" | Valid values for pcm are \"8000\" and \"16000\" The default value is \"16000\". \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SpeechMarkTypes** *(list) --* \n",
" | \n",
" | The type of speech marks returned for the input text.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | - **TextType** *(string) --* \n",
" | \n",
" | Specifies whether the input text is plain text or SSML. The default value is plain text. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **VoiceId** *(string) --* \n",
" | \n",
" | Voice ID to use for the synthesis. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LanguageCode** *(string) --* \n",
" | \n",
" | Optional language code for a synthesis task. This is only necessary if using a bilingual voice, such as Aditi, which can be used for either Indian English (en-IN) or Hindi (hi-IN). \n",
" | \n",
" | \n",
" | \n",
" | If a bilingual voice is used and no language code is specified, Amazon Polly will use the default language of the bilingual voice. The default language for any voice is the one returned by the `DescribeVoices <https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html>`__ operation for the ``LanguageCode`` parameter. For example, if no language code is specified, Aditi will use Indian English rather than Hindi.\n",
" | \n",
" | put_lexicon(self, *args, **kwargs)\n",
" | Stores a pronunciation lexicon in an AWS Region. If a lexicon with the same name already exists in the region, it is overwritten by the new lexicon. Lexicon operations have eventual consistency, therefore, it might take some time before the lexicon is available to the SynthesizeSpeech operation.\n",
" | \n",
" | \n",
" | \n",
" | For more information, see `Managing Lexicons <http://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html>`__ .\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/PutLexicon>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.put_lexicon(\n",
" | Name='string',\n",
" | Content='string'\n",
" | )\n",
" | :type Name: string\n",
" | :param Name: **[REQUIRED]** \n",
" | \n",
" | Name of the lexicon. The name must follow the regular express format [0-9A-Za-z]{1,20}. That is, the name is a case-sensitive alphanumeric string up to 20 characters long. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type Content: string\n",
" | :param Content: **[REQUIRED]** \n",
" | \n",
" | Content of the PLS lexicon as string data.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {}\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --*\n",
" | \n",
" | start_speech_synthesis_task(self, *args, **kwargs)\n",
" | Allows the creation of an asynchronous synthesis task, by starting a new ``SpeechSynthesisTask`` . This operation requires all the standard information needed for speech synthesis, plus the name of an Amazon S3 bucket for the service to store the output of the synthesis task and two optional parameters (OutputS3KeyPrefix and SnsTopicArn). Once the synthesis task is created, this operation will return a SpeechSynthesisTask object, which will include an identifier of this task as well as the current status.\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/StartSpeechSynthesisTask>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.start_speech_synthesis_task(\n",
" | LexiconNames=[\n",
" | 'string',\n",
" | ],\n",
" | OutputFormat='json'|'mp3'|'ogg_vorbis'|'pcm',\n",
" | OutputS3BucketName='string',\n",
" | OutputS3KeyPrefix='string',\n",
" | SampleRate='string',\n",
" | SnsTopicArn='string',\n",
" | SpeechMarkTypes=[\n",
" | 'sentence'|'ssml'|'viseme'|'word',\n",
" | ],\n",
" | Text='string',\n",
" | TextType='ssml'|'text',\n",
" | VoiceId='Geraint'|'Gwyneth'|'Mads'|'Naja'|'Hans'|'Marlene'|'Nicole'|'Russell'|'Amy'|'Brian'|'Emma'|'Raveena'|'Ivy'|'Joanna'|'Joey'|'Justin'|'Kendra'|'Kimberly'|'Matthew'|'Salli'|'Conchita'|'Enrique'|'Miguel'|'Penelope'|'Chantal'|'Celine'|'Lea'|'Mathieu'|'Dora'|'Karl'|'Carla'|'Giorgio'|'Mizuki'|'Liv'|'Lotte'|'Ruben'|'Ewa'|'Jacek'|'Jan'|'Maja'|'Ricardo'|'Vitoria'|'Cristiano'|'Ines'|'Carmen'|'Maxim'|'Tatyana'|'Astrid'|'Filiz'|'Vicki'|'Takumi'|'Seoyeon'|'Aditi'|'Zhiyu'|'Bianca'|'Lucia'|'Mia',\n",
" | LanguageCode='cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR'\n",
" | )\n",
" | :type LexiconNames: list\n",
" | :param LexiconNames: \n",
" | \n",
" | List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | :type OutputFormat: string\n",
" | :param OutputFormat: **[REQUIRED]** \n",
" | \n",
" | The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type OutputS3BucketName: string\n",
" | :param OutputS3BucketName: **[REQUIRED]** \n",
" | \n",
" | Amazon S3 bucket name to which the output file will be saved.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type OutputS3KeyPrefix: string\n",
" | :param OutputS3KeyPrefix: \n",
" | \n",
" | The Amazon S3 key prefix for the output speech file.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type SampleRate: string\n",
" | :param SampleRate: \n",
" | \n",
" | The audio frequency specified in Hz.\n",
" | \n",
" | \n",
" | \n",
" | The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", and \"22050\". The default value is \"22050\".\n",
" | \n",
" | \n",
" | \n",
" | Valid values for pcm are \"8000\" and \"16000\" The default value is \"16000\". \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type SnsTopicArn: string\n",
" | :param SnsTopicArn: \n",
" | \n",
" | ARN for the SNS topic optionally used for providing status notification for a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type SpeechMarkTypes: list\n",
" | :param SpeechMarkTypes: \n",
" | \n",
" | The type of speech marks returned for the input text.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | :type Text: string\n",
" | :param Text: **[REQUIRED]** \n",
" | \n",
" | The input text to synthesize. If you specify ssml as the TextType, follow the SSML format for the input text. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type TextType: string\n",
" | :param TextType: \n",
" | \n",
" | Specifies whether the input text is plain text or SSML. The default value is plain text. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type VoiceId: string\n",
" | :param VoiceId: **[REQUIRED]** \n",
" | \n",
" | Voice ID to use for the synthesis. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type LanguageCode: string\n",
" | :param LanguageCode: \n",
" | \n",
" | Optional language code for the Speech Synthesis request. This is only necessary if using a bilingual voice, such as Aditi, which can be used for either Indian English (en-IN) or Hindi (hi-IN). \n",
" | \n",
" | \n",
" | \n",
" | If a bilingual voice is used and no language code is specified, Amazon Polly will use the default language of the bilingual voice. The default language for any voice is the one returned by the `DescribeVoices <https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html>`__ operation for the ``LanguageCode`` parameter. For example, if no language code is specified, Aditi will use Indian English rather than Hindi.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {\n",
" | 'SynthesisTask': {\n",
" | 'TaskId': 'string',\n",
" | 'TaskStatus': 'scheduled'|'inProgress'|'completed'|'failed',\n",
" | 'TaskStatusReason': 'string',\n",
" | 'OutputUri': 'string',\n",
" | 'CreationTime': datetime(2015, 1, 1),\n",
" | 'RequestCharacters': 123,\n",
" | 'SnsTopicArn': 'string',\n",
" | 'LexiconNames': [\n",
" | 'string',\n",
" | ],\n",
" | 'OutputFormat': 'json'|'mp3'|'ogg_vorbis'|'pcm',\n",
" | 'SampleRate': 'string',\n",
" | 'SpeechMarkTypes': [\n",
" | 'sentence'|'ssml'|'viseme'|'word',\n",
" | ],\n",
" | 'TextType': 'ssml'|'text',\n",
" | 'VoiceId': 'Geraint'|'Gwyneth'|'Mads'|'Naja'|'Hans'|'Marlene'|'Nicole'|'Russell'|'Amy'|'Brian'|'Emma'|'Raveena'|'Ivy'|'Joanna'|'Joey'|'Justin'|'Kendra'|'Kimberly'|'Matthew'|'Salli'|'Conchita'|'Enrique'|'Miguel'|'Penelope'|'Chantal'|'Celine'|'Lea'|'Mathieu'|'Dora'|'Karl'|'Carla'|'Giorgio'|'Mizuki'|'Liv'|'Lotte'|'Ruben'|'Ewa'|'Jacek'|'Jan'|'Maja'|'Ricardo'|'Vitoria'|'Cristiano'|'Ines'|'Carmen'|'Maxim'|'Tatyana'|'Astrid'|'Filiz'|'Vicki'|'Takumi'|'Seoyeon'|'Aditi'|'Zhiyu'|'Bianca'|'Lucia'|'Mia',\n",
" | 'LanguageCode': 'cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR'\n",
" | }\n",
" | }\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | \n",
" | - **SynthesisTask** *(dict) --* \n",
" | \n",
" | SynthesisTask object that provides information and attributes about a newly submitted speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskId** *(string) --* \n",
" | \n",
" | The Amazon Polly generated identifier for a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskStatus** *(string) --* \n",
" | \n",
" | Current status of the individual speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **TaskStatusReason** *(string) --* \n",
" | \n",
" | Reason for the current status of a specific speech synthesis task, including errors if the task has failed.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **OutputUri** *(string) --* \n",
" | \n",
" | Pathway for the output speech file.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **CreationTime** *(datetime) --* \n",
" | \n",
" | Timestamp for the time the synthesis task was started.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **RequestCharacters** *(integer) --* \n",
" | \n",
" | Number of billable characters synthesized.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SnsTopicArn** *(string) --* \n",
" | \n",
" | ARN for the SNS topic optionally used for providing status notification for a speech synthesis task.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LexiconNames** *(list) --* \n",
" | \n",
" | List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | - **OutputFormat** *(string) --* \n",
" | \n",
" | The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SampleRate** *(string) --* \n",
" | \n",
" | The audio frequency specified in Hz.\n",
" | \n",
" | \n",
" | \n",
" | The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", and \"22050\". The default value is \"22050\".\n",
" | \n",
" | \n",
" | \n",
" | Valid values for pcm are \"8000\" and \"16000\" The default value is \"16000\". \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **SpeechMarkTypes** *(list) --* \n",
" | \n",
" | The type of speech marks returned for the input text.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | - **TextType** *(string) --* \n",
" | \n",
" | Specifies whether the input text is plain text or SSML. The default value is plain text. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **VoiceId** *(string) --* \n",
" | \n",
" | Voice ID to use for the synthesis. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **LanguageCode** *(string) --* \n",
" | \n",
" | Optional language code for a synthesis task. This is only necessary if using a bilingual voice, such as Aditi, which can be used for either Indian English (en-IN) or Hindi (hi-IN). \n",
" | \n",
" | \n",
" | \n",
" | If a bilingual voice is used and no language code is specified, Amazon Polly will use the default language of the bilingual voice. The default language for any voice is the one returned by the `DescribeVoices <https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html>`__ operation for the ``LanguageCode`` parameter. For example, if no language code is specified, Aditi will use Indian English rather than Hindi.\n",
" | \n",
" | synthesize_speech(self, *args, **kwargs)\n",
" | Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes. SSML input must be valid, well-formed SSML. Some alphabets might not be available with all the voices (for example, Cyrillic might not be read at all by English voices) unless phoneme mapping is used. For more information, see `How it Works <http://docs.aws.amazon.com/polly/latest/dg/how-text-to-speech-works.html>`__ .\n",
" | \n",
" | \n",
" | \n",
" | See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/polly-2016-06-10/SynthesizeSpeech>`_\n",
" | \n",
" | \n",
" | **Request Syntax** \n",
" | ::\n",
" | \n",
" | response = client.synthesize_speech(\n",
" | LexiconNames=[\n",
" | 'string',\n",
" | ],\n",
" | OutputFormat='json'|'mp3'|'ogg_vorbis'|'pcm',\n",
" | SampleRate='string',\n",
" | SpeechMarkTypes=[\n",
" | 'sentence'|'ssml'|'viseme'|'word',\n",
" | ],\n",
" | Text='string',\n",
" | TextType='ssml'|'text',\n",
" | VoiceId='Geraint'|'Gwyneth'|'Mads'|'Naja'|'Hans'|'Marlene'|'Nicole'|'Russell'|'Amy'|'Brian'|'Emma'|'Raveena'|'Ivy'|'Joanna'|'Joey'|'Justin'|'Kendra'|'Kimberly'|'Matthew'|'Salli'|'Conchita'|'Enrique'|'Miguel'|'Penelope'|'Chantal'|'Celine'|'Lea'|'Mathieu'|'Dora'|'Karl'|'Carla'|'Giorgio'|'Mizuki'|'Liv'|'Lotte'|'Ruben'|'Ewa'|'Jacek'|'Jan'|'Maja'|'Ricardo'|'Vitoria'|'Cristiano'|'Ines'|'Carmen'|'Maxim'|'Tatyana'|'Astrid'|'Filiz'|'Vicki'|'Takumi'|'Seoyeon'|'Aditi'|'Zhiyu'|'Bianca'|'Lucia'|'Mia',\n",
" | LanguageCode='cmn-CN'|'cy-GB'|'da-DK'|'de-DE'|'en-AU'|'en-GB'|'en-GB-WLS'|'en-IN'|'en-US'|'es-ES'|'es-MX'|'es-US'|'fr-CA'|'fr-FR'|'is-IS'|'it-IT'|'ja-JP'|'hi-IN'|'ko-KR'|'nb-NO'|'nl-NL'|'pl-PL'|'pt-BR'|'pt-PT'|'ro-RO'|'ru-RU'|'sv-SE'|'tr-TR'\n",
" | )\n",
" | :type LexiconNames: list\n",
" | :param LexiconNames: \n",
" | \n",
" | List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. For information about storing lexicons, see `PutLexicon <http://docs.aws.amazon.com/polly/latest/dg/API_PutLexicon.html>`__ .\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | :type OutputFormat: string\n",
" | :param OutputFormat: **[REQUIRED]** \n",
" | \n",
" | The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json. \n",
" | \n",
" | \n",
" | \n",
" | When pcm is used, the content returned is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian format. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type SampleRate: string\n",
" | :param SampleRate: \n",
" | \n",
" | The audio frequency specified in Hz. \n",
" | \n",
" | \n",
" | \n",
" | The valid values for ``mp3`` and ``ogg_vorbis`` are \"8000\", \"16000\", and \"22050\". The default value is \"22050\". \n",
" | \n",
" | \n",
" | \n",
" | Valid values for ``pcm`` are \"8000\" and \"16000\" The default value is \"16000\". \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type SpeechMarkTypes: list\n",
" | :param SpeechMarkTypes: \n",
" | \n",
" | The type of speech marks returned for the input text.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - *(string) --* \n",
" | \n",
" | \n",
" | \n",
" | :type Text: string\n",
" | :param Text: **[REQUIRED]** \n",
" | \n",
" | Input text to synthesize. If you specify ``ssml`` as the ``TextType`` , follow the SSML format for the input text. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type TextType: string\n",
" | :param TextType: \n",
" | \n",
" | Specifies whether the input text is plain text or SSML. The default value is plain text. For more information, see `Using SSML <http://docs.aws.amazon.com/polly/latest/dg/ssml.html>`__ .\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type VoiceId: string\n",
" | :param VoiceId: **[REQUIRED]** \n",
" | \n",
" | Voice ID to use for the synthesis. You can get a list of available voice IDs by calling the `DescribeVoices <http://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html>`__ operation. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :type LanguageCode: string\n",
" | :param LanguageCode: \n",
" | \n",
" | Optional language code for the Synthesize Speech request. This is only necessary if using a bilingual voice, such as Aditi, which can be used for either Indian English (en-IN) or Hindi (hi-IN). \n",
" | \n",
" | \n",
" | \n",
" | If a bilingual voice is used and no language code is specified, Amazon Polly will use the default language of the bilingual voice. The default language for any voice is the one returned by the `DescribeVoices <https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html>`__ operation for the ``LanguageCode`` parameter. For example, if no language code is specified, Aditi will use Indian English rather than Hindi.\n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | :rtype: dict\n",
" | :returns: \n",
" | \n",
" | **Response Syntax** \n",
" | \n",
" | \n",
" | ::\n",
" | \n",
" | {\n",
" | 'AudioStream': StreamingBody(),\n",
" | 'ContentType': 'string',\n",
" | 'RequestCharacters': 123\n",
" | }\n",
" | **Response Structure** \n",
" | \n",
" | \n",
" | \n",
" | - *(dict) --* \n",
" | \n",
" | \n",
" | - **AudioStream** (:class:`.StreamingBody`) -- \n",
" | \n",
" | Stream containing the synthesized speech. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **ContentType** *(string) --* \n",
" | \n",
" | Specifies the type audio stream. This should reflect the ``OutputFormat`` parameter in your request. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | * If you request ``mp3`` as the ``OutputFormat`` , the ``ContentType`` returned is audio/mpeg. \n",
" | \n",
" | * If you request ``ogg_vorbis`` as the ``OutputFormat`` , the ``ContentType`` returned is audio/ogg. \n",
" | \n",
" | * If you request ``pcm`` as the ``OutputFormat`` , the ``ContentType`` returned is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian format. \n",
" | \n",
" | * If you request ``json`` as the ``OutputFormat`` , the ``ContentType`` returned is audio/json. \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | - **RequestCharacters** *(integer) --* \n",
" | \n",
" | Number of characters synthesized.\n",
" | \n",
" | ----------------------------------------------------------------------\n",
" | Methods inherited from BaseClient:\n",
" | \n",
" | __getattr__(self, item)\n",
" | \n",
" | __init__(self, serializer, endpoint, response_parser, event_emitter, request_signer, service_model, loader, client_config, partition, exceptions_factory)\n",
" | Initialize self. See help(type(self)) for accurate signature.\n",
" | \n",
" | can_paginate(self, operation_name)\n",
" | Check if an operation can be paginated.\n",
" | \n",
" | :type operation_name: string\n",
" | :param operation_name: The operation name. This is the same name\n",
" | as the method name on the client. For example, if the\n",
" | method name is ``create_foo``, and you'd normally invoke the\n",
" | operation as ``client.create_foo(**kwargs)``, if the\n",
" | ``create_foo`` operation can be paginated, you can use the\n",
" | call ``client.get_paginator(\"create_foo\")``.\n",
" | \n",
" | :return: ``True`` if the operation can be paginated,\n",
" | ``False`` otherwise.\n",
" | \n",
" | get_paginator(self, operation_name)\n",
" | Create a paginator for an operation.\n",
" | \n",
" | :type operation_name: string\n",
" | :param operation_name: The operation name. This is the same name\n",
" | as the method name on the client. For example, if the\n",
" | method name is ``create_foo``, and you'd normally invoke the\n",
" | operation as ``client.create_foo(**kwargs)``, if the\n",
" | ``create_foo`` operation can be paginated, you can use the\n",
" | call ``client.get_paginator(\"create_foo\")``.\n",
" | \n",
" | :raise OperationNotPageableError: Raised if the operation is not\n",
" | pageable. You can use the ``client.can_paginate`` method to\n",
" | check if an operation is pageable.\n",
" | \n",
" | :rtype: L{botocore.paginate.Paginator}\n",
" | :return: A paginator object.\n",
" | \n",
" | get_waiter(self, waiter_name)\n",
" | Returns an object that can wait for some condition.\n",
" | \n",
" | :type waiter_name: str\n",
" | :param waiter_name: The name of the waiter to get. See the waiters\n",
" | section of the service docs for a list of available waiters.\n",
" | \n",
" | :returns: The specified waiter object.\n",
" | :rtype: botocore.waiter.Waiter\n",
" | \n",
" | waiter_names = <botocore.utils.CachedProperty object>\n",
" | ----------------------------------------------------------------------\n",
" | Data descriptors inherited from BaseClient:\n",
" | \n",
" | __dict__\n",
" | dictionary for instance variables (if defined)\n",
" | \n",
" | __weakref__\n",
" | list of weak references to the object (if defined)\n",
" | \n",
" | exceptions\n",
"\n"
]
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from timeit import default_timer as timer\n",
"from datetime import timedelta\n",
"from PIL import Image, ImageFilter, ImageDraw\n",
"\n",
"import boto3\n",
"\n",
"rek = boto3.client(\"rekognition\")\n",
"\n",
"def get_face_boxes(faces, source_size):\n",
" return [\n",
" (\n",
" int(f['BoundingBox']['Left'] * source_size[0]),\n",
" int(f['BoundingBox']['Top'] * source_size[1]),\n",
" int((f['BoundingBox']['Left'] + f['BoundingBox']['Width']) * source_size[0]),\n",
" int((f['BoundingBox']['Top'] + f['BoundingBox']['Height']) * source_size[1]),\n",
" f['Pose']['Roll']\n",
" )\n",
" for f in faces\n",
" ]\n",
"\n",
"def call_rekognition(image, confidence=90):\n",
" start = timer()\n",
" resp = rek.detect_faces(Image={\"Bytes\": image.read()})\n",
" faces = [\n",
" face for face in resp['FaceDetails'] \n",
" if face['Confidence'] > confidence\n",
" ]\n",
" end = timer()\n",
" duration = timedelta(seconds=end-start)\n",
" print(f\"Found {len(faces)} faces in {duration} seconds\")\n",
" return faces"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def blur_faces(image, faces):\n",
" im = Image.open(image)\n",
" source_size = im.size[0], im.size[1]\n",
" draw = ImageDraw.Draw(im)\n",
" for face_box in get_face_boxes(faces, source_size):\n",
" face_img = im.copy()\n",
" blurred_face = face_img.crop(face_box[:4])\n",
" blurred_face = blurred_face.filter(ImageFilter.GaussianBlur(20))\n",
" im.paste(blurred_face, (face_box[0], face_box[1]))\n",
" draw.rectangle(face_box[:4], outline=\"#ff0000\")\n",
" return im"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found 43 faces in 0:00:08.444580 seconds\n"
]
}
],
"source": [
"import os\n",
"pth = \"example_crowd.jpg\"\n",
"with open(pth, 'rb') as f:\n",
" faces = call_rekognition(f)\n",
" img = blur_faces(f, faces)\n",
"img.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def is_hotdog(fname):\n",
" with open(fname, \"rb\") as f:\n",
" for label in r.detect_labels(Image={\"Bytes\": f.read()}, MinConfidence=90)['Labels']:\n",
" if \"Hot Dog\" in label:\n",
" return True\n",
" return False"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment