Giter VIP home page Giter VIP logo

l101's Introduction

L101 Machine Learning for NLP Project

This repository contains the report and scripts produced for my project as part of the L101 course on Machine Learning for NLP, offered by Part III of the Computer Science Tripos at Cambridge University.

Report

The report can be found at report.pdf.

Scripts

All scripts can be found in scripts/. The prepare_data.py script is used for the data preparation and pre-processing step, described in Section 3.1 and 3.2 of the report. To run it, place the GenSpam corpus in the directory and run:

cd data
python ../scripts/prepare_data.py

The prepare_vectors.py script is used to produce sparse and dense vectors for the classifier, as described in Section 3.3. of the report. To produce dense vectors, place a set of pre-trained word vectors in the data/ repository, such as the Google News word2vec vectors and run:

cd data
python ../scripts/prepare_vectors.py WORDVECFILE FOLDERNAME

This will create sparse and dense vectors using the vocabulary provided by the pre-trained word vectors placed at data/WORDVECFILE and place them in the data/vectors/sparse-FOLDERNAME and data/vectors/dense-FOLDERNAME directories, respectively. To create sparse vectors with the full vocabulary available (the sparse-full vectors) just run the script without any arguments:

cd data
python ../scripts/prepare_vectors.py

The classify_emails.py script is used to run the SVM classifier, as described in Section 3.4 of the report. Run the script as follows:

cd data
python ../scripts/classify_emails.py FOLDERNAME [validation|testing]

Where FOLDERNAME is the name of the folder containing the vectors produced by the previous step. The classifier is run on either the "validation" or "testing" set, according to the second argument.

l101's People

Contributors

codebyzeb avatar

Watchers

James Cloos avatar  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.