You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/day2/cyoa.rst
+22-4
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,25 @@ Choose Your Own Adventure
4
4
5
5
The Choose Your Own Adventures have been structured to allow for pure model exploration without worrying as much about the dataset or the training routine. In each notebook, you will find an implemented dataset loading routine as well as an implemented training routine. These two parts should seem familiar to you given the last 2 days of content. What is not implemented is a model definition nor its instantiation.
6
6
7
-
It is up to you what you want to use! Do you want to build the Continuous Bag of Words (CBOW)? Use an RNN or a CNN? Do you want to combine the CNN and RNN? Try out whatever you like and see if you can get the highest accuracy in class!
7
+
8
+
There are kinds of NLP Task you could solve:
9
+
10
+
- Classification
11
+
- (day_2/CYOA-Amazon-Reviews) Sentiment Analysis with Amazon Reviews
12
+
- (day_2/CYOA-Movie-Reviews) Sentiment Analysis with Movie Reviews
- Question Classification with NLTK's question dataset
18
+
- Sequence Prediction
19
+
- Language Model with NLTK's Shakespeare dataset
20
+
- Sequence Tagging
21
+
- NER with NLTK's CoNLL NER dataset
22
+
- Chunking with NLTK's CoNLL Chunking dataset
23
+
24
+
The tasks that have notebooks are indicated. We did not include notebooks for every task to narrow the scope of the in-class work.
25
+
8
26
9
27
Strategies for Model Exploration
10
28
--------------------------------
@@ -50,12 +68,12 @@ More complicated models to try
50
68
1. Better RNNs (Gated Recurrent Unit (GRU), Long Short Term Memory (LSTM))
51
69
- Instead of using the simple RNN provided, use an RNN variant that has gating like GRU or LSTM
52
70
71
+
2. BiRNN
72
+
- Use the bi-directional RNN model from the day_2 notebook
73
+
53
74
2. CNN + RNN
54
75
- One thing you could try is to apply a CNN one or more times to create sequences of vectors that are informed by their neighboring vectors. Then, apply the RNN to learn a sequence model over these vectors. You can use the same method to pull out the final vector for each sequence, but with one caveat. If you apply the CNN in a way that shrinks the sequence dimension, then the indices of the final positions won't quite be right. One way to get around this is to have the CNN keep the sequence dimension the same size. This is done by setting the `padding` argument to be `kernel_size//2`. For example, if `kernel_size=3`, then it should be that `padding=1`. Similarly with `kernel_size=5`, then `padding=2`. The padding is added onto both sides of the sequence dimension.
55
76
56
-
3. Deep Averaging Network
57
-
- The Deep Averaging Network is very similar to CBOW, but has one major differences: it applies an MLP to the pooled vectors.
58
-
59
77
4. Using Attention
60
78
- If you're feeling ambitious, try implementing attention!
61
79
- One way to do attention is use a Linear layer which maps feature vectors to scalars
0 commit comments