Using the built-in algorithms for NLP
In this section, we're going to train and deploy models with BlazingText, LDA, and NTM. Of course, we'll use the datasets prepared in the previous section.
Classifying text with BlazingText
BlazingText makes it extremely easy to build a text classification model, especially if you have no NLP skills. Let's see how:
- We upload the training and validation datasets to S3. Alternatively, we could use the output paths returned by a SageMaker Processing job:
import boto3, sagemaker session = sagemaker.Session()bucket = session.default_bucket()prefix = 'amazon-reviews' s3_train_path = session.upload_data(path='/tmp/training.txt', bucket=bucket, key_prefix=prefix+'/input/train') s3_val_path = session.upload_data(path='/tmp/validation.txt', bucket=bucket, key_prefix=prefix+'/input/validation') s3_output = 's3://{}/{}/output/'.format(bucket, prefix)
- We configure the...