You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply AI in law cases task(AI_LAW): Predict the name of crimes(accusations), relevant-articles given facts of law cases</a>, has been released
9
+
10
+
2. <ahref='https://github.com/brightmart/nlu_sim'>sentence similarity project has been released</a> you can check it if you like.
11
+
12
+
3. if you want to try a model now, you can go to folder 'a02_TextCNN', run 'python -u p7_TextCNN_train.py', it will use sample data to train a model, and print loss and F1 score periodically.
4
13
5
14
it has all kinds of baseline models for text classificaiton.
6
15
@@ -20,7 +29,9 @@ we implement two memory network. one is dynamic memory network. previously it re
20
29
21
30
the second memory network we implemented is recurrent entity network: tracking state of the world. it has blocks of key-value pairs as memory, run in parallel, which achieve new state of art. it can be used for modelling question answering with contexts(or history). for example, you can let the model to read some sentences(as context), and ask a question(as query), then ask the model to predict an answer; if you feed story same as query, then it can do classification task.
22
31
23
-
if you need some sample data and word embedding pertrained on word2vec, you can find it in closed issues, such as:<ahref="https://github.com/brightmart/text_classification/issues/3">issue 3</a>
32
+
if you need some sample data and word embedding pertrained on word2vec, you can find it in closed issues, such as:<ahref="https://github.com/brightmart/text_classification/issues/3">issue 3</a>.
33
+
34
+
you can also find some sample data at folder "data". it contains two files:'sample_single_label.txt', contains 50k data with single label; 'sample_multiple_label.txt', contains 20k data with multiple labels. input and label of is separate by " __label__".
24
35
25
36
if you want to know more detail about dataset of text classification or task these models can be used, one of choose is below:
26
37
https://biendata.com/competition/zhihu/
@@ -39,9 +50,10 @@ Models:
39
50
8) Dynamic Memory Network
40
51
9) EntityNetwork:tracking state of the world
41
52
10) Ensemble models
42
-
11)Stacking for single model level (TODO):
53
+
11)Boosting:
43
54
44
55
for a single model, stack identical models together. each layer is a model. the result will be based on logits added together. the only connection between layers are label's weights. the front layer's prediction error rate of each label will become weight for the next layers. those labels with high error rate will have big weight. so later layer's will pay more attention to those mis-predicted labels, and try to fix previous mistake of former layer. as a result, we will get a much strong model.
(tensorflow 1.2 also works; most of models should also work fine in other tensorflow version, since we use very few features bond to certain version; if you use python 3.5, it will be fine as long as you change print/try catch function)
109
+
(tensorflow 1.2,1.3,1.4 also works; most of models should also work fine in other tensorflow version, since we use very few features bond to certain version; if you use python 3.5, it will be fine as long as you change print/try catch function)
In NLP, text classification can be done for single sentence, but it can also be used for multiple sentences. we may call it document classification. Words are form to sentence. And sentence are form to document. In this circumstance, there may exists a intrinsic structure. So how can we model this kinds of task? Does all parts of document are equally relevant? And how we determine which part are more important than another?
230
271
231
272
It has two unique features:
@@ -254,6 +295,8 @@ In my training data, for each example, i have four parts. each part has same len
254
295
255
296
check:p1_HierarchicalAttention_model.py
256
297
298
+
for attentive attention you can check <ahref='https://github.com/brightmart/text_classification/issues/55'>attentive attention</a>
there are two kinds of three kinds of inputs:1)encoder inputs, which is a sentence; 2)decoder inputs, it is labels list with fixed length;3)target labels, it is also a list of labels.
@@ -308,6 +353,8 @@ For every building blocks, we include a test function in the each file below, an
308
353
309
354
Sequence to sequence with attention is a typical model to solve sequence generation problem, such as translate, dialogue system. most of time, it use RNN as buidling block to do these tasks. util recently, people also apply convolutional Neural Network for sequence to sequence problem. Transformer, however, it perform these tasks solely on attention mechansim. it is fast and acheive new state-of-art result.
0 commit comments