http://wiki.math.uwaterloo.ca/statwiki/api.php?action=feedcontributions&user=Y2434liu&feedformat=atomstatwiki - User contributions [US]2022-09-28T15:47:08ZUser contributionsMediaWiki 1.28.3http://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=34339stat441w18/A New Method of Region Embedding for Text Classification2018-03-15T16:42:31Z<p>Y2434liu: Undo revision 34327 by Y2434liu (talk)</p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words'influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
<br />
[[File:text1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word's influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \ \mathbf{p}_{w_{i-c+1}}^i \cdots \ \mathbf{p}_{w_{i+c-1}}^i \ <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:text classification2.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_i}^{i-c} \ \mathbf{p}_{w_i}^{i-c+1} \cdots \ \mathbf{p}_{w_i}^{i+c-1} \ <br />
\mathbf{p}_{w_i}^{i+c}\right]\right)</math><br />
<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.<br />
<br />
=== Region Embedding For Text Classification ===<br />
For text classification, documents are usually variable-sized, which need to be represented as fixed size vectors. In order to show the effectiveness of our proposed region embedding models, we just sum up the embeddings of all regions to represent a document, and feed it directly to an Full-Connected layer for text classification task.<br />
This layer takes an input volume and outputs an N dimensional vector where N is the number of classes that the program has to choose from. Basically, a FC layer looks at what high level features most strongly correlate to a particular class and has particular weights so that when you compute the products between the weights and the previous layer, you get the correct probabilities for the different classes.<br />
<br />
[[File:FC_layer.PNG]]<br />
<br />
Formally, the model can be represented as following:<br />
<math><br />
\mathbf{f} (\mathbf{x};\mathbf{E}, \mathbf{U},\mathbf{W},\mathbf{b})=<br />
\mathbf{g} (\mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b)<br />
</math><br />
<br />
Where <math> x </math> denotes the input text sequence, <math> W </math> and <math> b </math> denote the weight matrix and bias of the fully connected layer respectively. <math> n </math> denotes the number of regions in a document, <math> r </math> is the region embedding which can be computed by the equation(2).<br />
<math> g </math> and <math> \sigma </math> denote the softmax function of the output layer and the softsign function. <br />
For soft-sign function:<br />
<math>\mathbf{y} = \frac{\mathbf{x}} {1+\lVert \mathbf{x} \rVert} </math><br />
<br />
For soft-max function:<br />
<math>g :\mathbb{R}^{k} \rightarrow \mathbb{ {\left [0,1\right ]}^{k} }</math><br />
<br />
Suppose <math> h </math> is the embedding size and <math> k </math> is the number of text classification. <math> r_{\left (i,c\right )} </math> is a <math> h \times 1 </math> matrix. Also a summation of embedding of all regions in one document <math> \sum_{i=0}^{n} ( r_{\left (i,c\right )} ) </math> has the same dimension and After the soft-sign function, <math> \sigma ( \sum_{i=0}^{n} ( r_{\left (i,c\right )} ) ) </math> is also a <math> h \times 1 </math> matrix.<br />
The weight matrix <math> W </math> is <math> k \times h </math>. The bias of FC layers <math> b </math> measures the difference between final output and the real results, so it is <math> k \times 1 </math> matrix.<br />
So, <math> \mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b </math> becomes <math> k \times 1 </math>.<br />
Finally, After soft-max function transformation, the range is transformed into [0,1]. The object function finally becomes <math> k \times 1 </math>. Which measures the document’s probabilities that belong to each class.<br />
At the beginning, we can set the initial value which is very close to 0 to Weight Matrix, and we can get the initial value of bias of FC layer at the first output. Just as the same mechanism in the Backpropagation Neutral Network, We can update the weight matrix and bias matrix in the training period until we get the optimal.<br />
<br />
= Experiments =<br />
<br />
=== Introduction ===<br />
The experiment in the paper uses the publicly available datasets from Zhang et al. (2015) to evaluate the model. The results are compared with those using several other methods including n-grams, ngrams TFIDF, char-CNN, char-CRNN, bigram-FastText, VDCVV and D-LSTM.<br />
=== Process ===<br />
Firstly, all the texts are tokenized. As for the parameters in the model, optimal hyperparameters are obtained by tuning with 10% of the training set on Yep Review Full dataset. The initial values are assigned to the identical hyperparameters, where the dimension of word embedding is 128 and the region size is 7. In the meantime, the initial learning rate is set to 0.0001 and the batch size is 16.<br />
The region size and embedding size are chosen based on following two experiments.<br />
<br />
[[File:figure 1.png]]<br />
<br />
Figure 1 shows the relationship between different region sizes and accuracy. For single region, when region size equals to 7, the accuracy is the highest. However, adding the multi region of the combination of 3, 5 and 7, it yields to the highest accuracy. It is easy to be understood since the influence ranges between words can differ a lot. For example, the word “very” only emphasizes the next word while the word like “however” might have influence on a lot of following words.<br />
<br />
[[File:figure 2.png]]<br />
<br />
Figure 2 shows the accuracy based on different embedding dimensions and different models. The change of accuracy shows the model proposed in this paper is more robust to overfitting compared with FastText and CNN.<br />
<br />
=== Results ===<br />
The table below shows all the results for the ten different methods on the eight datasets.<br />
<br />
Table 1: Test Set Accuracy [%] Compared to other Methods on several Datasets<br />
[[File:Table 1.jpg]]<br />
<br />
In this table, underscores is used to represent the best published results, and the best records is bolded. The model proposed in this paper wins all the previous models on all datasets except for using VDCNN on Amz.P. and Amz.F.<br />
<br />
Analyzing the performance of this model, consideration of context unit plays an important role. Some comparative experiments are explored to show the effectiveness of the proposed word specific context unit.<br />
<br />
Table 2: Comparative decomposition results on Yelp Review Full dataset. For Fast-Text(Unigram), embedding dimension is 10. For FastText(Win-pool), W.C.region.emb(Scalar) and W.C.region.emb(our model), region size is 7 and embedding dimension is 128<br />
[[File:table2.jpg]]<br />
<br />
The FastText(Unigram) model is the baseline model. The FastText(Win-pool) model is established by removing the entire context units from the model proposed by this paper, which is a variant version of unigram FastText. Then after applying a simplified scalar version of context units to FastText(Win-pool), the model W.C.region.emb(Scalar) can be acquired. Finally W.C.region.emb(our model) is the variant version of W.C.region.emb(Scalar), where each column of scalar context unit is expanded to a dense vector. From the table above, it can be seen that the consideration of context unit can improve the model significantly.<br />
= Conclusion =<br />
The paper proposed two new methods for text classification called Word-Context Region Embedding and Context-Word Region Embedding. The experiments show the accuracy of text classification has improved a lot compared with the previous methods. However, the current result might be improved by introducing more complex upper layers. The power of the local context unit also needs to be tested under unsupervised and semi-supervised learning.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=34327stat441w18/A New Method of Region Embedding for Text Classification2018-03-15T16:12:57Z<p>Y2434liu: </p>
<hr />
<div>= Presented by =<br />
<br />
1. Wang, Xiaohan<br />
<br />
2. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words'influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
<br />
[[File:text1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word's influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \ \mathbf{p}_{w_{i-c+1}}^i \cdots \ \mathbf{p}_{w_{i+c-1}}^i \ <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:text classification2.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_i}^{i-c} \ \mathbf{p}_{w_i}^{i-c+1} \cdots \ \mathbf{p}_{w_i}^{i+c-1} \ <br />
\mathbf{p}_{w_i}^{i+c}\right]\right)</math><br />
<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.<br />
<br />
=== Region Embedding For Text Classification ===<br />
For text classification, documents are usually variable-sized, which need to be represented as fixed size vectors. In order to show the effectiveness of our proposed region embedding models, we just sum up the embeddings of all regions to represent a document, and feed it directly to an Full-Connected layer for text classification task.<br />
This layer takes an input volume and outputs an N dimensional vector where N is the number of classes that the program has to choose from. Basically, a FC layer looks at what high level features most strongly correlate to a particular class and has particular weights so that when you compute the products between the weights and the previous layer, you get the correct probabilities for the different classes.<br />
<br />
[[File:FC_layer.PNG]]<br />
<br />
Formally, the model can be represented as following:<br />
<math><br />
\mathbf{f} (\mathbf{x};\mathbf{E}, \mathbf{U},\mathbf{W},\mathbf{b})=<br />
\mathbf{g} (\mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b)<br />
</math><br />
<br />
Where <math> x </math> denotes the input text sequence, <math> W </math> and <math> b </math> denote the weight matrix and bias of the fully connected layer respectively. <math> n </math> denotes the number of regions in a document, <math> r </math> is the region embedding which can be computed by the equation(2).<br />
<math> g </math> and <math> \sigma </math> denote the softmax function of the output layer and the softsign function. <br />
For soft-sign function:<br />
<math>\mathbf{y} = \frac{\mathbf{x}} {1+\lVert \mathbf{x} \rVert} </math><br />
<br />
For soft-max function:<br />
<math>g :\mathbb{R}^{k} \rightarrow \mathbb{ {\left [0,1\right ]}^{k} }</math><br />
<br />
Suppose <math> h </math> is the embedding size and <math> k </math> is the number of text classification. <math> r_{\left (i,c\right )} </math> is a <math> h \times 1 </math> matrix. Also a summation of embedding of all regions in one document <math> \sum_{i=0}^{n} ( r_{\left (i,c\right )} ) </math> has the same dimension and After the soft-sign function, <math> \sigma ( \sum_{i=0}^{n} ( r_{\left (i,c\right )} ) ) </math> is also a <math> h \times 1 </math> matrix.<br />
The weight matrix <math> W </math> is <math> k \times h </math>. The bias of FC layers <math> b </math> measures the difference between final output and the real results, so it is <math> k \times 1 </math> matrix.<br />
So, <math> \mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b </math> becomes <math> k \times 1 </math>.<br />
Finally, After soft-max function transformation, the range is transformed into [0,1]. The object function finally becomes <math> k \times 1 </math>. Which measures the document’s probabilities that belong to each class.<br />
At the beginning, we can set the initial value which is very close to 0 to Weight Matrix, and we can get the initial value of bias of FC layer at the first output. Just as the same mechanism in the Backpropagation Neutral Network, We can update the weight matrix and bias matrix in the training period until we get the optimal.<br />
<br />
= Experiments =<br />
<br />
=== Introduction ===<br />
The experiment in the paper uses the publicly available datasets from Zhang et al. (2015) to evaluate the model. The results are compared with those using several other methods including n-grams, ngrams TFIDF, char-CNN, char-CRNN, bigram-FastText, VDCVV and D-LSTM.<br />
=== Process ===<br />
Firstly, all the texts are tokenized. As for the parameters in the model, optimal hyperparameters are obtained by tuning with 10% of the training set on Yep Review Full dataset. The initial values are assigned to the identical hyperparameters, where the dimension of word embedding is 128 and the region size is 7. In the meantime, the initial learning rate is set to 0.0001 and the batch size is 16.<br />
The region size and embedding size are chosen based on following two experiments.<br />
<br />
[[File:figure 1.png]]<br />
<br />
Figure 1 shows the relationship between different region sizes and accuracy. For single region, when region size equals to 7, the accuracy is the highest. However, adding the multi region of the combination of 3, 5 and 7, it yields to the highest accuracy. It is easy to be understood since the influence ranges between words can differ a lot. For example, the word “very” only emphasizes the next word while the word like “however” might have influence on a lot of following words.<br />
<br />
[[File:figure 2.png]]<br />
<br />
Figure 2 shows the accuracy based on different embedding dimensions and different models. The change of accuracy shows the model proposed in this paper is more robust to overfitting compared with FastText and CNN.<br />
<br />
=== Results ===<br />
The table below shows all the results for the ten different methods on the eight datasets.<br />
<br />
Table 1: Test Set Accuracy [%] Compared to other Methods on several Datasets<br />
[[File:Table 1.jpg]]<br />
<br />
In this table, underscores is used to represent the best published results, and the best records is bolded. The model proposed in this paper wins all the previous models on all datasets except for using VDCNN on Amz.P. and Amz.F.<br />
<br />
Analyzing the performance of this model, consideration of context unit plays an important role. Some comparative experiments are explored to show the effectiveness of the proposed word specific context unit.<br />
<br />
Table 2: Comparative decomposition results on Yelp Review Full dataset. For Fast-Text(Unigram), embedding dimension is 10. For FastText(Win-pool), W.C.region.emb(Scalar) and W.C.region.emb(our model), region size is 7 and embedding dimension is 128<br />
[[File:table2.jpg]]<br />
<br />
The FastText(Unigram) model is the baseline model. The FastText(Win-pool) model is established by removing the entire context units from the model proposed by this paper, which is a variant version of unigram FastText. Then after applying a simplified scalar version of context units to FastText(Win-pool), the model W.C.region.emb(Scalar) can be acquired. Finally W.C.region.emb(our model) is the variant version of W.C.region.emb(Scalar), where each column of scalar context unit is expanded to a dense vector. From the table above, it can be seen that the consideration of context unit can improve the model significantly.<br />
= Conclusion =<br />
The paper proposed two new methods for text classification called Word-Context Region Embedding and Context-Word Region Embedding. The experiments show the accuracy of text classification has improved a lot compared with the previous methods. However, the current result might be improved by introducing more complex upper layers. The power of the local context unit also needs to be tested under unsupervised and semi-supervised learning.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32978stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T03:50:04Z<p>Y2434liu: /* Region Embedding For Text Classification */</p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words'influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
<br />
[[File:text1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word's influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \ \mathbf{p}_{w_{i-c+1}}^i \cdots \ \mathbf{p}_{w_{i+c-1}}^i \ <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:text classification2.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_i}^{i-c} \ \mathbf{p}_{w_i}^{i-c+1} \cdots \ \mathbf{p}_{w_i}^{i+c-1} \ <br />
\mathbf{p}_{w_i}^{i+c}\right]\right)</math><br />
<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.<br />
<br />
=== Region Embedding For Text Classification ===<br />
For text classification, documents are usually variable-sized, which need to be represented as fixed size vectors. In order to show the effectiveness of our proposed region embedding models, we just sum up the embeddings of all regions to represent a document, and feed it directly to an Full-Connected layer for text classification task.<br />
This layer takes an input volume and outputs an N dimensional vector where N is the number of classes that the program has to choose from. Basically, a FC layer looks at what high level features most strongly correlate to a particular class and has particular weights so that when you compute the products between the weights and the previous layer, you get the correct probabilities for the different classes.<br />
<br />
[[File:FC_layer.PNG]]<br />
<br />
Formally, the model can be represented as following:<br />
<math><br />
\mathbf{f} (\mathbf{x};\mathbf{E}, \mathbf{U},\mathbf{W},\mathbf{b})=<br />
\mathbf{g} (\mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b)<br />
</math><br />
<br />
Where <math> x </math> denotes the input text sequence, <math> W </math> and <math> b </math> denote the weight matrix and bias of the fully connected layer respectively. <math> n </math> denotes the number of regions in a document, <math> r </math> is the region embedding which can be computed by the equation(2).<br />
<math> g </math> and <math> \sigma </math> denote the softmax function of the output layer and the softsign function. <br />
For soft-sign function:<br />
<math>\mathbf{y} = \frac{\mathbf{x}} {1+\lVert \mathbf{x} \rVert} </math><br />
<br />
For soft-max function:<br />
<math>\sigma :\mathbb{R}^{k} \rightarrow \mathbb{ {\left [0,1\right ]}^{k} }</math><br />
<br />
Suppose <math> h </math> is the embedding size and <math> k </math> is the number of text classification. <math> r_{\left (i,c\right )} </math> is a <math> h \times 1 </math> matrix. Also a summation of embedding of all regions in one document <math> \sum_{i=0}^{n} ( r_{\left (i,c\right )} ) </math> has the same dimension and After the soft-sign function, <math> \sigma ( \sum_{i=0}^{n} ( r_{\left (i,c\right )} ) ) </math> is also a <math> h \times 1 </math> matrix.<br />
The weight matrix <math> W </math> is <math> k \times h </math>. The bias of FC layers <math> b </math> measures the difference between final output and the real results, so it is <math> k \times 1 </math> matrix.<br />
So, <math> \mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b </math> becomes <math> k \times 1 </math>.<br />
Finally, After soft-max function transformation, the range is transformed into [0,1]. The object function finally becomes <math> k \times 1 </math>. Which measures the document’s probabilities that belong to each class.<br />
At the beginning, we can set the initial value which is very close to 0 to Weight Matrix, and we can get the initial value of bias of FC layer at the first output. Just as the same mechanism in the Backpropagation Neutral Network, We can update the weight matrix and bias matrix in the training period until we get the optimal.<br />
<br />
=== 4.3 Results ===<br />
The table below shows all the results for the ten different methods on the eight datasets.<br />
<br />
Table 1: Test Set Accuracy [%] Compared to other Methods on several Datasets<br />
[[File:Table 1.jpg]]<br />
<br />
In this table, underscores is used to represent the best published results, and the best records is bolded. The model proposed in this paper wins all the previous models on all datasets except for using VDCNN on Amz.P. and Amz.F.<br />
<br />
Analyzing the performance of this model, consideration of context unit plays an important role. Some comparative experiments are explored to show the effectiveness of the proposed word specific context unit.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32975stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T03:42:07Z<p>Y2434liu: /* Region Embedding For Text Classification */</p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words'influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
<br />
[[File:text1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word's influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \ \mathbf{p}_{w_{i-c+1}}^i \cdots \ \mathbf{p}_{w_{i+c-1}}^i \ <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:text classification2.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_i}^{i-c} \ \mathbf{p}_{w_i}^{i-c+1} \cdots \ \mathbf{p}_{w_i}^{i+c-1} \ <br />
\mathbf{p}_{w_i}^{i+c}\right]\right)</math><br />
<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.<br />
<br />
=== Region Embedding For Text Classification ===<br />
For text classification, documents are usually variable-sized, which need to be represented as fixed size vectors. In order to show the effectiveness of our proposed region embedding models, we just sum up the embeddings of all regions to represent a document, and feed it directly to an Full-Connected layer for text classification task.<br />
This layer takes an input volume and outputs an N dimensional vector where N is the number of classes that the program has to choose from. Basically, a FC layer looks at what high level features most strongly correlate to a particular class and has particular weights so that when you compute the products between the weights and the previous layer, you get the correct probabilities for the different classes.<br />
<br />
[[File:FC_layer.PNG]]<br />
<br />
Formally, the model can be represented as following:<br />
<math><br />
\mathbf{f} (\mathbf{x};\mathbf{E}, \mathbf{U},\mathbf{W},\mathbf{b})=<br />
\mathbf{g} (\mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b)<br />
</math><br />
<br />
Where <math> x </math> denotes the input text sequence, <math> W </math> and <math> b </math> denote the weight matrix and bias of the fully connected layer respectively. <math> n </math> denotes the number of regions in a document, <math> r </math> is the region embedding which can be computed by the equation(2).<br />
<math> g </math> and <math> \sigma </math> denote the softmax function of the output layer and the softsign function. <br />
For soft-sign function:<br />
<math>\mathbf{y} = \frac{x} {1+\left| x \right|} </math><br />
<br />
For soft-max function:<br />
<math>\sigma :\mathbb{R}^{k} \rightarrow \mathbb{ {\left [0,1\right ]}^{k} }</math><br />
<br />
Suppose <math> h </math> is the embedding size and <math> k </math> is the number of text classification. <math> r_{\left (i,c\right )} </math> is a <math> h \times 1 </math> matrix. Also a summation of embedding of all regions in one document <math> \sum_{i=0}^{n} ( r_{\left (i,c\right )} ) </math> has the same dimension and After the soft-sign function, <math> \sigma ( \sum_{i=0}^{n} ( r_{\left (i,c\right )} ) ) </math> is also a <math> h \times 1 </math> matrix.<br />
The weight matrix <math> W </math> is <math> k \times h </math>. The bias of FC layers <math> b </math> measures the difference between final output and the real results, so it is <math> k \times 1 </math> matrix.<br />
So, <math> \mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b </math> becomes <math> k \times 1 </math>.<br />
Finally, After soft-max function transformation, the range is transformed into [0,1]. The object function finally becomes <math> k \times 1 </math>. Which measures the document’s probabilities that belong to each class.<br />
At the beginning, we can set the initial value which is very close to 0 to Weight Matrix, and we can get the initial value of bias of FC layer at the first output. Just as the same mechanism in the Backpropagation Neutral Network, We can update the weight matrix and bias matrix in the training period until we get the optimal.<br />
<br />
=== 4.3 Results ===<br />
The table below shows all the results for the ten different methods on the eight datasets.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32974stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T03:36:10Z<p>Y2434liu: </p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words'influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
<br />
[[File:text1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word's influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \ \mathbf{p}_{w_{i-c+1}}^i \cdots \ \mathbf{p}_{w_{i+c-1}}^i \ <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:text classification2.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_i}^{i-c} \ \mathbf{p}_{w_i}^{i-c+1} \cdots \ \mathbf{p}_{w_i}^{i+c-1} \ <br />
\mathbf{p}_{w_i}^{i+c}\right]\right)</math><br />
<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.<br />
<br />
=== Region Embedding For Text Classification ===<br />
For text classification, documents are usually variable-sized, which need to be represented as fixed size vectors. In order to show the effectiveness of our proposed region embedding models, we just sum up the embeddings of all regions to represent a document, and feed it directly to an Full-Connected layer for text classification task.<br />
This layer takes an input volume and outputs an N dimensional vector where N is the number of classes that the program has to choose from. Basically, a FC layer looks at what high level features most strongly correlate to a particular class and has particular weights so that when you compute the products between the weights and the previous layer, you get the correct probabilities for the different classes.<br />
<br />
[[File:FC_layer.PNG]]<br />
<br />
Formally, the model can be represented as following:<br />
<math><br />
\mathbf{f} (\mathbf{x};\mathbf{E}, \mathbf{U},\mathbf{W},\mathbf{b})=<br />
\mathbf{g} (\mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b)<br />
</math><br />
<br />
Where <math> x </math> denotes the input text sequence, <math> W </math> and <math> b </math> denote the weight matrix and bias of the fully connected layer respectively. <math> n </math> denotes the number of regions in a document, <math> r <\math> is the region embedding which can be computed by the equation(2).<br />
<math> g </math> and \sigma denote the softmax function of the output layer and the softsign function. <br />
For soft-sign function:<br />
<math>\mathbf{y} = \frac{x} {1+\left| x \right|} </math><br />
<br />
For soft-max function:<br />
<math><br />
\sigma :\mathbb{R}^{k} \rightarrow \mathbb{ {[0,1]}^{k} }<br />
<\math><br />
<br />
Suppose <math> h <\math> is the embedding size and <math> k <\math> is the number of text classification. <math> r_{(i,c)} <\math> is a <math> h \times 1 <\math> matrix. Also a summation of embedding of all regions in one document <math> \sum_{i=0}^{n} ( r_{(i,c)} ) <\math> has the same dimension and After the soft-sign function, <math> \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) <\math> is also a <math> h \times 1 <\math> matrix.<br />
The weight matrix <math> W <\math> is <math> k \times h <\math>. The bias of FC layers <math> b <\math> measures the difference between final output and the real results, so it is <math> k \times 1 <\math> matrix.<br />
So, <math> \mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b <\math> becomes <math> k \times 1 <\math>.<br />
Finally, After soft-max function transformation, the range is transformed into [0,1]. The object function finally becomes <math> k \times 1 <\math>. Which measures the document’s probabilities that belong to each class.<br />
At the beginning, we can set the initial value which is very close to 0 to Weight Matrix, and we can get the initial value of bias of FC layer at the first output. Just as the same mechanism in the Backpropagation Neutral Network, We can update the weight matrix and bias matrix in the training period until we get the optimal.<br />
<br />
=== 4.3 Results ===<br />
The table below shows all the results for the ten different methods on the eight datasets.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32972stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T03:34:23Z<p>Y2434liu: </p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words'influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
<br />
[[File:text1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word's influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \ \mathbf{p}_{w_{i-c+1}}^i \cdots \ \mathbf{p}_{w_{i+c-1}}^i \ <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:text classification2.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_i}^{i-c} \ \mathbf{p}_{w_i}^{i-c+1} \cdots \ \mathbf{p}_{w_i}^{i+c-1} \ <br />
\mathbf{p}_{w_i}^{i+c}\right]\right)</math><br />
<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.<br />
<br />
=== Region Embedding For Text Classification ===<br />
For text classification, documents are usually variable-sized, which need to be represented as fixed size vectors. In order to show the effectiveness of our proposed region embedding models, we just sum up the embeddings of all regions to represent a document, and feed it directly to an Full-Connected layer for text classification task.<br />
This layer takes an input volume and outputs an N dimensional vector where N is the number of classes that the program has to choose from. Basically, a FC layer looks at what high level features most strongly correlate to a particular class and has particular weights so that when you compute the products between the weights and the previous layer, you get the correct probabilities for the different classes.<br />
<br />
[[File:FC_layer.PNG]]<br />
<br />
Formally, the model can be represented as following:<br />
<math><br />
\mathbf{f} (\mathbf{x};\mathbf{E}, \mathbf{U},\mathbf{W},\mathbf{b})=<br />
\mathbf{g} (\mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b)<br />
</math><br />
<br />
Where <math> x </math> denotes the input text sequence, <math> W </math> and <math> b </math> denote the weight matrix and bias of the fully connected layer respectively. <math> n </math> denotes the number of regions in a document, <math> r </math> is the region embedding which can be computed by the equation(2).<br />
<math> g </math> and <math> \sigma </math> denote the softmax function of the output layer and the softsign function. <br />
For soft-sign function:<br />
<math><br />
\mathbf{y} = \frac{x} {1+\left| x \right|} <br />
<\math><br />
<br />
For soft-max function:<br />
<math><br />
\sigma :\mathbb{R}^{k} \rightarrow \mathbb{ {[0,1]}^{k} }<br />
<\math><br />
<br />
Suppose <math> h <\math> is the embedding size and <math> k <\math> is the number of text classification. <math> r_{(i,c)} <\math> is a <math> h \times 1 <\math> matrix. Also a summation of embedding of all regions in one document <math> \sum_{i=0}^{n} ( r_{(i,c)} ) <\math> has the same dimension and After the soft-sign function, <math> \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) <\math> is also a <math> h \times 1 <\math> matrix.<br />
The weight matrix <math> W <\math> is <math> k \times h <\math>. The bias of FC layers <math> b <\math> measures the difference between final output and the real results, so it is <math> k \times 1 <\math> matrix.<br />
So, <math> \mathbf{W} \sigma ( \sum_{i=0}^{n} ( r_{(i,c)} ) ) +b <\math> becomes <math> k \times 1 <\math>.<br />
Finally, After soft-max function transformation, the range is transformed into [0,1]. The object function finally becomes <math> k \times 1 <\math>. Which measures the document’s probabilities that belong to each class.<br />
At the beginning, we can set the initial value which is very close to 0 to Weight Matrix, and we can get the initial value of bias of FC layer at the first output. Just as the same mechanism in the Backpropagation Neutral Network, We can update the weight matrix and bias matrix in the training period until we get the optimal.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32960stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:56:48Z<p>Y2434liu: /* Method */</p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
<br />
[[File:text1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word’s influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \ \mathbf{p}_{w_{i-c+1}}^i \cdots \ \mathbf{p}_{w_{i+c-1}}^i \ <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:text classificantion2.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_i}^{i-c} \ \mathbf{p}_{w_i}^{i-c+1} \cdots \ \mathbf{p}_{w_i}^{i+c-1} \ <br />
\mathbf{p}_{w_i}^{i+c}\right]\right)</math><br />
<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32957stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:54:34Z<p>Y2434liu: /* Word-context region embedding */</p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
[[File:1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word’s influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \ \mathbf{p}_{w_{i-c+1}}^i \cdots \ \mathbf{p}_{w_{i+c-1}}^i \ <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:Example.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
f2<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32955stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:52:38Z<p>Y2434liu: /* Word-context region embedding */</p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
[[File:1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word’s influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \mathbf{p}_{w_{i-c+1}}^i \cdots \mathbf{p}_{w_{i+c-1}}^i <br />
\mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:Example.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
f2<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32954stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:52:02Z<p>Y2434liu: /* Word-context region embedding */</p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
[[File:1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word’s influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> \mathbf{r}_{\left(i,c\right)}=max\left(\left[\mathbf{p}_{w_{i-c}}^i \mathbf{p}_{w_{i-c+1}}^i \cdots \mathbf{p}_{w_{i+c-1}}^i \mathbf{p}_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:Example.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
f2<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32952stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:48:41Z<p>Y2434liu: /* Word-context region embedding */</p>
<hr />
<div>= Presented by =<br />
<br />
1. Liu, Yanting<br />
<br />
2. Huang, Jingyue<br />
<br />
3. Wang, Xiaohan<br />
<br />
4. Yao, Tangxinxin<br />
<br />
5. Li, Kecheng<br />
<br />
6. Pan, Lisi<br />
<br />
7. Liu, Mingguang<br />
<br />
8. Fan, Ming<br />
<br />
= Introduction =<br />
<br />
Text classification involves many areas such as topic categorization, sentiment analysis and search query classification. After years of study researchers have developed a number of methods for feature engineering. A simple but effective approach for text classification is the bag-of-words model. That is to represent documents as vectors and train a classifier based on these representations using methods like Support Vector Machines and Naive Bayes. However this kind of model ignores the word order, which is very useful at least in sentiment analysis.<br />
<br />
To utilize the order information, people developed N-gram model, which is to predict the Nth word base on the last N-1 words with Markov Chain Model. Yet it still has limitations. For example, as the length N increases the number of parameters becomes large then the estimation suffers from the data sparsity problem.<br />
<br />
In this paper, authors proposed to learn the region embedding (following Johnson & Zhang 2015) of n-grams for a specific task. Intuitively the meaning of a word is defined by the meaning of itself and that of words in surrounding context. Therefore, the extended embedding consists of two parts: the embedding of the word itself and a matrix describing its interaction with local context (called local context unit). Then the region embedding of an N-gram is constructed using extended embedding of all words in this N-gram. For the text classification task, documents can then be represented as a bag of region embeddings and we can train a classifier on the basis of these region embeddings.<br />
<br />
= Related work=<br />
<br />
'''FastText''' FastText uses the word embeddings to represent a document and a fully connected linear layer as the classifier. To make use of order information of small regions it uses hand-crafted n-grams as features in addition to single words.<br />
<br />
'''CNN''' Convolutional Neural Network is a feed-forward network with convolutional layers. The essence of CNN is to learn word embeddings for small size regions and each kernel of convolutional layer tries to capture a specific semantic or structural feature.<br />
<br />
=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
[[File:1.jpg]]<br />
<br />
From the bottom to the top, the architecture is,<br />
<br />
Step1: Find the middle word <math>\omega_{i}</math> and choose t from -c to c.<br />
<br />
Step2: We use the local context unit of the middle word and the original word embeddings in a region and do element-wise multiply to perform the projected embeddings in a word-to-context view, <br />
<br />
<math>\mathbf{p}_{w_{i+t}}^i = \mathbf{K}_{\omega_i,t}\cdot\mathbf{e}_{w_{i+t}}</math><br />
<br />
where the projected embeddings can reflect the middle word’s influences on the context words. <br />
<br />
Step3: Once the projected embeddings are obtained, a max pooling operation is applied to extract the most predictive features in the region. The output of the max pooling operation can be regarded as a task related region embedding in a word-to-context view.<br />
<br />
<math> '''r'''_{\left(i,c\right)}=max\left(\left['''p'''_{w_{i-c}}^i ['''p'''_{w_{i-c+1}}^i \cdots['''p'''_{w_{i+c-1}}^i ['''p'''_{w_{i+c}}^i\right]\right)</math><br />
<br />
=== context - Word region embedding ===<br />
The second architecture goes as a different view, which addresses the local context words’ influences on the middle word in the region, and we call this Context-Word region embedding.<br />
<br />
[[File:Example.jpg]]<br />
<br />
The difference is the projected embeddings are computed by the original word embedding of the middle word and the context units of all words in the region, then the Context-Word region embedding can be obtained by a max pooling operation through the column dimension of the projected embedding matrix:<br />
<br />
f2<br />
<br />
Two models take different ways to produce the projected word embeddings, the Word-Context model uses context units of middle words and word embeddings of context words, while the Context-Word model uses context units of context words and word embeddings of the middle word.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32942stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:25:43Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32941stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:25:19Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t \in \left [ -c,c \right ] \right )</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32940stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:23:55Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t\in\left [ -c,c \right ]</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32939stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:22:55Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t\in\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> <br />
where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32938stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:22:01Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_{\omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_{\omega_i} \left (t\in\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>\mathbf{e}_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_{\omega_i,t} \odot \mathbf{\omega_{i+t}}</math> where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32937stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:20:32Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_{\omega_i}\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_\{omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_\omega_i \left (t\in\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>\mathbf(e)_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_\{omega_i,t} \odot \mathbf{\omega_{i+t}}</math> where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32936stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:19:33Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_{\omega_i}</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_\omega_i\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_\{omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_\omega_i \left (t\in\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>\mathbf(e)_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_\{omega_i,t} \odot \mathbf{\omega_{i+t}}</math> where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle words influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word's influences on the context words. For example, in the sentence ''The food is not very good in this hotel'', the occurrence of word ''not'' might bring a semantic reversal to the local region.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32933stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:14:52Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\in \mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_\omega_i</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_\omega_i\in \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_\{omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_\omega_i \left (t\in\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>\mathbf(e)_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_\{omega_i,t} \odot \mathbf{\omega_{i+t}}</math> where <math>\odot</math> denotes an element-wise multiplication.<br />
<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.<br />
<br />
=== Word-context region embedding ===<br />
<br />
We proposed two architectures to perform the region embedding from different perspectives.<br />
The first one is word-context region embedding, and the second one is context-word region embedding. In this paper, we consider middle words of the regions, hence we can compose the semantics of a give region only by the middle word’s influences on the context words, or the context words’ influences on the middle word. The most important thing from these two different perspectives in this model is the interaction between words.<br />
<br />
In the first proposed architecture, we focus on addressing the middle word’s influences on the context words. For example, in the sentence “The food is not very good in this hotel”, the occurrence of word “not” might bring a semantic reversal to the local region.<br />
<br />
The figure below is the architecture in a word-context view.<br />
[[File:[[File:C:\Users\likec\Desktop\Notes\sta441\1.jpg]]]]</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32930stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:10:57Z<p>Y2434liu: </p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> \mathbf{E}\isin mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> \mathbf{e}_\omega_i</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> \mathbf{K}_\omega_i\isin \mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> \mathbf{K}_\{omega_i,t} </math> be the (c+t)-th column in <math> \mathbf{K}_\omega_i \left (t\isin\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>\mathbf(e)_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>\mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> \mathbf{p}_{\omega_i+t}^i = \mathbf{K}_\{omega_i,t} \odot \mathbf{\omega_{i+t}}</math> where <math>\odot</math> denotes an elemet-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32929stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:07:12Z<p>Y2434liu: /* Method */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> mathbf{E}\isin mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math> mathbf{e}_\omega_i</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> mathbf{K}_\omega_i\isin mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> mathbf{K}_\{omega_i,t} </math> be the (c+t)-th column in <math> mathbf{K}_\omega_i \left (t\isin\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>mathbf(e)_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> mathbf{p}_{\omega_i+t}^i = mathbf{K}_\{omega_i,t} \odot mathbf{\omega_{i+t}}</math> where <math>\odot</math> denotes an elemet-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32928stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:06:12Z<p>Y2434liu: /* Local context unit */</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> mathbf{E}\isin mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math>mathbf{e}_\omega_i</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> mathbf{K}_\omega_i\isin mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> mathbf{K}_\{omega_i,t} </math> be the (c+t)-th column in <math> mathbf{K}_\omega_i \left (t\isin\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>mathbf(e)_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> mathbf{p}_{\omega_i+t}^i = mathbf{K}_\{omega_i,t} \odot mathbf{\omega_{i+t}}</math> where <math>\odot</math> denotes an elemet-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18&diff=32926stat441w182018-03-08T02:05:07Z<p>Y2434liu: /* Paper presentation */</p>
<hr />
<div><br />
<br />
[https://docs.google.com/forms/d/1HrpW_lnn4jpFmoYKJBRAkm-GYa8djv9iZXcESeVB7Ts/prefill Your feedback on presentations]<br />
<br />
=Paper presentation=<br />
{| class="wikitable"<br />
<br />
{| border="1" cellpadding="3"<br />
|-<br />
|width="60pt"|Date<br />
|width="100pt"|Name <br />
|width="30pt"|Paper number <br />
|width="700pt"|Title<br />
|width="30pt"|Link to the paper<br />
|width="30pt"|Link to the summary<br />
|-<br />
|Feb 15 (example)||Ri Wang || ||Sequence to sequence learning with neural networks.||[http://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf Paper] || [http://wikicoursenote.com/wiki/Stat946f15/Sequence_to_sequence_learning_with_neural_networks#Long_Short-Term_Memory_Recurrent_Neural_Network Summary]<br />
|-<br />
|Mar 8 || || 1|| || || <br />
|-<br />
|Mar 8 || || 2|| || || <br />
|-<br />
|Mar 13 ||Faith Lee, Shiwei Gong, Jacob Lisulov || 3|| Random Features for Large Scale Kernel Machines || [https://people.eecs.berkeley.edu/~brecht/papers/07.rah.rec.nips.pdf]|| [https://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/summary_1]<br />
|-<br />
|Mar 13 ||Zekai S., Yitian W., Hamza M., Cameron M., Benjamin S., Xiowen S., Pavle M. || 4|| Convolutional Neural Networks for Sentence Classification ||[https://arxiv.org/pdf/1408.5882.pdf Paper] || [http://wikicoursenote.com/wiki/stat441w18/Convolutional_Neural_Networks_for_Sentence_Classification Summary]<br />
|-<br />
|Mar 15 ||Victor Stoev, Alex Florian, Deep Morjaria, Alessandra Iaboni, Amar Bhalla, Zach Poole, Thomas Lu, Wendy Zhang || 5|| Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm || [https://arxiv.org/abs/1712.01815 Paper] || [http://wikicoursenote.com/wiki/stat441w18/mastering-chess-and-shogi-self-play Summary]<br />
|-<br />
|Mar 15 || Kecheng Li, Lisi Pan, Yanting Liu, Tangxinxin Yao, Jingyue Huang, Ming Fan, Mingguang Liu, Xiaohan Wang || 6|| A New Method of Region Embedding for Text Classification || [https://openreview.net/pdf?id=BkSDMA36Z Paper] ||[https://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&action=edit Summary]<br />
|-<br />
|Mar 20 || Yufeng Yue, Shanzi Wang, Yumeng Li, Yuyang Bao, Yun Shi, Wan Feng Cai, Ki Beom Lee, Qian Xiang || 7|| || || <br />
|-<br />
|Mar 20 || Wenling Zhang, Cong Jiang, Ziwei Song, Zhaoshan Ye || 8|| XGBoost: A Scalable Tree Boosting System. || [https://arxiv.org/pdf/1603.02754.pdf Paper] || <br />
|-<br />
|Mar 22 || Alice Wang, Robert Huang, Yufeng Wang, Renato Ferreira, Beini Fan, Xiaoni Lang, Xukun Liu, Handi Gao; <br />
|| 9|| Saliency-based Sequential Image Attention with Multiset Prediction<br />
|| [http://papers.nips.cc/paper/7272-real-time-image-saliency-for-black-box-classifiers.pdf Paper] || <br />
|-<br />
|Mar 22 || Rosie Zou, Ameer Dharamshi , Glen Chalatov, Xinkai Wei || 10|| Image Question Answering using Convolutional Neural Network with Dynamic Parameter Prediction || [https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Noh_Image_Question_Answering_CVPR_2016_paper.pdf Paper] || <br />
|-<br />
|Mar 27 || Abhijeet Hara, Alvin Chow, Jerry Hu, Daniel Pang, Pranav Shankar || 11|| || || <br />
|-<br />
|Mar 27 || Kudzai Bishi, Ji Hoo Lee, Nanabena Quayson, Tharmini Velauthapillai || 12|| A Knowledge-Grounded Neural Conversation Model || [https://arxiv.org/pdf/1702.01932.pdf Paper] || <br />
|-<br />
|Mar 29 || Siqi Chen, Yi Shan, Yuliang Xu, Jianxing Zhang, Weifeng Liang, Yao Xiao, Jiajia Yin || 13|| Dynamic Routing Between Capsules || [http://papers.nips.cc/paper/6975-dynamic-routing-between-capsules.pdf Paper] || <br />
|-<br />
|Mar 29 || Ammar Mehvee, Chen Yuan, Angelica Amores, Cheryl Yang, Alaric Chow, Yoon Soo Shin, Karan Mehta , Melody Tam || 14|| Bag of Tricks for Efficient Text Classification || ||<br />
|-<br />
|Apr 3 || Qici Tan, Qi Mai, Ziheng Chu, Minghao Lu || 15|| ImageNet Classification with Deep Convolutional Neural Networks || [http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf Paper] || <br />
|-<br />
|Apr 3 || Haochen, Yang, Patrick, Selina, Sigeng, Angel || 16|| || || <br />
|-</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&diff=32925stat441w18/A New Method of Region Embedding for Text Classification2018-03-08T02:04:18Z<p>Y2434liu: A New Method of Region Embedding for Text Classification</p>
<hr />
<div>=Method=<br />
<br />
This paper focuses on representing small text regions which can preserve local internal structural information for specific text classification. It defines <math> region\left ( i,c\right ) </math> as the <math>2\times c+1</math> length region with middle word <math> \omega_i </math> which is the i-th word of the document. And then it uses word embeddings and the local context units to produce region embedding. In the following, we first introduce local context unit, then two architectures to generate the region embedding, and how to classify text.<br />
<br />
===Local context unit===<br />
<br />
The vocabulary is represented by a matrix <math> mathbf{E} \isin mathbb{R}^{h \times v} </math> with a look up layer, denoted by the embedding <math> e_\omega </math>. The i-th column represents the embedding of <math> \omega_i </math>, denoted by <math>mathbf{e}_\omega_i</math>.<br />
<br />
For each word <math> \omega_i </math>, we define the local context unit <math> mathbf{K}_\omega_i\isin mathbb{R}^{h\times\left (2c+1\right )}</math>. Let <math> mathbf{K}_\{omega_i,t} </math> be the (c+t)-th column in <math> mathbf{K}_\omega_i \left (t\isin\left [ -c,c\right ]</math>, representing a distinctive linear projection function on <math>mathbf(e)_{c+t}</math> in the local context <math>r\left (i,c\right )</math>. Thus, we can utilize local ordered word information in terms of each word.<br />
<br />
Define <math>mathbf{p}_{\omega_i+t}^i</math> as the projected word embedding of <math> \omega_i+t </math> in i-th word’s view, computed by:<br />
<math> mathbf{p}_{\omega_i+t}^i = mathbf{K}_\{omega_i,t} \odot mathbf{\omega_{i+t}}</math> where <math>\odot</math> denotes an elemet-wise multiplication.<br />
<br />
Note local context units and embedding are learned as model parameters. Local context units can be learned to capture the semantic and syntactic influence of each word to its context.</div>Y2434liuhttp://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18&diff=32923stat441w182018-03-08T02:01:25Z<p>Y2434liu: /* Paper presentation */</p>
<hr />
<div><br />
<br />
[https://docs.google.com/forms/d/1HrpW_lnn4jpFmoYKJBRAkm-GYa8djv9iZXcESeVB7Ts/prefill Your feedback on presentations]<br />
<br />
=Paper presentation=<br />
{| class="wikitable"<br />
<br />
{| border="1" cellpadding="3"<br />
|-<br />
|width="60pt"|Date<br />
|width="100pt"|Name <br />
|width="30pt"|Paper number <br />
|width="700pt"|Title<br />
|width="30pt"|Link to the paper<br />
|width="30pt"|Link to the summary<br />
|-<br />
|Feb 15 (example)||Ri Wang || ||Sequence to sequence learning with neural networks.||[http://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf Paper] || [http://wikicoursenote.com/wiki/Stat946f15/Sequence_to_sequence_learning_with_neural_networks#Long_Short-Term_Memory_Recurrent_Neural_Network Summary]<br />
|-<br />
|Mar 8 || || 1|| || || <br />
|-<br />
|Mar 8 || || 2|| || || <br />
|-<br />
|Mar 13 ||Faith Lee, Shiwei Gong, Jacob Lisulov || 3|| Random Features for Large Scale Kernel Machines || [https://people.eecs.berkeley.edu/~brecht/papers/07.rah.rec.nips.pdf]|| [https://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/summary_1]<br />
|-<br />
|Mar 13 ||Zekai S., Yitian W., Hamza M., Cameron M., Benjamin S., Xiowen S., Pavle M. || 4|| Convolutional Neural Networks for Sentence Classification ||[https://arxiv.org/pdf/1408.5882.pdf Paper] || [http://wikicoursenote.com/wiki/stat441w18/Convolutional_Neural_Networks_for_Sentence_Classification Summary]<br />
|-<br />
|Mar 15 ||Victor Stoev, Alex Florian, Deep Morjaria, Alessandra Iaboni, Amar Bhalla, Zach Poole, Thomas Lu, Wendy Zhang || 5|| Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm || [https://arxiv.org/abs/1712.01815 Paper] || [http://wikicoursenote.com/wiki/stat441w18/mastering-chess-and-shogi-self-play Summary]<br />
|-<br />
|Mar 15 || Kecheng Li, Lisi Pan, Yanting Liu, Tangxinxin Yao, Jingyue Huang, Ming Fan, Mingguang Liu, Xiaohan Wang || 6|| A New Method of Region Embedding for Text Classification || [https://openreview.net/pdf?id=BkSDMA36Z Paper] ||[https://wiki.math.uwaterloo.ca/statwiki/index.php?title=stat441w18/A_New_Method_of_Region_Embedding_for_Text_Classification&action=edit]<br />
|-<br />
|Mar 20 || Yufeng Yue, Shanzi Wang, Yumeng Li, Yuyang Bao, Yun Shi, Wan Feng Cai, Ki Beom Lee, Qian Xiang || 7|| || || <br />
|-<br />
|Mar 20 || Wenling Zhang, Cong Jiang, Ziwei Song, Zhaoshan Ye || 8|| XGBoost: A Scalable Tree Boosting System. || [https://arxiv.org/pdf/1603.02754.pdf Paper] || <br />
|-<br />
|Mar 22 || Alice Wang, Robert Huang, Yufeng Wang, Renato Ferreira, Beini Fan, Xiaoni Lang, Xukun Liu, Handi Gao; <br />
|| 9|| Saliency-based Sequential Image Attention with Multiset Prediction<br />
|| [http://papers.nips.cc/paper/7272-real-time-image-saliency-for-black-box-classifiers.pdf Paper] || <br />
|-<br />
|Mar 22 || Rosie Zou, Ameer Dharamshi , Glen Chalatov, Xinkai Wei || 10|| Image Question Answering using Convolutional Neural Network with Dynamic Parameter Prediction || [https://www.cv-foundation.org/openaccess/content_cvpr_2016/papers/Noh_Image_Question_Answering_CVPR_2016_paper.pdf Paper] || <br />
|-<br />
|Mar 27 || Abhijeet Hara, Alvin Chow, Jerry Hu, Daniel Pang, Pranav Shankar || 11|| || || <br />
|-<br />
|Mar 27 || Kudzai Bishi, Ji Hoo Lee, Nanabena Quayson, Tharmini Velauthapillai || 12|| A Knowledge-Grounded Neural Conversation Model || [https://arxiv.org/pdf/1702.01932.pdf Paper] || <br />
|-<br />
|Mar 29 || Siqi Chen, Yi Shan, Yuliang Xu, Jianxing Zhang, Weifeng Liang, Yao Xiao, Jiajia Yin || 13|| Dynamic Routing Between Capsules || [http://papers.nips.cc/paper/6975-dynamic-routing-between-capsules.pdf Paper] || <br />
|-<br />
|Mar 29 || Ammar Mehvee, Chen Yuan, Angelica Amores, Cheryl Yang, Alaric Chow, Yoon Soo Shin, Karan Mehta , Melody Tam || 14|| Bag of Tricks for Efficient Text Classification || ||<br />
|-<br />
|Apr 3 || Qici Tan, Qi Mai, Ziheng Chu, Minghao Lu || 15|| ImageNet Classification with Deep Convolutional Neural Networks || [http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf Paper] || <br />
|-<br />
|Apr 3 || Haochen, Yang, Patrick, Selina, Sigeng, Angel || 16|| || || <br />
|-</div>Y2434liu