File size: 2,123 Bytes
662db6f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import streamlit as st
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.express as px
from PIL import Image

def run() :
    # Membuat Title 
    st.markdown("<h1 style='text-align: center;'>Exploratory Data Analysis</h1>", unsafe_allow_html=True)
    st.write('Berikut adalah EDA dan Workcloud dari Setiap Kategori Tweet')

    # Import DF
    df_eda = pd.read_csv('eda_preprocessing.csv')


    # Membuat Sub Header
    st.subheader('**Persebaran Kategori Tweet**')

    # Membuat visualisasi Distribusi Tweet
    fig, ax =plt.subplots(1,2,figsize=(15,6))

    sns.countplot(x='cyberbullying_type', data=df_eda, palette="winter", ax=ax[0])
    ax[0].set_xlabel("cyberbullying_type", fontsize= 12)
    ax[0].set_ylabel("# of Tweet", fontsize= 12)
    fig.suptitle('Tweet Type Distribution', fontsize=18, fontweight='bold')
    ax[0].set_ylim(0,10000)
    ax[0].tick_params(axis='x', rotation=90)
    plt.xlabel("cyberbullying_type", fontsize= 12)
    plt.ylabel("# of Tweet", fontsize= 12)

    for p in ax[0].patches:
        ax[0].annotate("%.0f"%(p.get_height()), (p.get_x() + p.get_width() / 2,
                        p.get_height()+205), ha='center', va='center',fontsize = 11) 

    df_eda['cyberbullying_type'].value_counts().plot(kind='pie',autopct='%1.1f%%', textprops = {"fontsize":12})
    ax[1].set_ylabel("% of Tweet", fontsize= 12)
    st.pyplot(fig)


    # Membuat Sub Header
    st.subheader('**All Tweet**')
    st.image('https://imgur.com/quc6ru7.png')

    # Membuat Sub Header
    st.subheader('**Age Tweet**')
    st.image('https://imgur.com/WB2tdlJ.png')

    # Membuat Sub Header
    st.subheader('**Gender Tweet**')
    st.image('https://imgur.com/Pd9G2k9.png')

    # Membuat Sub Header
    st.subheader('**Religion Tweet**')
    st.image('https://imgur.com/GE8Sj39.png')


    # Membuat Sub Header
    st.subheader('**Other Cyberbullying Tweet**')
    st.image('https://imgur.com/sr6MYGO.png')

    # Membuat Sub Header
    st.subheader('**Not Cyberbullying Tweet**')
    st.image('https://imgur.com/iWyNSVH.png')
    
if __name__ == '__main__':
    run()