{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/book/pulls/comments/95073732","pull_request_review_id":15619452,"id":95073732,"diff_hunk":"@@ -1 +1,434 @@\n-TODO: Write about https://github.com/PaddlePaddle/Paddle/tree/develop/demo/semantic_role_labeling\n+# 语义角色标注（Semantic Role Labeling）\n+\n+## 背景介绍\n+\n+语义角色标注（Semantic Role Labeling，SRL）是一种以句子为单位的浅层语义分析技术。SRL以句子的谓词为中心，不对句子所包含的语义信息进行深入分析，只分析句子中各成分与谓词之间的关系，即：句子的谓词（Predicate）- 论元（Argument）结构，并用语义角色来描述这些结构关系。请看下面的例子：\n+\n+$$\\mbox{[小明]}_{\\mbox{Agent}}\\mbox{[昨天]}_{\\mbox{Time}}\\mbox{在[公园]}_{\\mbox{Location}}\\mbox{[遇到]}_{\\mbox{Predicate}}\\mbox{了[小红]}_{\\mbox{Patient}}\\mbox{。}$$\n+\n+在上面的句子中，“遇到” 是谓词（Predicate，通常简写为“Pred”），代表了一个事件的核心，“小明”是施事者（Agent），“小红”是受事者（Patient），“昨天” 是事件发生的时间（Time），“公园”是时间发生的地点（Location）。\n+\n+通过这个例子可以看出，SRL是为了分析出句子描述的事件，以及事件的参与者（包括施事者、受事者）、事件发生的时间、地点和原因等。是许多自然语言理解任务， 如：信息抽取，篇章分析，深度问答等，的一个重要中间步骤。\n+\n+传统的 SRL 系统大多建立在句法分析基础之上，通常包括多个步骤：构建一棵句法分析树；从句法树上识别出给定谓词的论元；最后，通过分类得到谓词和论元的语义角色标签等。然而，句法分析是一个非常困难的任务，目前技术下的句法分析准确率并不高，句法分析的细微错误都会导致语义角色标注的错误，也限制了 SRL 任务的准确率。这是 SRL 任务面临的主要挑战。\n+\n+为了回避 “无法获得准确率较高的句法树” 所造成的困难，研究提出了基于语块的 SRL 方法，也是我们这篇文章所要介绍的方法。基于语块的 SRL 方法将 SRL 作为一个序列标注问题来解决，是一个相对简单的过程。一般采用 BIO 表示方式来定义序列标注的标签集，将不同的语块赋予不同的标签。即：对于一个角色为 A 的论元，将它所包含的第一个语块赋予标签 B-A，将它所包含的其它语块赋予标签 I-A，不属于任何论元的语块赋予标签 O。\n+\n+我们继续以上面的这句话为例，图1展示了 BIO 表示方法的执行过程，可以看到，根据序列标注的结果可以直接得到语义角色标注的结果，因此，论元识别和论元标注通常作为一个过程同时实现。\n+\n+<div  align=\"center\">\n+<img src=\"image/bio_example.png\" width = \"90%\" height = \"90%\" align=center /><br>\n+图1. BIO标注方法示例\n+</div>\n+\n+下面，我们以 [CoNLL-2004 and CoNLL-2005 Shared Tasks](http://www.cs.upc.edu/~srlconll/) 公共任务中 SRL 任务的公开数据集为例，实践下面的任务：\n+\n+给定谓词和一句话，通过序列标注的方式，从句子中找到谓词对应的论元，同时标注它们的语义角色。\n+\n+在这个过程中，我们的目标是：只依赖输入文本序列，不依赖任何额外的语法解析结果或是复杂的人造特征，构建一个端到端学习的 SRL 系统。\n+\n+# 模型概览\n+\n+循环神经网络（Recurrent Neural Network）是一种对序列建模的重要模型，在自然语言处理任务中有着广泛地应用。不同于传统的前馈神经网络（Feed-forward Neural Network），RNN 引入了循环，能够处理输入之间前后关联的问题。在语言中，由于句子前后单词并不是独立存在，标记句子中下一个词的语义角色，通常都依赖句子前面的词。很自然地，我们选择利用循环神经网络 “记忆历史” 的能力来构建我们的 SRL 系统。\n+\n+在开始最终的 SRL 模型之前，我们首先介绍三个重要的积木。\n+\n+## 重要的积木\n+### 栈式循环神经网络（Stacked Recurrent Neural Network）\n+\n+深度网络有助于形成层次化特征，网络的上层在下层已经学习到的初级特征基础上，学习更复杂的高级特征。\n+\n+RNN 等价于一个展开地前向网络，于是，通常人们会认为 RNN 在时间轴上是一个真正的“深层网络”。然而，在循环神经网络中，对网络层数的定义并非如此直接。输入特征经过一次非线性映射，我们称之为神经网络的一层。按照这样的约定，可以看到，尽管 RNN 沿时间轴展开后等价于一个非常“深”的前馈网络，但由于 RNN 各个时间步参数共享，$t-1$ 时刻状态到 $t$ 时刻的映射，始终只经过了一次非线性映射，也就是说 ：RNN 对状态转移的建模是 “浅” 的。\n+\n+堆叠多个 RNN 单元（可以是：Simple RNN ， LSTM 或者 GRU）构成深层网络，令前一个 RNN $t$ 时刻的输出，成为下一个 RNN 单元 $t$ 时刻的输入，帮助我们构建起一个深层的 RNN 网络。和单层 RNN 网络相比，极大地提高了模型拟合复杂模式的能力，能够更好地建模跨不同时间步的模式\\[[3](#参考文献)\\]。\n+\n+### 双向循环神经网络（Bidirectional Recurrent Neural Network）\n+\n+在 RNN 模型中，$t$ 时刻输出的隐藏层向量编码了到 $t$ 时刻为止所有输入的信息，但由于 RNN 串行计算，$t$ 时刻 RNN 可以看到历史，却无法看到未来。\n+\n+在绝大多数自然语言处理任务中，我们几乎总是能拿到整个句子。这种情况下，$t$ 时刻如果能够像获取历史信息一样，得到未来的信息，对序列学习任务会有很大的帮助。基于这样的思想，我们设计了一种双向循环网络单元，它的思想非常简单且直接：堆叠多个 RNN 单元，让每一层 RNN 单元分别以：正向、反向、正向 …… 的顺序学习上一层的输出序列。于是，从第 2 层开始， $t$ 时刻我们的 RNN 单元便总是可以看到历史和未来的信息。\n+\n+需要说明的是，这种双向 RNN 结构和 Bengio 等人在机器翻译任务中使用的双向 RNN 结构 \\[[1](#参考文献), [2](#参考文献)\\] 并不相同，我们会在后续机器翻译任务中，了解另一种双向循环神经网络。\n+\n+### 条件随机场 (Conditional Random Field)\n+\n+前层网络学习输入的特征表示，网络的最后一层在特征基础上，完成 SRL 任务。条件随机场就是完成序列标注的一层，处于整个网络的末端。\n+\n+条件随机场 （Conditional Random Filed， CRF）是一种概率化结构模型，可以看作是一个概率无向图模型（也叫作马尔科夫随机场），结点表示随机变量，边表示随机变量之间的概率依赖关系。\n+\n+简单来讲，CRF 学习条件概率型：$P(X|Y)$，其中 $X = (x_1, x_2, ... , x_n)$ 是输入序列，$Y = (y_1, y_2, ... , y_n)$ 是标记序列；解码过程是给定 $X$ 序列求解令 $P(Y|X)$ 最大的 $Y$ 序列，即：$Y^* = \\mbox{arg max}_{Y} P(Y | X)$。\n+\n+我们首先来条件随机场是如何定义的。\n+\n+**条件随机场** : 设 $G = (V, E)$ 是一个无向图， $V$ 是结点的集合，$E$ 是无向边的集合。$V$ 中的每个结点对应一个随机变量 $Y_{v}$， $Y = \\{Y_{v} | v \\in V\\}$，其取值范围为可能的标记集合 $\\{y\\}$，如果以随机变量 $X$ 为条件，每个随机变量 $Y_{v}$ 都满足以下马尔科夫特性：\n+$$p(Y_{v}|X, Y_{\\omega}, \\omega \\not= v) = p(Y_{v} | X, Y_{\\omega} , \\omega \\sim v)$$\n+其中，$\\omega \\sim v$ 表示两个结点在图 $G$ 中是邻近结点，那么，$(X, Y)$ 是一个条件随机场。\n+\n+上面的定义并没有对 $X$ 和 $Y$ 的结构给出更多约束，理论上来讲，只要标记序列表示了一定的条件独立性，$G$ 的图结构可以是任意的。对序列标注任务，我们只需要考虑 $X$ 和 $Y$ 都是一个序列，于是可以形成一个如图2所示的简单链式结构图。在图中，输入序列 $X$ 的元素之间并不存在图结构，因为我们只是将它作为条件，并不做任何条件独立假设。\n+\n+<p align=\"center\">    \n+<img src=\"./image/linear_chain_crf.png\" width = \"35%\" height = \"35%\" align=center><br>\n+图2. $X$ 和 $Y$ 具有相同结构的线性链条件随机场\n+</p>\n+\n+至此可以看到，序列标注问题使用的是以上这种定义在线性链上的特殊条件随机场，称之为线性链条件随机场（Linear Chain Conditional Random Field）。下面，我们给出线性链条件随机场的精确定义：\n+\n+**线性链条件随机场** ：设 $X = (x_{1}, x_{2}, ... , x_{n})$，$Y = (y_{1}, y_{2}, ... , y_{n})$ 均为线性链表示的随机变量序列，若在给定随机变量序列 $X$ 的条件下，随机变量序列 $Y$ 的条件概率分布 $P(Y|X)$ 满足马尔科夫性：\n+\n+$$p\\left(Y_{i}|X, y_{1}, ... , y_{i - 1}, y_{i + 1}, ... , y_{n}\\right) = p\\left(y_{i} | X, y_{i - 1}, y_{i + 1}\\right)$$\n+\n+$$i = 1, 2, ..., n \\mbox{（在} i = 1 \\mbox{和} n \\mbox{时只考虑单边）}$$\n+\n+则称$P(Y|X)$为线性链条件随机场。$X$表示输入序列，$Y$ 表示与之对应的标记序列。\n+\n+根据线性链条件随机场上的因子分解定理 \\[[5](#参考文献)\\]，在给定观测序列 $X$ 时，一个特定标记序列 $Y$ 的概率可以定义为：\n+\n+$$p(Y | X) = \\frac{1}{Z(X)} \\text{exp}\\left(\\sum_{i=1}^{n}\\left(\\sum_{j}\\lambda_{j}t_{j} (y_{i - 1}, y_{i}, X, i) + \\sum_{k} \\mu_k s_k (y_i, X, i)\\right)\\right)$$ \n+\n+其中：\n+\n+$$Z(X) = \\sum_{y \\in Y} \\text{exp}\\left(\\sum_{i = 1}^ {n}\\left(\\sum_{j} \\lambda_j t_j(y_{i-1}, y_i, X, i) + \\sum_{k}\\mu_k s_k (y_i, X, i)\\right)\\right)$$ \n+\n+是规范化因子。\n+\n+上面的式子中 $t_j$ 是定义在边上的特征函数，依赖于当前和前一个位置，称为转移特征，表示对于观察序列 $X$ 及其标注序列在 $i$ 及 $i - 1$ 位置上标记的转移概率。$s_k$ 是定义在结点上的特征函数，称为状态特征，依赖于当前位置，表示对于观察序列 $X$ 及其 $i$ 位置的标记概率。$\\lambda_j$ 和 $\\mu_k$ 分别是转移特征函数和状态特征函数对应的权值。\n+\n+实际上 ，$t$ 和 $s$ 可以用相同的数学形式表示，$s$ 可以同样也写为以下形式：\n+\n+$$s(y_i, X, i) = s(y_{i - 1}, y_i, X, i)$$\n+\n+假设有 $K_1$ 个转移特征，$K_2$ 个状态特征，定义特征函数 $f_k(y_{i-1}, y_{i}, X, i)$ ：\n+\n+$$f_{k}(y_{i-1}, y_{i}, X, i) = \\left\\{ \\begin{aligned} t_j(y_{i - 1}, y_{i}, X, i), &&k= 1,2, ..., K_1\\\\ s_{l}(y_{i-1}, y_i, X, i) , && k = K_{1} + l; l= 1, 2, ..., K_2\\end{aligned} \\right. $$\n+\n+再对转移特征和状态特在各个位置 $i$ 求和有：\n+$$f_{k}(Y, X) = \\sum_{i=1}^{n}f_k({y_{i - 1}, y_i, X, i})$$\n+\n+于是条件概率 $P(Y|X)$ 可以写为：\n+\n+$$p(Y|X, W) = \\frac{1}{Z(X)}\\text{exp}\\sum_{k}\\omega_{k}f_{k}(Y, X)$$\n+\n+$$Z_i(X) = \\sum_{y_i \\in Y} \\text{exp} \\sum_{k}\\omega_k f_k (Y, X)$$\n+\n+我们把 $f$ 统称为特征函数，$\\omega$ 是权值，是 CRF 模型要求解的参数。\n+\n+学习时，对于给定的输入序列和对应的标记序列的集合  $D = \\left[(X_1,  Y_1), (X_2 , Y_2) , ... , (X_N, Y_N)\\right]$ ，通过正则化的极大似然估计，可以得到如下优化目标：\n+\n+$$L(\\lambda, D) = - \\text{log}\\left(\\prod_{m=1}^{N}p(Y_m|X_m, W)\\right) + C \\frac{1}{2}\\lVert W\\rVert^{2}$$\n+\n+解码时，对于给定的输入序列 $X$，通过解码算法求令出条件概率$\\bar{P}(Y|X)$最大的输出序列 $\\bar{Y}$。\n+\n+## 深度双向 LSTM （DB-LSTM）SRL 模型\n+\n+有了上面这些积木，可以开始建立我们的深层双向 LSTM 语义角色标注模型。\n+\n+在这个任务中，输入是 “谓词” 和 “一句话”，目标是：从句中找到谓词的论元，并标注论元的语义角色。如果，一个句子中可能有 $n$ 谓词，这个句子会被处理 $n$ 次。一个最为直接的模型是下面这样：\n+\n+- step 1. 构造输入\n+ - 输入 1：谓词\n+ - 输入 2：句子\n+ - 将输入1 扩展成和输入2一样长的序列，用 one-hot 方式表示；\n+- step 2. one-hot 方式的谓词序列和句子序列通过词表，转换为实向量表示的词向量序列；\n+- setp 3. 以 step 2 的 2 个词向量序列作为上面介绍的双向 LSTM 模型的输入；LSTM 模型学习输入序列表示，得到输出向量序列；\n+- step 4. CRF 以 step 3 LSTM 学习到的特征为输入，以标记序列为监督信号，实现序列标注；\n+\n+大家可以尝试上面这种方法，这里，我们提出一些改进，引入两个简单的特征但对提高系统性能非常有效的特征：（1）谓词上下文；（2）谓词上下文区域标记。\n+\n+上面的方法中，只用到了谓词的词向量表达谓词相关的所有信息，这种方法始终是非常弱的，特别是，如果谓词在句子中出现多次，有可能引起一定的歧义\u0010。从经验出发，谓词前后若干个词的一个小片段，能够提供更丰富的信息，帮助消解词义。于是，我们把这样的经验也添加到我们的模型中。我们为每个谓词同时抽取一个“谓词上下文” 片段，也就是从这个谓词前后各取 $n$ 个词构成的一个窗口片段。在此基础上，同时为句子中的每一个词引入一个 0-1 二值变量，表示他们是否在“谓词上下文”中。图4 谓词上下文窗口为3时，模型输入示例。\n+\n+<div  align=\"center\">\n+<img src=\"image/input_data.png\" width = \"50%\" height = \"50%\" align=center /><br>\n+图4. 输入数据示例\n+</div>\n+\n+于是，我们将最初模型修改如下：\n+\n+- step 1. 构造输入\n+ - 输入 1：句子序列；\n+ - 输入 2：谓词；\n+ - 输入 3：对给定的谓词，从句子中抽取这个谓词前后 各$n$ 个词，构成谓词上下文；用 one-hot 方式表示；\n+ - 输入 4：标记句子中每一个词是否是谓词上下文中；用 one-hot 方式表示；\n+ - 将输入 2 ~ 4 均扩展为和输入 1 一样长的序列；\n+- step 2. 输入 1 ~ 4 均通过词表，转换为实向量表示的词向量序列；其中输入 1 ~ 3 共享同一个词表，输入 4 的独有词表；\n+- setp 3. setp 2 的 4 个词向量序列作为上面结果的双向 LSTM 模型的输入；LSTM 模型学习输入序列表示，得到输出向量序列；\n+- step 4. CRF 以 step 3 LSTM 学习到的特征为输入，以标记序列为监督信号，实现序列标注；\n+\n+下图是一个深度为 4 的模型结构示意图。\n+\n+<div  align=\"center\">    \n+<img src=\"image/db_lstm_network.png\" width = \"60%\" height = \"60%\" align=center /><br>\n+图3. SRL任务上的深度双向 LSTM 模型\n+</div>\n+\n+# 数据准备\n+## 数据介绍与下载\n+\n+在此教程中，我们选用 [CoNLL 2005](http://www.cs.upc.edu/~srlconll/) SRL任务开放出的数据集进行示例。运行 ```sh ./get_data.sh``` 会自动从官方网站上下载原始数据，以及一个预训练好的词表，并完成全部的数据准备工作。需要说明的是，CoNLL 2005 SRL 任务的训练数集和开发集并非完全公开，这里获取到的只是测试集，包括 Wall Street Journal 的 23 节和 Brown 语料集中的 3 节。原始数据解压后会得到如下目录结构：\n+\n+```text\n+conll05st-release/\n+├── test.brown\n+│   ├── ne\n+│   ├── null\n+│   ├── props\n+│   ├── synt.cha\n+│   ├── synt.col2\n+│   ├── synt.col2h\n+│   ├── synt.upc\n+│   ├── targets\n+│   └── words\n+└── test.wsj\n+    ├── ne\n+    ├── null\n+    ├── props\n+    ├── synt.cha\n+    ├── synt.col2\n+    ├── synt.col2h\n+    ├── synt.upc\n+    ├── targets\n+    └── words\n+```\n+原始数据中同时包括了词性标注、命名实体识别、语法解析树等多种信息，在这篇文章中，我们使用 test.wsj 文件夹中的数据进行训练，使用 test.brown 文件夹中的数据进行测试。我们的目标是展示如何利用深度神经网络，只使用文本序列作为输入信息，不依赖任何句法解析树以及人工构造的复杂特征，构建一个端到端学习的语义角色标注系统。因此，这里只会用到 words 文件夹（文本序列）和 props 文件夹（标注序列）下的数据。\n+\n+标注信息源自 Penn TreeBank \\[[9](#参考文献)\\] 和 PropBank \\[[10](#参考文献)\\] 的标注结果。PropBank 使用的标注标记和我们在文章一开始示例中使用的标注标签不同，但原理是相同的，关于标注标签含义的说明，请参考论文\\[[11](#参考文献)\\]。\n+\n+数据准备阶段， ```extract_dict_feature.py``` 会重新格式化原始数据，抽取谓词上下文（这里取谓词前后各 2 个词，也就是一个长度为 5 的窗口片段），和谓词上下文区域标志。\n+\n+```data/feature``` 是模型最终的输入，一行是一条训练样本，以 \"\\t\" 分隔，共9列，分别是：句子序列、谓词、谓词上下文（占 5 列）、谓词上下区域标志、标注序列。\n+\n+## 提供数据给 PaddlePaddle\n+1. 使用 hook 函数进行 PaddlePaddle 输入字段的格式定义。\n+\n+\t```python\n+\tdef hook(settings, word_dict, label_dict, predicate_dict, **kwargs):\n+\t    settings.word_dict = word_dict\n+\t    settings.label_dict = label_dict\n+\t    settings.predicate_dict = predicate_dict\n+\t\n+\t    #all inputs are integral and sequential type\n+\t    settings.slots = [\n+\t        integer_value_sequence(len(word_dict)),\n+\t        integer_value_sequence(len(word_dict)),\n+\t        integer_value_sequence(len(word_dict)),\n+\t        integer_value_sequence(len(word_dict)),\n+\t        integer_value_sequence(len(word_dict)),\n+\t        integer_value_sequence(len(word_dict)),\n+\t        integer_value_sequence(len(predicate_dict)), integer_value_sequence(2),\n+\t        integer_value_sequence(len(label_dict))\n+\t    ]\n+\t```\n+\n+2. 使用 process 函数将数据逐一提供给 PaddlePaddle，只需要考虑一条数据如何处理。\n+\n+\t```python\n+\tdef process(settings, file_name):\n+\t    with open(file_name, 'r') as fdata:\n+\t        for line in fdata:\n+\t            sentence, predicate, ctx_n2, ctx_n1, ctx_0, ctx_p1, ctx_p2,  mark, label = \\\n+\t                line.strip().split('\\t')\n+\t\n+\t            words = sentence.split()\n+\t            sen_len = len(words)\n+\t            word_slot = [settings.word_dict.get(w, UNK_IDX) for w in words]\n+\t\n+\t            predicate_slot = [settings.predicate_dict.get(predicate)] * sen_len\n+\t            ctx_n2_slot = [settings.word_dict.get(ctx_n2, UNK_IDX)] * sen_len\n+\t            ctx_n1_slot = [settings.word_dict.get(ctx_n1, UNK_IDX)] * sen_len\n+\t            ctx_0_slot = [settings.word_dict.get(ctx_0, UNK_IDX)] * sen_len\n+\t            ctx_p1_slot = [settings.word_dict.get(ctx_p1, UNK_IDX)] * sen_len\n+\t            ctx_p2_slot = [settings.word_dict.get(ctx_p2, UNK_IDX)] * sen_len\n+\t\n+\t            marks = mark.split()\n+\t            mark_slot = [int(w) for w in marks]\n+\t\n+\t            label_list = label.split()\n+\t            label_slot = [settings.label_dict.get(w) for w in label_list]\n+\t            yield word_slot, ctx_n2_slot, ctx_n1_slot, \\\n+\t                  ctx_0_slot, ctx_p1_slot, ctx_p2_slot, predicate_slot, mark_slot, label_slot\n+\t\n+\t\n+\t```\n+\n+# 模型配置说明\n+\n+## 数据定义\n+\n+在模型配置中，首先通过 define_py_data_sources2 从 dataprovider 中读入数据。\n+\n+```\n+define_py_data_sources2(\n+        train_list=train_list_file,\n+        test_list=test_list_file,\n+        module='dataprovider',\n+        obj='process',\n+        args={\n+            'word_dict': word_dict,\n+            'label_dict': label_dict,\n+            'predicate_dict': predicate_dict}\n+)\n+```\n+## 算法配置\n+\n+在这里，我们指定了模型的训练参数, 选择 $L_2$ 正则项稀疏、学习率和batch size。\n+\n+```\n+settings(\n+    batch_size=150,\n+    learning_method=MomentumOptimizer(momentum=0),\n+    learning_rate=2e-2,\n+    regularization=L2Regularization(8e-4),\n+    is_async=False,\n+    model_average=ModelAverage(average_window=0.5, max_average_window=10000)\n+)\n+```\n+\n+## 模型结构\n+\n+1. 定义输入数据维度，及模型超参数\n+\n+\t```python\n+\tmark_dict_len = 2    # 谓上下文区域标志的维度，是一个 0-1 2 值特征，因此维度为 2\n+\tword_dim = 32        # 词向量维度\n+\tmark_dim = 5         # 谓词上下文区域通过词表被映射为一个实向量，这个是相邻的维度\n+\thidden_dim = 512     # LSTM 隐层向量的维度 ： 512 / 4\n+\tdepth = 8            # 栈式 LSTM 的深度\n+\t\n+\tctx_n2 = data_layer(name='ctx_n2_data', size=word_dict_len)\n+\tctx_n1 = data_layer(name='ctx_n1_data', size=word_dict_len)\n+\tctx_0 = data_layer(name='ctx_0_data', size=word_dict_len)\n+\tctx_p1 = data_layer(name='ctx_p1_data', size=word_dict_len)\n+\tctx_p2 = data_layer(name='ctx_p2_data', size=word_dict_len)\n+\tmark = data_layer(name='mark_data', size=mark_dict_len)\n+\t\n+\tif not is_predict:\n+\t    target = data_layer(name='target', size=label_dict_len)    # 标记序列只在训练和测试流程中定义","path":"label_semantic_roles/README.md","position":305,"original_position":305,"commit_id":"3a66d42de8564eb80e6a37b6cd7159f335357527","original_commit_id":"3a66d42de8564eb80e6a37b6cd7159f335357527","user":{"login":"lcy-seso","id":5842774,"avatar_url":"https://avatars.githubusercontent.com/u/5842774?v=3","gravatar_id":"","url":"https://api.github.com/users/lcy-seso","html_url":"https://github.com/lcy-seso","followers_url":"https://api.github.com/users/lcy-seso/followers","following_url":"https://api.github.com/users/lcy-seso/following{/other_user}","gists_url":"https://api.github.com/users/lcy-seso/gists{/gist_id}","starred_url":"https://api.github.com/users/lcy-seso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcy-seso/subscriptions","organizations_url":"https://api.github.com/users/lcy-seso/orgs","repos_url":"https://api.github.com/users/lcy-seso/repos","events_url":"https://api.github.com/users/lcy-seso/events{/privacy}","received_events_url":"https://api.github.com/users/lcy-seso/received_events","type":"User","site_admin":false},"body":"bug is fixed.","created_at":"2017-01-08T08:02:21Z","updated_at":"2017-01-08T08:02:21Z","html_url":"https://github.com/PaddlePaddle/book/pull/25#discussion_r95073732","pull_request_url":"https://api.github.com/repos/PaddlePaddle/book/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/book/pulls/comments/95073732"},"html":{"href":"https://github.com/PaddlePaddle/book/pull/25#discussion_r95073732"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/book/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/book/pulls/25","id":99319770,"html_url":"https://github.com/PaddlePaddle/book/pull/25","diff_url":"https://github.com/PaddlePaddle/book/pull/25.diff","patch_url":"https://github.com/PaddlePaddle/book/pull/25.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/book/issues/25","number":25,"state":"open","locked":false,"title":"SRL tutorial init.","user":{"login":"lcy-seso","id":5842774,"avatar_url":"https://avatars.githubusercontent.com/u/5842774?v=3","gravatar_id":"","url":"https://api.github.com/users/lcy-seso","html_url":"https://github.com/lcy-seso","followers_url":"https://api.github.com/users/lcy-seso/followers","following_url":"https://api.github.com/users/lcy-seso/following{/other_user}","gists_url":"https://api.github.com/users/lcy-seso/gists{/gist_id}","starred_url":"https://api.github.com/users/lcy-seso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcy-seso/subscriptions","organizations_url":"https://api.github.com/users/lcy-seso/orgs","repos_url":"https://api.github.com/users/lcy-seso/repos","events_url":"https://api.github.com/users/lcy-seso/events{/privacy}","received_events_url":"https://api.github.com/users/lcy-seso/received_events","type":"User","site_admin":false},"body":"tutorial for semantic role labeling task, but not finished yet.","created_at":"2016-12-25T10:36:48Z","updated_at":"2017-01-08T08:02:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7b41319bccfcd7a66de4cde12013d5267dea732","assignee":{"login":"wangkuiyi","id":1548775,"avatar_url":"https://avatars.githubusercontent.com/u/1548775?v=3","gravatar_id":"","url":"https://api.github.com/users/wangkuiyi","html_url":"https://github.com/wangkuiyi","followers_url":"https://api.github.com/users/wangkuiyi/followers","following_url":"https://api.github.com/users/wangkuiyi/following{/other_user}","gists_url":"https://api.github.com/users/wangkuiyi/gists{/gist_id}","starred_url":"https://api.github.com/users/wangkuiyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangkuiyi/subscriptions","organizations_url":"https://api.github.com/users/wangkuiyi/orgs","repos_url":"https://api.github.com/users/wangkuiyi/repos","events_url":"https://api.github.com/users/wangkuiyi/events{/privacy}","received_events_url":"https://api.github.com/users/wangkuiyi/received_events","type":"User","site_admin":false},"assignees":[{"login":"wangkuiyi","id":1548775,"avatar_url":"https://avatars.githubusercontent.com/u/1548775?v=3","gravatar_id":"","url":"https://api.github.com/users/wangkuiyi","html_url":"https://github.com/wangkuiyi","followers_url":"https://api.github.com/users/wangkuiyi/followers","following_url":"https://api.github.com/users/wangkuiyi/following{/other_user}","gists_url":"https://api.github.com/users/wangkuiyi/gists{/gist_id}","starred_url":"https://api.github.com/users/wangkuiyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangkuiyi/subscriptions","organizations_url":"https://api.github.com/users/wangkuiyi/orgs","repos_url":"https://api.github.com/users/wangkuiyi/repos","events_url":"https://api.github.com/users/wangkuiyi/events{/privacy}","received_events_url":"https://api.github.com/users/wangkuiyi/received_events","type":"User","site_admin":false},{"login":"Zrachel","id":4532062,"avatar_url":"https://avatars.githubusercontent.com/u/4532062?v=3","gravatar_id":"","url":"https://api.github.com/users/Zrachel","html_url":"https://github.com/Zrachel","followers_url":"https://api.github.com/users/Zrachel/followers","following_url":"https://api.github.com/users/Zrachel/following{/other_user}","gists_url":"https://api.github.com/users/Zrachel/gists{/gist_id}","starred_url":"https://api.github.com/users/Zrachel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zrachel/subscriptions","organizations_url":"https://api.github.com/users/Zrachel/orgs","repos_url":"https://api.github.com/users/Zrachel/repos","events_url":"https://api.github.com/users/Zrachel/events{/privacy}","received_events_url":"https://api.github.com/users/Zrachel/received_events","type":"User","site_admin":false},{"login":"schinger","id":5964366,"avatar_url":"https://avatars.githubusercontent.com/u/5964366?v=3","gravatar_id":"","url":"https://api.github.com/users/schinger","html_url":"https://github.com/schinger","followers_url":"https://api.github.com/users/schinger/followers","following_url":"https://api.github.com/users/schinger/following{/other_user}","gists_url":"https://api.github.com/users/schinger/gists{/gist_id}","starred_url":"https://api.github.com/users/schinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schinger/subscriptions","organizations_url":"https://api.github.com/users/schinger/orgs","repos_url":"https://api.github.com/users/schinger/repos","events_url":"https://api.github.com/users/schinger/events{/privacy}","received_events_url":"https://api.github.com/users/schinger/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/book/pulls/25/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/book/pulls/25/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/book/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/book/issues/25/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/book/statuses/3a66d42de8564eb80e6a37b6cd7159f335357527","head":{"label":"lcy-seso:srl","ref":"srl","sha":"3a66d42de8564eb80e6a37b6cd7159f335357527","user":{"login":"lcy-seso","id":5842774,"avatar_url":"https://avatars.githubusercontent.com/u/5842774?v=3","gravatar_id":"","url":"https://api.github.com/users/lcy-seso","html_url":"https://github.com/lcy-seso","followers_url":"https://api.github.com/users/lcy-seso/followers","following_url":"https://api.github.com/users/lcy-seso/following{/other_user}","gists_url":"https://api.github.com/users/lcy-seso/gists{/gist_id}","starred_url":"https://api.github.com/users/lcy-seso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcy-seso/subscriptions","organizations_url":"https://api.github.com/users/lcy-seso/orgs","repos_url":"https://api.github.com/users/lcy-seso/repos","events_url":"https://api.github.com/users/lcy-seso/events{/privacy}","received_events_url":"https://api.github.com/users/lcy-seso/received_events","type":"User","site_admin":false},"repo":{"id":77022577,"name":"book","full_name":"lcy-seso/book","owner":{"login":"lcy-seso","id":5842774,"avatar_url":"https://avatars.githubusercontent.com/u/5842774?v=3","gravatar_id":"","url":"https://api.github.com/users/lcy-seso","html_url":"https://github.com/lcy-seso","followers_url":"https://api.github.com/users/lcy-seso/followers","following_url":"https://api.github.com/users/lcy-seso/following{/other_user}","gists_url":"https://api.github.com/users/lcy-seso/gists{/gist_id}","starred_url":"https://api.github.com/users/lcy-seso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcy-seso/subscriptions","organizations_url":"https://api.github.com/users/lcy-seso/orgs","repos_url":"https://api.github.com/users/lcy-seso/repos","events_url":"https://api.github.com/users/lcy-seso/events{/privacy}","received_events_url":"https://api.github.com/users/lcy-seso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lcy-seso/book","description":null,"fork":true,"url":"https://api.github.com/repos/lcy-seso/book","forks_url":"https://api.github.com/repos/lcy-seso/book/forks","keys_url":"https://api.github.com/repos/lcy-seso/book/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lcy-seso/book/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lcy-seso/book/teams","hooks_url":"https://api.github.com/repos/lcy-seso/book/hooks","issue_events_url":"https://api.github.com/repos/lcy-seso/book/issues/events{/number}","events_url":"https://api.github.com/repos/lcy-seso/book/events","assignees_url":"https://api.github.com/repos/lcy-seso/book/assignees{/user}","branches_url":"https://api.github.com/repos/lcy-seso/book/branches{/branch}","tags_url":"https://api.github.com/repos/lcy-seso/book/tags","blobs_url":"https://api.github.com/repos/lcy-seso/book/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lcy-seso/book/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lcy-seso/book/git/refs{/sha}","trees_url":"https://api.github.com/repos/lcy-seso/book/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lcy-seso/book/statuses/{sha}","languages_url":"https://api.github.com/repos/lcy-seso/book/languages","stargazers_url":"https://api.github.com/repos/lcy-seso/book/stargazers","contributors_url":"https://api.github.com/repos/lcy-seso/book/contributors","subscribers_url":"https://api.github.com/repos/lcy-seso/book/subscribers","subscription_url":"https://api.github.com/repos/lcy-seso/book/subscription","commits_url":"https://api.github.com/repos/lcy-seso/book/commits{/sha}","git_commits_url":"https://api.github.com/repos/lcy-seso/book/git/commits{/sha}","comments_url":"https://api.github.com/repos/lcy-seso/book/comments{/number}","issue_comment_url":"https://api.github.com/repos/lcy-seso/book/issues/comments{/number}","contents_url":"https://api.github.com/repos/lcy-seso/book/contents/{+path}","compare_url":"https://api.github.com/repos/lcy-seso/book/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lcy-seso/book/merges","archive_url":"https://api.github.com/repos/lcy-seso/book/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lcy-seso/book/downloads","issues_url":"https://api.github.com/repos/lcy-seso/book/issues{/number}","pulls_url":"https://api.github.com/repos/lcy-seso/book/pulls{/number}","milestones_url":"https://api.github.com/repos/lcy-seso/book/milestones{/number}","notifications_url":"https://api.github.com/repos/lcy-seso/book/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lcy-seso/book/labels{/name}","releases_url":"https://api.github.com/repos/lcy-seso/book/releases{/id}","deployments_url":"https://api.github.com/repos/lcy-seso/book/deployments","created_at":"2016-12-21T05:59:39Z","updated_at":"2016-12-21T05:59:36Z","pushed_at":"2016-12-31T13:05:07Z","git_url":"git://github.com/lcy-seso/book.git","ssh_url":"git@github.com:lcy-seso/book.git","clone_url":"https://github.com/lcy-seso/book.git","svn_url":"https://github.com/lcy-seso/book","homepage":null,"size":482,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"0a0e29061d4994dbb544c74f3415e54e5be5adf6","user":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars.githubusercontent.com/u/23534030?v=3","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"repo":{"id":76616099,"name":"book","full_name":"PaddlePaddle/book","owner":{"login":"PaddlePaddle","id":23534030,"avatar_url":"https://avatars.githubusercontent.com/u/23534030?v=3","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PaddlePaddle/book","description":null,"fork":false,"url":"https://api.github.com/repos/PaddlePaddle/book","forks_url":"https://api.github.com/repos/PaddlePaddle/book/forks","keys_url":"https://api.github.com/repos/PaddlePaddle/book/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaddlePaddle/book/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaddlePaddle/book/teams","hooks_url":"https://api.github.com/repos/PaddlePaddle/book/hooks","issue_events_url":"https://api.github.com/repos/PaddlePaddle/book/issues/events{/number}","events_url":"https://api.github.com/repos/PaddlePaddle/book/events","assignees_url":"https://api.github.com/repos/PaddlePaddle/book/assignees{/user}","branches_url":"https://api.github.com/repos/PaddlePaddle/book/branches{/branch}","tags_url":"https://api.github.com/repos/PaddlePaddle/book/tags","blobs_url":"https://api.github.com/repos/PaddlePaddle/book/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaddlePaddle/book/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaddlePaddle/book/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaddlePaddle/book/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaddlePaddle/book/statuses/{sha}","languages_url":"https://api.github.com/repos/PaddlePaddle/book/languages","stargazers_url":"https://api.github.com/repos/PaddlePaddle/book/stargazers","contributors_url":"https://api.github.com/repos/PaddlePaddle/book/contributors","subscribers_url":"https://api.github.com/repos/PaddlePaddle/book/subscribers","subscription_url":"https://api.github.com/repos/PaddlePaddle/book/subscription","commits_url":"https://api.github.com/repos/PaddlePaddle/book/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaddlePaddle/book/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaddlePaddle/book/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaddlePaddle/book/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaddlePaddle/book/contents/{+path}","compare_url":"https://api.github.com/repos/PaddlePaddle/book/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaddlePaddle/book/merges","archive_url":"https://api.github.com/repos/PaddlePaddle/book/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaddlePaddle/book/downloads","issues_url":"https://api.github.com/repos/PaddlePaddle/book/issues{/number}","pulls_url":"https://api.github.com/repos/PaddlePaddle/book/pulls{/number}","milestones_url":"https://api.github.com/repos/PaddlePaddle/book/milestones{/number}","notifications_url":"https://api.github.com/repos/PaddlePaddle/book/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaddlePaddle/book/labels{/name}","releases_url":"https://api.github.com/repos/PaddlePaddle/book/releases{/id}","deployments_url":"https://api.github.com/repos/PaddlePaddle/book/deployments","created_at":"2016-12-16T03:00:50Z","updated_at":"2017-01-06T02:47:00Z","pushed_at":"2017-01-08T05:19:23Z","git_url":"git://github.com/PaddlePaddle/book.git","ssh_url":"git@github.com:PaddlePaddle/book.git","clone_url":"https://github.com/PaddlePaddle/book.git","svn_url":"https://github.com/PaddlePaddle/book","homepage":null,"size":165,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":24,"forks":16,"open_issues":24,"watchers":6,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/book/pulls/25"},"html":{"href":"https://github.com/PaddlePaddle/book/pull/25"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/book/issues/25"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/book/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/book/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/book/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/book/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/book/statuses/3a66d42de8564eb80e6a37b6cd7159f335357527"}}}}
{"actor":{"display_login":"lcy-seso"}}