Skip to content

Commit 901a6dc

Browse files
Merge pull request #1512 from madeline-underwood/Sentiment_Analysis
Sentiment Analysis_Andy to review
2 parents 3ca3738 + 8916ffe commit 901a6dc

File tree

8 files changed

+169
-96
lines changed

8 files changed

+169
-96
lines changed
46.8 KB
Loading
80.1 KB
Loading

content/learning-paths/servers-and-cloud-computing/sentiment-analysis-eks/_index.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
---
2-
title: Learn how to perform Twitter (X) sentiment analysis on Arm-based EKS clusters
2+
title: Perform Sentiment Analysis on X on Arm-based EKS clusters
33

4-
draft: true
5-
cascade:
6-
draft: true
74

85
minutes_to_complete: 60
96

10-
who_is_this_for: This is an advanced topic for software developers who want to build an end-to-end ML sentiment analysis solution to analyze live Tweets on an Arm-based Amazon EKS cluster.
7+
who_is_this_for: This Learning Path is for software developers who want to build an end-to-end ML sentiment analysis solution on an Arm-based Amazon EKS cluster to analyze live posts on X .
118

129
learning_objectives:
1310
- Deploy a text classification model on Amazon EKS with Apache Spark.
14-
- Use Elasticsearch and a Kibana dashboard to analyze the Tweets.
15-
- Deploy Prometheus and Grafana dashboards to keep track of CPU and RAM usage of Kubernetes nodes.
11+
- Use Elasticsearch and a Kibana dashboard to analyze the posts on X.
12+
- Deploy Prometheus and Grafana dashboards to monitor CPU and RAM usage of Kubernetes nodes.
1613

1714
prerequisites:
1815
- An AWS account.
19-
- A computer with Docker, Terraform, the Amazon eksctl CLI, and kubectl installed.
16+
- A computer with Docker, Terraform, the Amazon eksctl command-line interface, and kubectl installed.
2017

2118
author_primary: Pranay Bakre, Masoud Koleini, Nobel Chowdary Mandepudi, Na Li
2219

content/learning-paths/servers-and-cloud-computing/sentiment-analysis-eks/_review.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
review:
33
- questions:
44
question: >
5-
Sentiment Analysis does not rely on compute infrastructure
5+
Sentiment Analysis does not rely on compute infrastructure.
66
answers:
7-
- "True"
8-
- "False"
7+
- "True."
8+
- "False."
99
correct_answer: 2
1010
explanation: >
11-
Sentiment analysis is a compute-intensive task and can quickly drive up resources and increase costs if not managed effectively
11+
Sentiment Analysis is a compute-intensive task and can quickly drive up resources and increase costs if not managed effectively.
1212
1313
- questions:
1414
question: >
15-
Elasticsearch and Kibana can't be deployed on Arm-based VMs in the cloud
15+
Elasticsearch and Kibana cannot be deployed on Arm-based VMs in the cloud.
1616
answers:
17-
- "True"
18-
- "False"
17+
- "True."
18+
- "False."
1919
correct_answer: 2
2020
explanation: >
21-
Elasticsearch and Kibana provide native Arm64 binaries for various platforms and can be deployed on Arm-based VMs across different clouds
21+
Elasticsearch and Kibana provide native Arm64 binaries for various platforms and can be deployed on Arm-based VMs across different clouds.
2222
2323
2424
# ================================================================================

content/learning-paths/servers-and-cloud-computing/sentiment-analysis-eks/cluster-monitoring.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ layout: learningpathall
88

99
## Monitor CPU and RAM usage with Prometheus and Grafana
1010

11-
Prometheus is a monitoring and alerting tool. It is used for collecting and querying real-time metrics in cloud-native environments like Kubernetes. Prometheus collects essential metrics about CPU usage, memory usage, pod counts, and request latency. This helps you monitor the health and performance of your Kubernetes clusters.
11+
* Prometheus is a monitoring and alerting tool. You can use it for collecting and querying real-time metrics in cloud-native environments like Kubernetes. Prometheus collects essential metrics about CPU usage, memory usage, pod counts, and request latency. This helps you to monitor the health and performance of your Kubernetes clusters.
1212

13-
Grafana is a visualization and analytics tool that integrates with data sources from Prometheus to create interactive dashboards to monitor and analyze Kubernetes metrics over time.
13+
* Grafana is a visualization and analytics tool. It integrates with data sources from Prometheus to create interactive dashboards to monitor and analyze Kubernetes metrics.
14+
15+
{{% notice Note %}}
16+
The terrafom script executed in the previous step automatically installs Prometheus and Grafana in the EKS cluster. However, if you wish to have more flexibility with the installable versions for both, follow the instructions below.
17+
{{% /notice %}}
1418

1519
## Install Prometheus on your EKS cluster
1620

17-
You can use Helm to install prometheus on the Kubernetes cluster.
21+
You can use Helm to install Prometheus on the Kubernetes cluster.
1822

1923
Follow the [Helm documentation](https://helm.sh/docs/intro/install/) to install it on your computer.
2024

@@ -51,7 +55,7 @@ helm install prometheus prometheus-community/prometheus \
5155
--set server.persistentVolume.storageClass="gp2"
5256
```
5357

54-
Check all pods are up and running:
58+
Check that all pods are up and running:
5559

5660
```console
5761
kubectl get pods -n prometheus
@@ -97,14 +101,16 @@ helm install grafana grafana/grafana \
97101
--set service.type=LoadBalancer
98102
```
99103

100-
Check all pods are up and running
104+
Check all pods are up and running:
101105

102106
```console
103107
kubectl get pods -n grafana
104108
```
105109

106-
Login to the grafana dashboard using the LoadBalancer IP and click on `Dashboards` in the left navigation page. Locate a `Kubernetes / Compute Resources / Node` dashboard and click on it.
110+
Log in to the Grafana dashboard using the LoadBalancer IP and click on **Dashboards** in the left navigation page.
111+
112+
Locate a `Kubernetes/Compute Resources/Node (Pods)` dashboard and click on it.
107113

108-
You see a dashboard like below for your Kubernetes cluster:
114+
You should see a dashboard like below for your Kubernetes cluster:
109115

110-
![grafana #center](_images/grafana.png)
116+
![grafana #center](_images/grafana.png "Figure 8: Dashboard for Kubernetes Cluster.")

content/learning-paths/servers-and-cloud-computing/sentiment-analysis-eks/elasticsearch-and-kibana.md

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
---
22
title: Monitoring sentiment with Elasticsearch and Kibana
3-
weight: 4
3+
weight: 3
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Deploy Elasticsearch and Kibana on Arm-based EC2 instance
9+
### Elasticsearch
1010

11-
Elasticsearch is a NoSQL database, search, and analytics engine. It's designed to store, search and analyze large amounts of data. It has real-time indexing capability which is crucial for handling high-velocity data streams like Tweets.
11+
Elasticsearch is a NoSQL database, search, and analytics engine. It is designed to store, search, and analyze large amounts of data. It has a real-time indexing capability which is crucial for handling high-velocity data streams such as X posts.
1212

13-
Kibana is a dashboard and visualization tool that integrates seamlessly with Elasticsearch. It provides an interface to interact with twitter data, apply filters, and receive alerts. There are multiple ways to install Elasticsearch and Kibana, one method is shown below.
13+
### Kibana
14+
15+
Kibana is a customizable dashboard and visualization tool which integrates seamlessly with Elasticsearch. It provides valuable insights and opportunities to explore collected data by presenting it in multiple differing views.
16+
17+
In this Learning Path, you will use a Kibana dashboard as an interface to interact with X data, apply filters, and receive alerts.
18+
19+
### How do I install Elasticsearch and Kibana?
20+
21+
There are multiple ways to install Elasticsearch and Kibana. One of these methods is described here.
1422

1523
Before you begin, ensure that Docker and Docker Compose have been installed on your computer.
1624

17-
Use a text editor to create a `docker-compose.yml` file with the contents below:
25+
Use a text editor to create a `docker-compose.yml` file, and copy-and-paste in the contents below:
1826

1927
```yml
2028
version: '2.18.1'
@@ -50,40 +58,42 @@ networks:
5058
driver: bridge
5159
```
5260
53-
Use the following command to deploy Elasticsearch and Kibana Dashboard.
61+
Use the following command to deploy Elasticsearch and the Kibana Dashboard:
5462
5563
```console
5664
docker compose up
5765
```
66+
If you do not have the `docker compose` plugin already installed, you can install it through the following commands:
5867

59-
```Note
60-
If you don't have the `docker compose` plugin already installed, you can install it via the following commands
68+
{{% notice Note %}}
6169
sudo apt-get update
6270
sudo apt-get install docker-compose-plugin
63-
```
71+
{{% /notice %}}
6472

65-
After the dashboard is up, use the the public IP of your server on the port 5601 to access the Kibana dashboard.
73+
After the dashboard is set up, use the public IP of your server on port `5601` to access the Kibana dashboard. See Figure 2.
6674

67-
![kibana #center](_images/kibana.png)
75+
![kibana #center](_images/kibana.png "Figure 2: Kibana Dashboard Setup.")
6876

69-
Switch to the stack management using the menu on the left side as shown in below image.
77+
Switch to *Stack Management* using the menu on the left side as Figure 3 shows.
7078

71-
![kibana-data #center](_images/Kibana-data.png)
79+
![kibana-data #center](_images/Kibana-data.png "Figure 3: Switch to Stack Management.")
7280

73-
To make sure that you are receiving the data from sentiment analysis application through Elasticsearch, check whether you have Data View in Stack Management.
81+
To make sure that you are receiving the data from the sentiment analysis application through Elasticsearch, check whether you have the Data View enabled in Stack Management.
7482

75-
![kibana-sentiment #center](_images/Kibana-sentiment.png)
83+
![kibana-sentiment #center](_images/Kibana-sentiment.png "Figure 4: Create and Manage Data Views.")
7684

7785
You can also check the types of attributes that are received as the Data Views. Now, you can switch to the dashboards on the left menu and start creating the visualizations to analyze the data.
7886

79-
![kibana-dashboard1 #center](_images/Kibana-dashboard1.png)
87+
![kibana-dashboard1 #center](_images/Kibana-dashboard1.png "Figure 5: Dashboards on Left Menu." )
88+
89+
Figure 6 shows a sample dashboard structure, displaying the records of different sentiments.
8090

81-
One of the sample dashboard structures looks as below, showing the records of different sentiments.
91+
![kibana-dashboard2 #center](_images/Kibana-dashboard2.png "Figure 6: Sample Dashboard Structure." )
8292

83-
![kibana-dashboard2 #center](_images/Kibana-dashboard2.png)
93+
Similarly, you can design and create dashboards to analyze a particular set of data. The screenshot in Figure 7 shows the dashboard designed for this Learning Path.
8494

85-
Similarly, you can design and create dashboards to analyze a particular set of data. The screenshot below shows the dashboard designed for this learning path
95+
![kibana-dashboard3 #center](_images/Kibana-dashboard3.png "Figure 7: Dashboard for this Learning Path.")
8696

87-
![kibana-dashboard3 #center](_images/Kibana-dashboard3.png)
97+
Navigate to the `dashboards` directory in the cloned GitHub repository and locate the `sentiment_dashboard.ndjson` file.
8898

89-
Navigate to the `dashboards` directory in the cloned github repository and locate `sentiment_dashboard.ndjson` file. Import this file into Kibana dashboard and you should see a dashboard shown in previous step.
99+
Import this file into the Kibana dashboard and you should see a dashboard as shown in the previous step.

0 commit comments

Comments
 (0)