Solutions for cs224n(Deep Learning For Natural Language Processing) course by stanford university
- Install Anaconda
- go to assignmentX where X is either 1, 2, 3 using a Terminal:
$ cd \path\to\assignment1
- create a python 2.7 environnment using
$ conda env -n cs224n python=2.7 anaconda
- activate your environment using (add source before activate if you're working with Linux/Mac)
$ activate cs224n
- install the dependencies using requirements.txt
$ pip install -r requirements.txt
- Don't forget to deactivate your environment when you're done (add source before deactivate if you're on Linux/Mac)
$ deactivate cs224n
Steps for training Word2vec in assignment 1 :
- Go to folder /assignment 1
- Run get_datasets.sh(By running this file you can download datasets)
- Open a terminal and write(Be careful, for this assignment you should have installed python2.7) :
$ python q3_run.py
Sentiment Analysis(before you running this section you should download datasets as i mentioned in Word2vec section)
- If you want to use logistic regression classifier on word vectors that we trained in Word2vec section you can use this code :
$ cd path/to/assignment1 $ python q4_sentiment.py --yourvectors
- If you want to use pretrained GLOVE model you can use this code :
$ cd path/to/assignment1 $ python q4_sentiment.py --pretrained
- Numpy - A library for doing optimized matrix operations
- Matplotlib - A library for visulizing our outputs as graphs
- scipy - A Library for doing mathematic, science and engineering stuff.
- sklearn - Simple and efficient Library for data mining and data analysis
This project is licensed under the MIT License - see the LICENSE.md file for details