corpus-map / app.py
christopher's picture
Create app.py
9b9f848
raw
history blame
564 Bytes
import streamlit as st
import numpy as np
import plotly.express as px
import pandas as pd
st.set_page_config(page_title="BLOOM Corpus Treemap",layout='wide')
df = pd.read_pickle('bloom_dataset.pkl')
df['normalized_size'] = np.sqrt(df['num_bytes'])
fig = px.treemap(df, path=[px.Constant("Bloom Corpus"), 'Macroarea', 'Family', 'Genus', 'Language', 'dataset_name'],
values='normalized_size', maxdepth=4)
fig.update_traces(root_color="pink")
fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))
st.plotly_chart(fig, use_container_width=True)