GithubHelp home page GithubHelp logo

gandalfthegraydelson / cs224u Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cgpotts/cs224u

0.0 0.0 0.0 41.35 MB

Code for Stanford CS224u

License: Apache License 2.0

Python 4.04% Jupyter Notebook 95.96%

cs224u's Introduction

CS224u: Natural Language Understanding

Code for the Stanford course.

Spring 2023

Christopher Potts

Core components

setup.ipynb

Details on how to get set up to work with this code.

hw_*.ipynb

The set of homeworks for the current run of the course.

tutorial_* notebooks

Introductions to Jupyter notebooks, scientific computing with NumPy and friends, and PyTorch.

torch_*.py modules

A generic optimization class (torch_model_base.py) and subclasses for GloVe, Autoencoders, shallow neural classifiers, RNN classifiers, tree-structured networks, and grounded natural language generation.

tutorial_pytorch_models.ipynb shows how to use these modules as a general framework for creating original systems.

evaluation_*.ipynb and projects.md

Notebooks covering key experimental methods and practical considerations, and tips on writing up and presenting work in the field.

iit* and feature_attribution.ipynb

Part of our unit on explainability and model analysis.

np_*.py modules

This is now considered background material for the course.

Reference implementations for the torch_*.py models, designed to reveal more about how the optimization process works.

vsm_*

This is now considered background material for the course.

A unit on vector space models of meaning, covering traditional methods like PMI and LSA as well as newer methods like Autoencoders and GloVe. vsm.py provides a lot of the core functionality, and torch_glove.py and torch_autoencoder.py are the learned models that we cover. vsm_03_contextualreps.ipynb explores methods for deriving static representations from contextual models.

sst_*

This is now considered background material for the course.

A unit on sentiment analysis with the English Stanford Sentiment Treebank. The core code is sst.py, which includes a flexible experimental framework. All the PyTorch classifiers are put to use as well: torch_shallow_neural_network.py, torch_rnn_classifier.py, and torch_tree_nn.py.

finetuning.ipynb

This is now considered background material for the course.

Using pretrained parameters from Hugging Face for featurization and fine-tuning.

utils.py

Miscellaneous core functions used throughout the code.

test/

To run these tests, use

py.test -vv test/*

or, for just the tests in test_shallow_neural_classifiers.py,

py.test -vv test/test_shallow_neural_classifiers.py

If the above commands don't work, try

python3 -m pytest -vv test/test_shallow_neural_classifiers.py

License

The materials in this repo are licensed under the Apache 2.0 license and a Creative Commons Attribution-ShareAlike 4.0 International license.

cs224u's People

Contributors

cgpotts avatar insop avatar wcmac avatar atticusg avatar miguelusque avatar arun-ghontale avatar sebastianhurubaru avatar ignaciocases avatar ryanprince avatar zijwang avatar e-budur avatar vzhong avatar codeandfire avatar lucy3 avatar amirziai avatar anthonyperez avatar upwardtrajectory avatar dbarkar avatar eltociear avatar jervisfm avatar lorarjohns avatar qnu avatar pablonm3 avatar snowyowl2 avatar stas00 avatar udborets avatar yekut 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.