From 7584cea7ea3b02ae433f272e896baafa438d3243 Mon Sep 17 00:00:00 2001 From: macielcalebe Date: Mon, 2 Sep 2024 09:38:58 -0300 Subject: [PATCH] Deployed 144890f with MkDocs version: 1.5.2 --- 404.html | 33 ++ about/index.html | 33 ++ classes/01-intro/aps01_part_1/index.html | 37 +- classes/01-intro/aps01_part_2/index.html | 33 ++ classes/01-intro/intro/index.html | 33 ++ classes/02-api/api_deploy/index.html | 33 ++ classes/03-batch/aps02_sql/index.html | 35 +- classes/03-batch/data_formats/index.html | 37 +- classes/03-batch/db_tool/index.html | 33 ++ classes/03-batch/dot_env/index.html | 33 ++ classes/03-batch/intro/index.html | 39 +- classes/03-batch/practicing/index.html | 37 +- classes/03-batch/sql/index.html | 33 ++ classes/04-int01/faq/index.html | 33 ++ classes/04-int01/int01/index.html | 33 ++ classes/05-docker/docker/index.html | 33 ++ classes/05-docker/intro/index.html | 33 ++ classes/05-docker/s3/index.html | 37 +- classes/06-message-broker/celery/index.html | 33 ++ classes/06-message-broker/intro/index.html | 33 ++ classes/06-message-broker/rabbitmq/index.html | 39 +- classes/07-lambda/api_gateway/index.html | 40 ++ classes/07-lambda/aps03_lambda/index.html | 33 ++ classes/07-lambda/aws_lambda/index.html | 33 ++ .../07-lambda/lambda_and_docker/index.html | 33 ++ classes/07-lambda/lambda_layer/index.html | 96 ++++- .../07-lambda/lambda_practicing/index.html | 37 +- classes/07-lambda/lambda_quotas/index.html | 35 +- .../07-lambda/sa_lambda_function/index.html | 359 ++++++++++++------ .../07-lambda/sentiment_analysis/index.html | 105 ++++- contributions/index.html | 33 ++ deadlines/index.html | 33 ++ index.html | 33 ++ sitemap.xml.gz | Bin 127 -> 127 bytes 34 files changed, 1454 insertions(+), 139 deletions(-) diff --git a/404.html b/404.html index 44cc4cc..1f0471a 100644 --- a/404.html +++ b/404.html @@ -390,6 +390,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/about/index.html b/about/index.html index b74b2a6..7f4b0d7 100644 --- a/about/index.html +++ b/about/index.html @@ -418,6 +418,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/01-intro/aps01_part_1/index.html b/classes/01-intro/aps01_part_1/index.html index 8741020..dd48b2a 100644 --- a/classes/01-intro/aps01_part_1/index.html +++ b/classes/01-intro/aps01_part_1/index.html @@ -438,6 +438,39 @@ + +
  • + Part 2 + +
  • + + @@ -611,7 +644,7 @@

    Task 01: Opening

    -
    +

    Question 2

    Explain, in general terms, what is the model predicting?

    @@ -630,7 +663,7 @@

    Task 01: Opening

    -
    +

    Question 3

    Considering the everything.ipynb notebook, what is the target variable used in training the model?

    diff --git a/classes/01-intro/aps01_part_2/index.html b/classes/01-intro/aps01_part_2/index.html index 1ec0ddc..dae40c1 100644 --- a/classes/01-intro/aps01_part_2/index.html +++ b/classes/01-intro/aps01_part_2/index.html @@ -414,6 +414,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/01-intro/intro/index.html b/classes/01-intro/intro/index.html index b4685bb..d36334d 100644 --- a/classes/01-intro/intro/index.html +++ b/classes/01-intro/intro/index.html @@ -410,6 +410,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/02-api/api_deploy/index.html b/classes/02-api/api_deploy/index.html index d72a678..cc66dba 100644 --- a/classes/02-api/api_deploy/index.html +++ b/classes/02-api/api_deploy/index.html @@ -422,6 +422,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/03-batch/aps02_sql/index.html b/classes/03-batch/aps02_sql/index.html index ed60624..46fac86 100644 --- a/classes/03-batch/aps02_sql/index.html +++ b/classes/03-batch/aps02_sql/index.html @@ -422,6 +422,39 @@ + +
  • + Part 2 + +
  • + + @@ -612,7 +645,7 @@

    TASK 1: Query file for analytica

    For now...

    For now, keep saving and reading the model in the models folder!

    -
    +

    Question 5

    Why should we avoid using * in production queries?

    diff --git a/classes/03-batch/data_formats/index.html b/classes/03-batch/data_formats/index.html index 6c85223..bef1993 100644 --- a/classes/03-batch/data_formats/index.html +++ b/classes/03-batch/data_formats/index.html @@ -422,6 +422,39 @@ + +
  • + Part 2 + +
  • + + @@ -721,7 +754,7 @@

    Exercises

    -
    +

    Question 8

    What are your conclusions?

    @@ -738,7 +771,7 @@

    Exercises

    For example, when performing column and row filters, pandas generally needs to read the entire file into memory first before it can apply the filter.

    On the other hand, Apache Spark does not need to read the entire parquet file to filter by a column, thanks to its ability to perform predicate pushdown and the efficient structure of the parquet format.

    -
    +

    Question 9

    What predicate pushdown means?!

    diff --git a/classes/03-batch/db_tool/index.html b/classes/03-batch/db_tool/index.html index 4687c58..b5c33d6 100644 --- a/classes/03-batch/db_tool/index.html +++ b/classes/03-batch/db_tool/index.html @@ -410,6 +410,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/03-batch/dot_env/index.html b/classes/03-batch/dot_env/index.html index 6ba7d4c..3e3a8f7 100644 --- a/classes/03-batch/dot_env/index.html +++ b/classes/03-batch/dot_env/index.html @@ -406,6 +406,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/03-batch/intro/index.html b/classes/03-batch/intro/index.html index 6771487..62a1b9e 100644 --- a/classes/03-batch/intro/index.html +++ b/classes/03-batch/intro/index.html @@ -410,6 +410,39 @@ + +
  • + Part 2 + +
  • + + @@ -555,7 +588,7 @@

    Doing batch prediction

    Assuming enough data, it would be transformed (feature engineering, feature selection) but would remain the same during training in the phase of model construction.

    -
    +

    Question 4

    After model deployment:

    @@ -577,7 +610,7 @@

    Doing batch prediction

    We'll deal with retraining in the next classes, but it's important to start thinking about it!

    -
    +

    Question 5

    What about when we deploy the model and need to predict with it?

    @@ -594,7 +627,7 @@

    Doing batch prediction

    Absolutely not! In the first class we did this for simplicity. We would like to make predictions on new data.

    -
    +

    Question 6

    Still on prediction in new data: assuming that the model reads a batch of data from a file called predict.csv, would this file remain the same (have the same records) every time the predict script is called?

    diff --git a/classes/03-batch/practicing/index.html b/classes/03-batch/practicing/index.html index d156d2c..f0bc4ba 100644 --- a/classes/03-batch/practicing/index.html +++ b/classes/03-batch/practicing/index.html @@ -430,6 +430,39 @@ + +
  • + Part 2 + +
  • + + @@ -1021,7 +1054,7 @@

    Task 5: Making predictions

    Done! Whenever there is a new file that must be predicted, just call the predict.py script, informing which model to be used and the path of the file with the data! Then, the model will read this batch of information and perform the prediction.

    Extra questions!

    Categorical variables

    -
    +

    Question 7

    Are there categorical variables in the training data? If yes, which ones?

    @@ -1059,7 +1092,7 @@

    OOT validation

    Tip! 1

    Once you decide the model is good enough, you can retrain with the whole base (January to July) and deploy this new version of the model!

    -
    +

    Question 9

    Explain when is it a good idea to use OOT and what would be the consequences if you don't!

    diff --git a/classes/03-batch/sql/index.html b/classes/03-batch/sql/index.html index 08cc0c1..1c0238a 100644 --- a/classes/03-batch/sql/index.html +++ b/classes/03-batch/sql/index.html @@ -398,6 +398,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/04-int01/faq/index.html b/classes/04-int01/faq/index.html index 90d5163..56d71b5 100644 --- a/classes/04-int01/faq/index.html +++ b/classes/04-int01/faq/index.html @@ -406,6 +406,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/04-int01/int01/index.html b/classes/04-int01/int01/index.html index 1d8550a..4dd562c 100644 --- a/classes/04-int01/int01/index.html +++ b/classes/04-int01/int01/index.html @@ -398,6 +398,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/05-docker/docker/index.html b/classes/05-docker/docker/index.html index 41880d4..e08f23c 100644 --- a/classes/05-docker/docker/index.html +++ b/classes/05-docker/docker/index.html @@ -414,6 +414,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/05-docker/intro/index.html b/classes/05-docker/intro/index.html index 634dd87..dab19bc 100644 --- a/classes/05-docker/intro/index.html +++ b/classes/05-docker/intro/index.html @@ -410,6 +410,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/05-docker/s3/index.html b/classes/05-docker/s3/index.html index c313861..3bd87af 100644 --- a/classes/05-docker/s3/index.html +++ b/classes/05-docker/s3/index.html @@ -414,6 +414,39 @@ + +
  • + Part 2 + +
  • + + @@ -659,7 +692,7 @@

    Submit file

    Refactoring

    In the previous class (SQL) we made a version of the project that uses a PostgreSQL server as the data source.

    -
    +

    Question 7

    Do you consider that S3 could serve as a data source for model training/predict? Explain.

    @@ -676,7 +709,7 @@

    Refactoring

    But the model pickles were always only stored locally in the models folder.

    -
    +

    Question 8

    Do you consider that S3 could serve as storage for model pickles? Explain.

    diff --git a/classes/06-message-broker/celery/index.html b/classes/06-message-broker/celery/index.html index 31bf588..1f90877 100644 --- a/classes/06-message-broker/celery/index.html +++ b/classes/06-message-broker/celery/index.html @@ -426,6 +426,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/06-message-broker/intro/index.html b/classes/06-message-broker/intro/index.html index c09b25e..d8f9f56 100644 --- a/classes/06-message-broker/intro/index.html +++ b/classes/06-message-broker/intro/index.html @@ -414,6 +414,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/06-message-broker/rabbitmq/index.html b/classes/06-message-broker/rabbitmq/index.html index fead03a..86a7e4f 100644 --- a/classes/06-message-broker/rabbitmq/index.html +++ b/classes/06-message-broker/rabbitmq/index.html @@ -414,6 +414,39 @@ + +
  • + Part 2 + +
  • + + @@ -511,7 +544,7 @@

    Create docker-compose.yml

    Docker Compose allows defining and running multiple Docker containers using a Compose file that describes the whole application. It makes it easy to collaborate on multi-container apps.

    For now our application will only contain RabbitMQ, but it costs nothing to practice!

    -
    +

    Question 2

    Explain what this section means:

    @@ -780,7 +813,7 @@

    Consume messages

    -
    +

    Question 14

    Change the callback function to: @@ -807,7 +840,7 @@

    Consume messages

    Due to auto_ack=False, if the consumer dies before notifying that the message was correctly processed, then the message is automatically redistributed to other consumers (or waits in the queue if there are no free consumers).

    -
    +

    Question 15

    Can you think of some situations where the use of auto_ack=True is indicated?

    diff --git a/classes/07-lambda/api_gateway/index.html b/classes/07-lambda/api_gateway/index.html index 433caaf..f6a21f1 100644 --- a/classes/07-lambda/api_gateway/index.html +++ b/classes/07-lambda/api_gateway/index.html @@ -414,6 +414,39 @@ + +
  • + Part 2 + +
  • + + @@ -586,6 +619,13 @@

    Practicing

    + + Next + Sentiment analysis + +
    diff --git a/classes/07-lambda/aps03_lambda/index.html b/classes/07-lambda/aps03_lambda/index.html index 541604c..ceb83f3 100644 --- a/classes/07-lambda/aps03_lambda/index.html +++ b/classes/07-lambda/aps03_lambda/index.html @@ -390,6 +390,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/07-lambda/aws_lambda/index.html b/classes/07-lambda/aws_lambda/index.html index 26e7b63..485676e 100644 --- a/classes/07-lambda/aws_lambda/index.html +++ b/classes/07-lambda/aws_lambda/index.html @@ -418,6 +418,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/07-lambda/lambda_and_docker/index.html b/classes/07-lambda/lambda_and_docker/index.html index 7748050..bc91e4b 100644 --- a/classes/07-lambda/lambda_and_docker/index.html +++ b/classes/07-lambda/lambda_and_docker/index.html @@ -390,6 +390,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/classes/07-lambda/lambda_layer/index.html b/classes/07-lambda/lambda_layer/index.html index 9f7f66f..68098d7 100644 --- a/classes/07-lambda/lambda_layer/index.html +++ b/classes/07-lambda/lambda_layer/index.html @@ -124,7 +124,7 @@ -
  • +
  • Classes
  • @@ -608,7 +641,7 @@

    Create Lambda Function

    lambda_response = lambda_client.create_function( FunctionName=function_name, - Runtime="python3.9", + Runtime="python3.10", Role=lambda_role_arn, Handler="my_lambda.say_hello", # Python file DOT handler function Code={"ZipFile": zip_to_deploy}, @@ -616,7 +649,7 @@

    Create Lambda Function

    print("Function ARN:", lambda_response["FunctionArn"])
    -
    +

    Question 6

    Run the Python code to create the function. Then write down the returned ARN

    diff --git a/classes/07-lambda/lambda_quotas/index.html b/classes/07-lambda/lambda_quotas/index.html index 5dfb7d8..b4cd0db 100644 --- a/classes/07-lambda/lambda_quotas/index.html +++ b/classes/07-lambda/lambda_quotas/index.html @@ -390,6 +390,39 @@ + +
  • + Part 2 + +
  • + + @@ -417,7 +450,7 @@

    Lambda Quotas

    In the last classes we saw how to create functions that run serverless, that is, we don't need to worry about the infrastructure needed to execute the functions.

    Ideally, we would like to run any function, with any time and memory requirement on AWS Lambda. But there are limits.

    -
    +

    Question 1

    Do you know of any quotas that limit the execution of AWS lambda functions?

    diff --git a/classes/07-lambda/sa_lambda_function/index.html b/classes/07-lambda/sa_lambda_function/index.html index 092c5f9..2686736 100644 --- a/classes/07-lambda/sa_lambda_function/index.html +++ b/classes/07-lambda/sa_lambda_function/index.html @@ -124,7 +124,7 @@ -
  • +
  • Classes
      @@ -353,7 +353,7 @@ -
    • +
    • 07 - Lambda Functions
    • @@ -407,6 +468,18 @@
        + +
      • Classes
      • + + + +
      • 07 - Lambda Functions
      • + + + +
      • Part 2
      • + +
      @@ -416,6 +489,60 @@

      Lambda Function for Sentment Analysis (SA)

      Let's create a lambda function that uses the textblob library to return the polarity of a text.

      +

      But first, let's configure the AWS CLI so we have another way to interact with our resources created in AWS.

      +

      AWS CLI - Command Line Interface

      +

      Install

      +

      Click Here to install AWS CLI.

      +

      Configure

      +

      Configure the region and credentials provided by the professor.

      +
      + +
      $ aws configure --profile mlops
      +AWS Access Key ID [None]: ????????????
      +AWS Secret Access Key [None]: ????????????????????????????????
      +Default region name [None]: us-east-2
      +Default output format [None]: 
      +
      + +
      +


      +

      Set profile

      +

      To set a default profile, use:

      +
      +
      +
      +
      +
      $ export AWS_PROFILE=mlops
      +
      +

      +

      +
      +
      +
      +
      $ export AWS_PROFILE=mlops
      +
      +

      +

      +
      +
      +
      +
      $ env:AWS_PROFILE = "mlops"
      +
      +

      +

      +
      +
      +
      +

      Example: list Lambda functions

      +

      You can now use the AWS CLI to create, list, or remove resources. For example, to list the names of lambda functions:

      +
      + +
      $ aws lambda list-functions --query "Functions[*].FunctionName" --output text
      +
      + +
      +


      +

      From here on, you can research how to do with the AWS CLI what we did with boto3 library.

      Create source code

      Question 1

      @@ -440,44 +567,44 @@

      Create source code

      Official answer for polarity.py -
      from textblob import TextBlob
      -import json
      -
      -
      -def get_polarity(event, context):
      -    # Provide a body for the request!
      -    if "body" not in event:
      -        return {"error": "No body provided"}
      -
      -    # Get the raw posted JSON
      -    raw_json = event["body"]
      -
      -    # Load it into a Python dict
      -    body = json.loads(raw_json)
      -
      -    if "phrase" not in body:
      -        return {"error": "No phrase provided"}
      -
      -    phrase = body["phrase"]
      -
      -    # Create a TextBlob object of the phrase
      -    blob = TextBlob(phrase)
      -
      -    # Get the polarity score
      -    polarity = blob.polarity
      -
      -    # Create a response object with the phrase and polarity
      -    res = {"phrase": phrase, "polarity": str(polarity)}
      -
      -    # Determine the sentiment
      -    if polarity > 0.2:
      -        res["sentiment"] = "Positive sentiment"
      -    elif polarity >= -0.8:
      -        res["sentiment"] = "Neutral sentiment"
      -    else:
      -        res["sentiment"] = "Negative sentiment"
      -
      -    return res
      +
      from textblob import TextBlob
      +import json
      +
      +
      +def get_polarity(event, context):
      +    # Provide a body for the request!
      +    if "body" not in event:
      +        return {"error": "No body provided"}
      +
      +    # Get the raw posted JSON
      +    raw_json = event["body"]
      +
      +    # Load it into a Python dict
      +    body = json.loads(raw_json)
      +
      +    if "phrase" not in body:
      +        return {"error": "No phrase provided"}
      +
      +    phrase = body["phrase"]
      +
      +    # Create a TextBlob object of the phrase
      +    blob = TextBlob(phrase)
      +
      +    # Get the polarity score
      +    polarity = blob.polarity
      +
      +    # Create a response object with the phrase and polarity
      +    res = {"phrase": phrase, "polarity": str(polarity)}
      +
      +    # Determine the sentiment
      +    if polarity > 0.2:
      +        res["sentiment"] = "Positive sentiment"
      +    elif polarity >= -0.8:
      +        res["sentiment"] = "Neutral sentiment"
      +    else:
      +        res["sentiment"] = "Negative sentiment"
      +
      +    return res
       
      @@ -496,40 +623,40 @@

      Create Lambda function

      Change the function_name variable.

      Provide a name in the pattern get_polarity_<YOUR_INSPER_USERNAME>

      -
      import boto3
      -import os
      -from dotenv import load_dotenv
      -
      -load_dotenv()
      -
      -# Lambda function name
      -# Provide a name in the pattern `get_polarity_<YOUR_INSPER_USERNAME>`
      -function_name = ""
      -
      -# Lambda basic execution role
      -lambda_role_arn = os.getenv("AWS_LAMBDA_ROLE_ARN")
      -
      -# Create a Boto3 client for AWS Lambda
      -lambda_client = boto3.client(
      -    "lambda",
      -    aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID"),
      -    aws_secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"),
      -    region_name=os.getenv("AWS_REGION"),
      -)
      -
      -# Read the contents of the zip file that you want to deploy
      -with open("polarity.zip", "rb") as f:
      -    zip_to_deploy = f.read()
      -
      -lambda_response = lambda_client.create_function(
      -    FunctionName=function_name,
      -    Runtime="python3.10", # Change the runtime if you want!
      -    Role=lambda_role_arn,
      -    Handler="polarity.get_polarity",  # function get_polarity inside polarity.py
      -    Code={"ZipFile": zip_to_deploy},
      -)
      -
      -print("Function ARN:", lambda_response["FunctionArn"])
      +
      import boto3
      +import os
      +from dotenv import load_dotenv
      +
      +load_dotenv()
      +
      +# Lambda function name
      +# Provide a name in the pattern `get_polarity_<YOUR_INSPER_USERNAME>`
      +function_name = ""
      +
      +# Lambda basic execution role
      +lambda_role_arn = os.getenv("AWS_LAMBDA_ROLE_ARN")
      +
      +# Create a Boto3 client for AWS Lambda
      +lambda_client = boto3.client(
      +    "lambda",
      +    aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID"),
      +    aws_secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"),
      +    region_name=os.getenv("AWS_REGION"),
      +)
      +
      +# Read the contents of the zip file that you want to deploy
      +with open("polarity.zip", "rb") as f:
      +    zip_to_deploy = f.read()
      +
      +lambda_response = lambda_client.create_function(
      +    FunctionName=function_name,
      +    Runtime="python3.10", # Change the runtime if you want!
      +    Role=lambda_role_arn,
      +    Handler="polarity.get_polarity",  # function get_polarity inside polarity.py
      +    Code={"ZipFile": zip_to_deploy},
      +)
      +
      +print("Function ARN:", lambda_response["FunctionArn"])
       

      Check if worked

      Before creating the API, let's check if the Lambda function works correctly!

      @@ -538,38 +665,38 @@

      Check if worked

      Atention!

      Change the function_name variable with the same name as before.

      -
      import boto3
      -import os
      -import io
      -from dotenv import load_dotenv
      -
      -load_dotenv()
      -
      -# Lambda function name
      -function_name = ""
      -
      -# Create a Boto3 client for AWS Lambda
      -lambda_client = boto3.client(
      -    "lambda",
      -    aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID"),
      -    aws_secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"),
      -    region_name=os.getenv("AWS_REGION"),
      -)
      -
      -
      -try:
      -    # Invoke the function
      -    response = lambda_client.invoke(
      -        FunctionName=function_name,
      -        InvocationType="RequestResponse",
      -    )
      -
      -    payload = response["Payload"]
      -
      -    txt = io.BytesIO(payload.read()).read().decode("utf-8")
      -    print(f"Response:\n{txt}")
      -except Exception as e:
      -    print(e)
      +
      import boto3
      +import os
      +import io
      +from dotenv import load_dotenv
      +
      +load_dotenv()
      +
      +# Lambda function name
      +function_name = ""
      +
      +# Create a Boto3 client for AWS Lambda
      +lambda_client = boto3.client(
      +    "lambda",
      +    aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID"),
      +    aws_secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"),
      +    region_name=os.getenv("AWS_REGION"),
      +)
      +
      +
      +try:
      +    # Invoke the function
      +    response = lambda_client.invoke(
      +        FunctionName=function_name,
      +        InvocationType="RequestResponse",
      +    )
      +
      +    payload = response["Payload"]
      +
      +    txt = io.BytesIO(payload.read()).read().decode("utf-8")
      +    print(f"Response:\n{txt}")
      +except Exception as e:
      +    print(e)
       

      Question 3

      @@ -584,9 +711,9 @@

      Check if worked

      Answer!

      Among others: -

      {
      -    "errorMessage": "Unable to import module 'polarity': No module named 'textblob'"
      -}
      +
      {
      +    "errorMessage": "Unable to import module 'polarity': No module named 'textblob'"
      +}
       

      @@ -607,6 +734,20 @@

      Runtime dependencies

      diff --git a/classes/07-lambda/sentiment_analysis/index.html b/classes/07-lambda/sentiment_analysis/index.html index 23c290a..5e68722 100644 --- a/classes/07-lambda/sentiment_analysis/index.html +++ b/classes/07-lambda/sentiment_analysis/index.html @@ -124,7 +124,7 @@ -
    • +
    • Classes
        @@ -353,7 +353,7 @@ -
      • +
      • 07 - Lambda Functions
      • @@ -407,6 +460,18 @@
          + +
        • Classes
        • + + + +
        • 07 - Lambda Functions
        • + + + +
        • Part 2
        • + +
        @@ -425,15 +490,12 @@

        Remembering

    • Looking back at the examples we did, they involved a function that returned a fixed JSON and a lambda function that counted the number of words in a sentence. No ML for now!

      Let's use this class to build more complex examples using AWS Lambda!

      -
      -
      -
      -
      -
      + +

      Sentiment Analysis

      Sentiment analysis (SA) is the process of determining whether a given phrase is positive, negative or neutral.

      It can be applied to analyze feedback, reviews, survey responses, social media posts and more to gauge public opinion on certain topics.

      -
      +

      Question 1

      How can we represent the sentiment of a text as a variable in a database?

      @@ -456,7 +518,7 @@

      Sentiment Analysis

  • -
    +

    Question 2

    Is it possible to predict the sentiment of a sentence without using ML algorithms? Can you think of any way?

    @@ -474,7 +536,7 @@

    Sentiment Analysis

    See more Here

    -
    +

    Question 3

    Have you trained or have any idea how to train an ML model for sentiment analysis? Explain how.

    @@ -529,7 +591,16 @@

    Textblob library

    Tip! 1

    Here it is the repository of textblob: https://github.com/sloria/textblob

    +
    +

    Question 4

    +

    Run this code locally and test it with other sentences. Then proceed to the next topic.

    +
    + + +
    + +
    @@ -539,6 +610,20 @@

    Textblob library

    diff --git a/contributions/index.html b/contributions/index.html index c837d6b..1c069de 100644 --- a/contributions/index.html +++ b/contributions/index.html @@ -398,6 +398,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/deadlines/index.html b/deadlines/index.html index b57eaec..bb75d28 100644 --- a/deadlines/index.html +++ b/deadlines/index.html @@ -398,6 +398,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/index.html b/index.html index c11c996..42a4e67 100644 --- a/index.html +++ b/index.html @@ -402,6 +402,39 @@ + +
  • + Part 2 + +
  • + + diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 03ee090b640b0008783ab498835e8f15a8052cdd..3d649bf80d2e2b82d7597a13c5f27a73d4ecb970 100644 GIT binary patch delta 13 Ucmb=gXP58h;CQ(4>O}Sm03n(MHvj+t delta 13 Ucmb=gXP58h;INZEKasrx02;yr_y7O^