Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from datasets import load_dataset
|
3 |
+
import pandas as pd
|
4 |
+
|
5 |
+
st.title("Explore Hugging Face Dataset")
|
6 |
+
dataset = load_dataset("ag_news", split="train[:1000]")
|
7 |
+
|
8 |
+
df = pd.DataFrame(dataset)
|
9 |
+
st.write("Sample data:", df.head())
|
10 |
+
|
11 |
+
st.write("Category Distribution")
|
12 |
+
st.bar_chart(df["label"].value_counts())
|