File size: 315 Bytes
01cde28
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import streamlit as st
from datasets import load_dataset
import pandas as pd

st.title("Explore Hugging Face Dataset")
dataset = load_dataset("ag_news", split="train[:1000]")

df = pd.DataFrame(dataset)
st.write("Sample data:", df.head())

st.write("Category Distribution")
st.bar_chart(df["label"].value_counts())