การทำความเข้าใจข้อความ

Python เบื้องต้นสำหรับ AWS Boto

Maksim Pecherskiy

Data engineer

AWS Translate console

AWS translate console

Python เบื้องต้นสำหรับ AWS Boto

การแปลข้อความ

เริ่มต้น client

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

แปลข้อความ

response = translate.translate_text(
    Text='Hello, how are you?', 
    SourceLanguageCode='auto', 
    TargetLanguageCode='es')
Python เบื้องต้นสำหรับ AWS Boto

การแปลข้อความ

การแปลข้อความ

Python เบื้องต้นสำหรับ AWS Boto

การแปลข้อความ

translated_text = translate.translate_text(
    Text='Hello, how are you?', 
    SourceLanguageCode='auto', 
    TargetLanguageCode='es')['TranslatedText']
Python เบื้องต้นสำหรับ AWS Boto

การตรวจจับภาษา

เริ่มต้น boto3 Comprehend client

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

ตรวจจับภาษาหลัก

response = comprehend.detect_dominant_language(
  Text="Hay basura por todas partes a lo largo de la carretera.")
Python เบื้องต้นสำหรับ AWS Boto

การตรวจจับภาษา

การตรวจจับภาษา

Python เบื้องต้นสำหรับ AWS Boto

การวิเคราะห์ความรู้สึก

การวิเคราะห์ความรู้สึก

Python เบื้องต้นสำหรับ AWS Boto

การวิเคราะห์ความรู้สึก

ตรวจจับความรู้สึกในข้อความ

response = comprehend.detect_sentiment(
  Text="DataCamp students are amazing.", 
  LanguageCode='en')
Python เบื้องต้นสำหรับ AWS Boto

การวิเคราะห์ความรู้สึก

การวิเคราะห์ความรู้สึก

Python เบื้องต้นสำหรับ AWS Boto

การวิเคราะห์ความรู้สึก

sentiment = comprehend.detect_sentiment(
  Text='Maksim is amazing.', 
  LanguageCode='en')['Sentiment']
Python เบื้องต้นสำหรับ AWS Boto

ทบทวน

เริ่มต้น client

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

แปลข้อความ

response = translate.translate_text(
    Text='Hello, how are you?', 
    SourceLanguageCode='auto', 
    TargetLanguageCode='es')
Python เบื้องต้นสำหรับ AWS Boto

ทบทวน

เริ่มต้น boto3 Comprehend client

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

ตรวจจับภาษาหลัก

response = comprehend.detect_dominant_language(
  Text="Hay basura por todas partes a lo largo de la carretera.")
Python เบื้องต้นสำหรับ AWS Boto

ทบทวน

ตรวจจับความรู้สึกในข้อความ

response = comprehend.detect_sentiment(
  Text="Maksim is amazing.", 
  LanguageCode='en')
Python เบื้องต้นสำหรับ AWS Boto

มาฝึกกันเถอะ!

Python เบื้องต้นสำหรับ AWS Boto

Preparing Video For Download...