{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 📊 Myanmar Ghost - Data Exploration\n", "\n", "This notebook explores the Myanmar Ghost dataset." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import sys\n", "sys.path.insert(0, '..')\n", "\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "\n", "sns.set_style('whitegrid')\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Load sample data\n", "df = pd.read_csv('../data/processed/splits/train.csv')\n", "df.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Label distribution\n", "plt.figure(figsize=(8, 5))\n", "df['label'].value_counts().plot(kind='bar', color='steelblue')\n", "plt.title('Sentiment Label Distribution')\n", "plt.xlabel('Sentiment')\n", "plt.ylabel('Count')\n", "plt.xticks(rotation=45)\n", "plt.tight_layout()\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Text length distribution\n", "df['text_length'] = df['text'].str.len()\n", "\n", "plt.figure(figsize=(10, 5))\n", "sns.histplot(data=df, x='text_length', hue='label', kde=True)\n", "plt.title('Text Length Distribution by Sentiment')\n", "plt.xlabel('Text Length (characters)')\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Sample texts\n", "print(\"=== Positive Examples ===\")\n", "for text in df[df['label']=='positive']['text'].head(3):\n", " print(f\"- {text}\")\n", "\n", "print(\"\\n=== Negative Examples ===\")\n", "for text in df[df['label']=='negative']['text'].head(3):\n", " print(f\"- {text}\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "name": "python", "version": "3.10.0" } }, "nbformat": 4, "nbformat_minor": 4 }