Skip to content

CongkeChen/Deep-Averaging-Networks-Byte-Pair-Encoding-Skip-Gram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Project for CSE 256 2026 winter project 1.

This project implements several sentiment classification models, including:

  1. Bag-of-Words (BOW) models
  2. Deep Averaging Network (DAN) with word-level embeddings
  3. Subword-based DAN using Byte Pair Encoding (BPE) All models can be trained and evaluated using a single command.

Requirements

Python 3, PyTorch, scikit-learn, matplotlib

How to Run

  1. Train and evaluate BOW models
python main.py --model BOW
  1. Train and evaluate word-level DAN
python main.py --model DAN

This runs the Deep Averaging Network (DAN) using: i. GloVe-initialized word embeddings ii. Randomly initialized word embeddings Both settings are trained and evaluated sequentially.

  1. Train and evaluate subword-based DAN (BPE)
python main.py --model SUBWORDDAN

Optional arguements for BPE:

python main.py --model SUBWORDDAN --bpe_vocab_size 10000 --subword_emb_dim 50

Arguments: --bpe_vocab_size: vocabulary size for BPE (default: 10000) --subword_emb_dim: embedding dimension for subword embeddings (default: 50)

Notes

  1. Word-level DAN uses pre-trained GloVe embeddings when available.

  2. Subword-based DAN initializes embeddings randomly and trains them from scratch.

  3. All experiments are run for 100 epochs.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages