Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Correct typo in app comments #57

Open
wants to merge 42 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1106568
git commit
nmraqisa Dec 5, 2022
40b3622
git committed
nmraqisa Dec 5, 2022
d7a477c
git commit
nmraqisa Dec 5, 2022
b3e31e5
git commit --amend
nmraqisa Dec 5, 2022
bc087cc
Correct typo in app comments
MamuteleP Dec 6, 2022
589073e
Add files via upload
MamuteleP Dec 6, 2022
01ef7a6
Delete EDSA_logo.png
MamuteleP Dec 6, 2022
05d488f
Delete fork-repo.png
MamuteleP Dec 6, 2022
dc8fcd8
Delete streamlit-base-splash-screen.png
MamuteleP Dec 6, 2022
7e55a2b
Delete streamlit-logo.png
MamuteleP Dec 6, 2022
69e9914
Delete streamlit.png
MamuteleP Dec 6, 2022
c574a46
Delete what-is-streamlit.png
MamuteleP Dec 6, 2022
2cc52b3
Delete Logistic_regression.pkl
MamuteleP Dec 6, 2022
754e9d2
Delete info.md
MamuteleP Dec 6, 2022
132e206
Delete tfidfvect.pkl
MamuteleP Dec 6, 2022
49ca2c9
Delete train.csv
MamuteleP Dec 6, 2022
6511314
Delete README.md
MamuteleP Dec 6, 2022
ede11cf
Delete base_app.py
MamuteleP Dec 6, 2022
70989cd
First main update
MamuteleP Dec 6, 2022
0f4c3b8
git committed
nmraqisa Dec 6, 2022
946f5ce
taking to main
MamuteleP Dec 6, 2022
e57917d
We are moving
MamuteleP Dec 6, 2022
7004e2e
staged
MamuteleP Dec 7, 2022
cba85b7
Merge pull request #1 from CaitMc/MamuteleP
MamuteleP Dec 7, 2022
fc03edd
updated app template
nmraqisa Dec 11, 2022
1417d95
A ot of changes
MamuteleP Dec 11, 2022
09c8e72
merge template
nmraqisa Dec 11, 2022
dc8a8c9
Update base_app.py
nmraqisa Dec 11, 2022
5f85239
renamed the base
nmraqisa Dec 11, 2022
df980af
Merge branch 'nmraqisa' of https://github.com/CaitMc/Classification-s…
nmraqisa Dec 11, 2022
50c3617
Merge branch 'master' into nmraqisa
nmraqisa Dec 11, 2022
3bcedbe
Merge pull request #2 from CaitMc/nmraqisa
nmraqisa Dec 11, 2022
ef096cf
commiting to my branch
MamuteleP Dec 11, 2022
dbf018c
Pulling fro main
MamuteleP Dec 11, 2022
808c596
From main to my branch
MamuteleP Dec 11, 2022
10dae59
modified template
nmraqisa Dec 12, 2022
5e42e59
Final commit
MamuteleP Dec 12, 2022
6e6254d
Final commit
MamuteleP Dec 12, 2022
4f7118a
Merge branch 'master' into MamuteleP
MamuteleP Dec 12, 2022
d2add30
Merge pull request #3 from CaitMc/MamuteleP
MamuteleP Dec 12, 2022
a5f58da
Merge branch 'master' into nmraqisa
nmraqisa Dec 12, 2022
391619b
Merge pull request #4 from CaitMc/nmraqisa
nmraqisa Dec 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .streamlit/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[theme]

# Primary accent for interactive elements
primaryColor="#d33682"

# Background color for the main content area
backgroundColor="#002b36"

# Background color for sidebar and most interactive widgets
secondaryBackgroundColor="#586e75"

# Color used for almost all text
textColor="#fafafa"

# Font family for all text in the app, except code blocks
# Accepted values (serif | sans serif | monospace)
# Default: "sans serif"
font="sans serif"






27 changes: 24 additions & 3 deletions base_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# Streamlit dependencies
import streamlit as st
import joblib,os
from PIL import Image

# Data dependencies
import pandas as pd
Expand All @@ -41,13 +42,12 @@ def main():

# Creates a main title and subheader on your page -
# these are static across all pages
st.title("Tweet Classifer")
st.subheader("Climate change tweet classification")

# Creating sidebar with selection box -
# you can create multiple pages this way
options = ["Prediction", "Information"]
selection = st.sidebar.selectbox("Choose Option", options)
options = ["Prediction", "Information", "Random Forest Classifier"]
selection = st.sidebar.selectbox("Lets interact", options)

# Building out the "Information" page
if selection == "Information":
Expand All @@ -73,6 +73,27 @@ def main():
predictor = joblib.load(open(os.path.join("resources/Logistic_regression.pkl"),"rb"))
prediction = predictor.predict(vect_text)

# When model has successfully run, will print prediction
# You can use a dictionary or similar structure to make this output
# more human interpretable.
st.success("Text Categorized as: {}".format(prediction))
#Building out the predication page
if selection == "Random Forest Classifier":
st.info("Just a little bit about the random classifyer model")

image = Image.open(os.path.join("resources/imgs/twitter_logo.jpg"))
st.image(image, caption='Sunrise by the mountains')
# Creating a text box for user input
tweet_text = st.text_area("Enter Text","Type Here")

if st.button("Classify"):
# Transforming user input with vectorizer
vect_text = tweet_cv.transform([tweet_text]).toarray()
# Load your .pkl file with the model of your choice + make predictions
# Try loading in multiple models to give the user a choice
predictor = joblib.load(open(os.path.join("resources/randomfc_model.pkl"),"rb"))
prediction = predictor.predict(vect_text)

# When model has successfully run, will print prediction
# You can use a dictionary or similar structure to make this output
# more human interpretable.
Expand Down
Binary file added resources/imgs/twitter_logo.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/randomfc_model.pkl
Binary file not shown.