cs224n_Assignments
所属分类:特征抽取
开发工具:Python
文件大小:4638KB
下载次数:0
上传日期:2018-09-22 02:27:07
上 传 者:
sh-1993
说明: 斯坦福大学cs224n作业解决方案
(Stanford University cs224n Assignments solutions)
文件列表:
LICENSE (1062, 2018-09-22)
assignment1 (0, 2018-09-22)
assignment1\Makefile (183, 2018-09-22)
assignment1\assignment description (0, 2018-09-22)
assignment1\assignment description\assignment1.pdf (207927, 2018-09-22)
assignment1\collect_submission.sh (79, 2018-09-22)
assignment1\get_datasets.sh (673, 2018-09-22)
assignment1\imgs (0, 2018-09-22)
assignment1\imgs\q3_word_vectors.png (30818, 2018-09-22)
assignment1\imgs\q4_dev_conf.png (22112, 2018-09-22)
assignment1\imgs\q4_reg_v_acc.png (22666, 2018-09-22)
assignment1\q1_softmax.py (2805, 2018-09-22)
assignment1\q2_gradcheck.py (3315, 2018-09-22)
assignment1\q2_neural.py (4119, 2018-09-22)
assignment1\q2_sigmoid.py (2239, 2018-09-22)
assignment1\q3_run.py (2236, 2018-09-22)
assignment1\q3_sgd.py (4178, 2018-09-22)
assignment1\q3_word2vec.py (10068, 2018-09-22)
assignment1\q4_dev_pred.txt (119461, 2018-09-22)
assignment1\q4_sentiment.py (8022, 2018-09-22)
assignment1\requirements.txt (31, 2018-09-22)
assignment1\saved_params_5000.npy (9058249, 2018-09-22)
assignment1\utils (0, 2018-09-22)
assignment1\utils\__init__.py (0, 2018-09-22)
assignment1\utils\glove.py (733, 2018-09-22)
assignment1\utils\treebank.py (7593, 2018-09-22)
assignment2 (0, 2018-09-22)
assignment2\assignment description (0, 2018-09-22)
assignment2\assignment description\assignment2.pdf (303336, 2018-09-22)
assignment2\model.py (4150, 2018-09-22)
assignment2\q1_classifier.py (8408, 2018-09-22)
assignment2\q1_softmax.py (3642, 2018-09-22)
assignment2\q2_initialization.py (1641, 2018-09-22)
assignment2\q2_parser_model.py (9429, 2018-09-22)
assignment2\q2_parser_transitions.py (6863, 2018-09-22)
assignment2\utils (0, 2018-09-22)
assignment2\utils\__init__.py (0, 2018-09-22)
... ...
# CS224N Assignments
Solutions for cs224n(Deep Learning For Natural Language Processing) course by stanford university
## Prerequisites
1. Install [Anaconda](https://www.continuum.io/downloads "Anaconda Official Website")
2. go to assignmentX where X is either 1, 2, 3 using a Terminal:
```sh
$ cd \path\to\assignment1
```
3. create a python 2.7 environnment using
```sh
$ conda env -n cs224n python=2.7 anaconda
```
4. activate your environment using (add source before activate if you're working with Linux/Mac)
```sh
$ activate cs224n
```
5. install the dependencies using requirements.txt
```sh
$ pip install -r requirements.txt
```
6. Don't forget to deactivate your environment when you're done (add source before deactivate if you're on Linux/Mac)
```sh
$ deactivate cs224n
## Deployment
### Assignment 1
#### Word2vec
Steps for training Word2vec in assignment 1 :
1. Go to folder /assignment 1
2. Run get_datasets.sh(By running this file you can download datasets)
3. Open a terminal and write(Be careful, for this assignment you should have installed python2.7) :
```sh
$ python q3_run.py
```
#### Sentiment Analysis(before you running this section you should download datasets as i mentioned in Word2vec section)
1. If you want to use logistic regression classifier on word vectors that we trained in Word2vec section you can use this code :
```sh
$ cd path/to/assignment1
$ python q4_sentiment.py --yourvectors
```
2. If you want to use pretrained GLOVE model you can use this code :
```sh
$ cd path/to/assignment1
$ python q4_sentiment.py --pretrained
```
## Results
### Assignment 1
#### Word2vec
![images](assignment1/imgs/q3_word_vectors.png)
### Sentiment analysis train/dev accuracy
![images](assignment1/imgs/q4_reg_v_acc.png)
### Sentiment analysis truth table
![images](assignment1/imgs/q4_dev_conf.png)
## Built With
* [Numpy](http://www.numpy.org/) - A library for doing optimized matrix operations
* [Matplotlib](https://matplotlib.org/) - A library for visulizing our outputs as graphs
* [scipy](https://www.scipy.org/) - A Library for doing mathematic, science and engineering stuff.
* [sklearn](http://scikit-learn.org/stable/) - Simple and efficient Library for data mining and data analysis
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
近期下载者:
相关文件:
收藏者: