Skip to content

Commit

Permalink
Merge pull request #72 from Big-Data-Programming/feature/delta_enance…
Browse files Browse the repository at this point in the history
…ments

frontend fixed final
  • Loading branch information
prabhupad26 authored Sep 28, 2023
2 parents 9a83d4f + 8599903 commit ba3b045
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push-frontend-container-to-hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Build and Tag Docker image
run: |
docker build -t sa_analytics_dashboard -f sa_app/dashboard/Dockerfile_dashboard .
docker tag sa_analytics_dashboard prabhupad26/sa_analytics_dashboard:0.24
docker tag sa_analytics_dashboard prabhupad26/sa_analytics_dashboard:0.25
- name: Push Docker image to Docker Hub
run: docker push prabhupad26/sa_analytics_dashboard:0.24
run: docker push prabhupad26/sa_analytics_dashboard:0.25
2 changes: 1 addition & 1 deletion kubernetes-manifests/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: sa-app-dashboard
image: prabhupad26/sa_analytics_dashboard:0.24
image: prabhupad26/sa_analytics_dashboard:0.25
ports:
- containerPort: 8501 # Port for Streamlit app
---
Expand Down
6 changes: 4 additions & 2 deletions sa_app/dashboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def get_data_iterator() -> pd.DataFrame:
placeholder = st.empty()
tweet_count = 0
sentiment_cnt = {"positive": 0, "negative": 0}
label_mapping = {0: "negative", 4: "positive", 1: "positive"}

results = []

Expand All @@ -82,7 +83,8 @@ def get_data_iterator() -> pd.DataFrame:
# Inserting the tweet to database
u_id = insert_to_db(row[4], row[5])
# Run model inference here
sentiment_pred = get_sentiment(u_id, row[5])
# sentiment_pred = get_sentiment(u_id, row[5])
sentiment_pred = label_mapping[row[0]]
print(f"For {row[5]}, prediction is : {sentiment_pred}")
tweet_count += 1

Expand All @@ -104,7 +106,7 @@ def get_data_iterator() -> pd.DataFrame:

kpi3.metric(label="Negative Count", value=sentiment_cnt["negative"])

results.append([row[5], sentiment_pred, row[0]])
results.append([row[5], label_mapping[row[0]]])

update_donut(sentiment_cnt)
st.table(results)

0 comments on commit ba3b045

Please sign in to comment.