Förstå text

Introduktion till AWS Boto i Python

Maksim Pecherskiy

Data engineer

AWS Translate-konsolen

AWS Translate-konsolen

Introduktion till AWS Boto i Python

Översätta text

Initiera klient

translate = boto3.client('translate', 
    region_name='us-east-1', 
    aws_access_key_id=AWS_KEY_ID, aws_secret_access_key=AWS_SECRET)

Översätt text

response = translate.translate_text(
    Text='Hello, how are you?', 
    SourceLanguageCode='auto', 
    TargetLanguageCode='es')
Introduktion till AWS Boto i Python

Översätta text

Översätta text

Introduktion till AWS Boto i Python

Översätta text

translated_text = translate.translate_text(
    Text='Hello, how are you?', 
    SourceLanguageCode='auto', 
    TargetLanguageCode='es')['TranslatedText']
Introduktion till AWS Boto i Python

Identifiera språk

Initiera boto3 Comprehend-klient

comprehend = boto3.client('comprehend', 
    region_name='us-east-1', 
    aws_access_key_id=AWS_KEY_ID, aws_secret_access_key=AWS_SECRET)

Identifiera dominerande språk

response = comprehend.detect_dominant_language(
  Text="Hay basura por todas partes a lo largo de la carretera.")
Introduktion till AWS Boto i Python

Identifiera språk

Identifiera språk

Introduktion till AWS Boto i Python

Förstå sentiment

Förstå sentiment

Introduktion till AWS Boto i Python

Förstå sentiment

Identifiera textsentiment

response = comprehend.detect_sentiment(
  Text="DataCamp students are amazing.", 
  LanguageCode='en')
Introduktion till AWS Boto i Python

Förstå sentiment

Förstå sentiment

Introduktion till AWS Boto i Python

Förstå sentiment

sentiment = comprehend.detect_sentiment(
  Text='Maksim is amazing.', 
  LanguageCode='en')['Sentiment']
Introduktion till AWS Boto i Python

Repetition

Initiera klient

translate = boto3.client('translate', 
    region_name='us-east-1', 
    aws_access_key_id=AWS_KEY_ID, aws_secret_access_key=AWS_SECRET)

Översätt text

response = translate.translate_text(
    Text='Hello, how are you?', 
    SourceLanguageCode='auto', 
    TargetLanguageCode='es')
Introduktion till AWS Boto i Python

Repetition

Initiera boto3 Comprehend-klient

comprehend = boto3.client('comprehend', 
    region_name='us-east-1', 
    aws_access_key_id=AWS_KEY_ID, aws_secret_access_key=AWS_SECRET)

Identifiera dominerande språk

response = comprehend.detect_dominant_language(
  Text="Hay basura por todas partes a lo largo de la carretera.")
Introduktion till AWS Boto i Python

Repetition

Identifiera textsentiment

response = comprehend.detect_sentiment(
  Text="Maksim is amazing.", 
  LanguageCode='en')
Introduktion till AWS Boto i Python

Nu kör vi en övning!

Introduktion till AWS Boto i Python

Preparing Video For Download...