Spaces:
Running
Running
Commit
·
9b9f848
1
Parent(s):
240c110
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import numpy as np
|
3 |
+
import plotly.express as px
|
4 |
+
import pandas as pd
|
5 |
+
st.set_page_config(page_title="BLOOM Corpus Treemap",layout='wide')
|
6 |
+
|
7 |
+
|
8 |
+
df = pd.read_pickle('bloom_dataset.pkl')
|
9 |
+
df['normalized_size'] = np.sqrt(df['num_bytes'])
|
10 |
+
fig = px.treemap(df, path=[px.Constant("Bloom Corpus"), 'Macroarea', 'Family', 'Genus', 'Language', 'dataset_name'],
|
11 |
+
values='normalized_size', maxdepth=4)
|
12 |
+
fig.update_traces(root_color="pink")
|
13 |
+
fig.update_layout(margin = dict(t=50, l=25, r=25, b=25))
|
14 |
+
|
15 |
+
st.plotly_chart(fig, use_container_width=True)
|