Code Monkey home page Code Monkey logo

language-modeling-on-penn-treebank's Introduction

Language Modeling on Penn Treebank

Introduction

The primary objective of this project is to design and train a language model on the Penn Treebank dataset. The Penn Treebank is a corpus of approximately 1 million tokens, which might seem extensive but is relatively small for language models. The goal is to predict the next token in a sequence based on the preceding N tokens. This project is a venture into the realm of unsupervised learning, and participants are encouraged to experiment with various architectures and techniques, including RNN, LSTM, GRU, attention mechanisms, different tokenizers, pretrained embeddings, hyperparameter tuning, regularization, and dropout.

Requirements

This project has been implemented using Python 3.10.

To set up your environment and install the necessary dependencies:

    # create a virtual environment
    py -m venv env
    # windows only
    env\Scripts\activate
    # linux or mac
    source env/bin/activate
    
    # install requirements
    pip install -r requirements.txt

Additionally, you'll need to fetch the Penn Treebank dataset using the datasets library from huggingface. Instructions on how to load and preprocess the data are provided in the project description.

Running the Code

The code is primarily written in a Jupyter notebook format, which allows for iterative experimentation and analysis. This format is also compatible with Google Colab for those who prefer cloud-based execution with GPU support.

Project Structure

    .
    ├── README.md
    ├── requirements.txt
    └── Language_Modeling.ipynb

The Jupyter notebook contains the code, including model definitions, data preprocessing, training loops, and evaluation metrics.

Model

Participants are encouraged to experiment with a plethora of model architectures and techniques. This includes classical RNN structures, LSTMs, GRUs, attention mechanisms, and more. Additionally, experimenting with pretrained embeddings such as word2vec or GloVe can be beneficial, though using pretrained models like BERT or GPT-3 is not allowed.

Authors

Parsa Mazaheri, Dec 2022

language-modeling-on-penn-treebank's People

Contributors

parsa-mz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.