Skip to content

Getting Started

Prerequisites

To effectively complete this course, you should be familiar with the following:

  • Basic Python knowledge
  • Jupyter notebooks

This course contains some notebooks that are designed to help you understand the concepts and techniques used in the course. You can run them locally or in Google Colab.

Local Setup

If you prefer to run the notebooks locally, you can clone the repository and install the dependencies locally.

# Clone the repository
git clone https://github.com/YangKCLab/social-media-analysis.git
cd social-media-analysis

We use the package manager uv to manage the dependencies. The notebooks need Python 3.12 or newer. Once you have uv installed, you can install the dependencies by running:

uv sync

The notebooks on topic models and toxicity scores also need BERTopic and Detoxify, which are large. Install them with:

uv sync --group ml

The Bluesky and YouTube notebooks need credentials. They read them from a .env file in the notebook's folder, and each notebook's setup cell lists the variable names. Never commit the .env file.

To run the notebooks locally, you can use the following command:

uv run jupyter lab

This will start the JupyterLab server and you can open the notebooks in your browser.

Using Google Colab

It might be easier to run the notebooks in Google Colab. You can do so following the instructions below:

  1. Click "Open in Colab" on any notebook page
  2. Sign in with your Google account
  3. Run cells directly in your browser
  4. To keep your changes, use File > Save a copy in Drive. Colab does not save a notebook opened from GitHub

Feedback and Questions

If you have any feedback or questions (e.g., typos, errors, etc.), please feel free to open an issue on the GitHub repository.