maher13/news_2026_exercise
news_2026_exercise Arabic news dataset for text classification. Column Description title News title content News body category Label: سياسة, اقتصاد, صحة, رياضة 28,000 rows (7,000 per category). Download and load as pandas from datasets import load_dataset import pandas as pd ds = load_dataset("maher13/news_2026_exercise") df = ds["train"].to_pandas() print(df.head()) Sample N rows from each category from datasets import… See the full description on the dataset page: https://huggingface.co/datasets/maher13/news_2026_exercise.
033
news2026exercise
Arabic news dataset for text classification.
28,000 rows (7,000 per category).
Download and load as pandas
from datasets import load_dataset
import pandas as pd
ds = load_dataset("maher13/news_2026_exercise")
df = ds["train"].to_pandas()
print(df.head())Sample N rows from each category
from datasets import load_dataset
import pandas as pd
N = 100 # change this
ds = load_dataset("maher13/news_2026_exercise")
df = ds["train"].to_pandas()
sample_df = (
df.groupby("category", group_keys=False)
.apply(lambda x: x.sample(n=min(N, len(x)), random_state=42))
.reset_index(drop=True)
)
print(sample_df["category"].value_counts())
print(sample_df.head())