Comprendre le texte

Introduction à AWS Boto en Python

Maksim Pecherskiy

Data engineer

Console AWS Translate

Console AWS Translate

Introduction à AWS Boto en Python

Traduire du texte

Initialiser le client

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

Traduire du texte

response = translate.translate_text(
    Text='Hello, how are you?', 
    SourceLanguageCode='auto', 
    TargetLanguageCode='es')
Introduction à AWS Boto en Python

Traduire du texte

Traduire du texte

Introduction à AWS Boto en Python

Traduire du texte

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

Détecter la langue

Initialiser le client boto3 Comprehend

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

Détecter la langue dominante

response = comprehend.detect_dominant_language(
  Text="Hay basura por todas partes a lo largo de la carretera.")
Introduction à AWS Boto en Python

Détecter la langue

Détecter la langue

Introduction à AWS Boto en Python

Comprendre le sentiment

Comprendre le sentiment

Introduction à AWS Boto en Python

Comprendre le sentiment

Détecter le sentiment du texte

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

Comprendre le sentiment

Comprendre le sentiment

Introduction à AWS Boto en Python

Comprendre le sentiment

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

Révision

Initialiser le client

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

Traduire du texte

response = translate.translate_text(
    Text='Hello, how are you?', 
    SourceLanguageCode='auto', 
    TargetLanguageCode='es')
Introduction à AWS Boto en Python

Révision

Initialiser le client boto3 Comprehend

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

Détecter la langue dominante

response = comprehend.detect_dominant_language(
  Text="Hay basura por todas partes a lo largo de la carretera.")
Introduction à AWS Boto en Python

Révision

Détecter le sentiment du texte

response = comprehend.detect_sentiment(
  Text="Maksim is amazing.", 
  LanguageCode='en')
Introduction à AWS Boto en Python

Passons à la pratique !

Introduction à AWS Boto en Python

Preparing Video For Download...