Spaces:
Sleeping
Sleeping
Download app.py from bigscience-data/corpus-map: direct link, hf CLI and curl.
- Browser
- Download file 502 Bytes
-
https://huggingface.co/spaces/bigscience-data/corpus-map/resolve/main/app.py
- Command line
-
hf download hf://spaces/bigscience-data/corpus-map/app.py
-
curl -L -o app.py https://huggingface.co/spaces/bigscience-data/corpus-map/resolve/main/app.py
502 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') | |
| fig = px.treemap(df, path=[px.Constant("ROOTS"), 'Macroarea', 'Family', 'Genus', 'Language', 'dataset_name'], | |
| values='num_bytes', 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) | |