{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Google Colab Training Notebook\n", "\n", "This notebook is intended to be run on Google Colab with a T4 GPU. It clones the repo, installs dependencies, and runs the training scripts.\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "!git clone https://github.com/Aryanmishra-dev/Multilingual-Absa.git\n", "%cd Multilingual-Absa\n", "!pip install .\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "# Mount Google Drive to save models and MLflow logs persistently\n", "from google.colab import drive\n", "drive.mount('/content/drive')\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "# Create symlinks or copy data if needed\n", "# Assuming data is in the repo for now\n", "!mkdir -p /content/drive/MyDrive/ABSA_models\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "# Prepare dataset\n", "!PYTHONPATH=src python -m absa.data.hf_dataset\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "# Run Aspect Extraction Training\n", "!PYTHONPATH=src python -m absa.models.train_aspect_extraction\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "# Run Sentiment Classification Training\n", "!PYTHONPATH=src python -m absa.models.train_sentiment\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "# Run Baseline as well\n", "!PYTHONPATH=src python -m absa.models.baseline\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "# Cross-lingual Evaluation\n", "!PYTHONPATH=src python -m absa.evaluation.cross_lingual_eval\n" ] }, { "cell_type": "code", "metadata": {}, "execution_count": null, "outputs": [], "source": [ "# Copy models back to Drive\n", "!cp -r models/* /content/drive/MyDrive/ABSA_models/\n", "!cp -r mlflow /content/drive/MyDrive/ABSA_models/\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.0" } }, "nbformat": 4, "nbformat_minor": 4 }