Commit 5d1d846c by 孟霞

合并分支 'mengxia' 到 'caorunzhe'

Mengxia

查看合并请求 !269
parents 5103b423 35e150a3
......@@ -8,7 +8,7 @@
\node[anchor=west,hide](yn-1)at([xshift=2em]dots.east){$y_{m-1}$};
\node[anchor=west,hide](yn)at([xshift=2em]yn-1.east){$y_m$};
\node[anchor=north,draw,line width=1pt,inner sep=2pt,fill=red!30,minimum height=2em,minimum width=12em](see)at ([yshift=-3em,xshift=2em]y3.south){${X}=(x_1,x_2,\ldots,x_{m-1},x_m)$};
\node[anchor=north,draw,line width=1pt,inner sep=2pt,fill=red!30,minimum height=2em,minimum width=12em](see)at ([yshift=-3em,xshift=2em]y3.south){${x}=(x_1,x_2,\ldots,x_{m-1},x_m)$};
\node[anchor=south,font=\footnotesize] at ([yshift=1em,xshift=2em]y3.north){待预测的隐含状态序列};
\node[anchor=north,font=\footnotesize] at ([yshift=-1em]see.south){可见状态序列};
......
......@@ -345,7 +345,7 @@ $计算这种切分的概率值。
\parinterval 由于隐含状态序列之间存在转移概率,并且隐马尔可夫模型中隐含状态和可见状态之间存在着发射概率,因此根据可见状态的转移猜测隐含状态序列并非无迹可循。图\ref{fig:3.3-3}描述了如何使用隐马尔可夫模型来根据“抛硬币”结果推测挑选的硬币序列。可见,通过隐含状态之间的联系(绿色方框及它们之间的连线)可以对有序的状态进行描述,进而得到隐含状态序列所对应的可见状态序列(红色圆圈)。
\parinterval 从统计建模的角度看,上述过程本质上是在描述隐含状态和可见状态出现的联合概率。这里,用$\seq{X}=(x_1,...,x_m)$表示可见状态序列,用$\seq{Y}=(y_1,...,y_m)$表示隐含状态序列。(一阶)隐马尔可夫模型假设:
\parinterval 从统计建模的角度看,上述过程本质上是在描述隐含状态和可见状态出现的联合概率。这里,用$\seq{x}=(x_1,...,x_m)$表示可见状态序列,用$\seq{y}=(y_1,...,y_m)$表示隐含状态序列。(一阶)隐马尔可夫模型假设:
\begin{itemize}
\vspace{0.5em}
......@@ -355,9 +355,9 @@ $计算这种切分的概率值。
\vspace{0.5em}
\end{itemize}
于是,联合概率$\funp{P}(\seq{X},\seq{Y})$可以被定义为:
于是,联合概率$\funp{P}(\seq{x},\seq{y})$可以被定义为:
\begin{eqnarray}
\funp{P}(\seq{X},\seq{Y}) & = & \funp{P}(\seq{X}|\seq{Y})\funp{P}(\seq{Y}) \nonumber \\
\funp{P}(\seq{x},\seq{y}) & = & \funp{P}(\seq{x}|\seq{y})\funp{P}(\seq{y}) \nonumber \\
& = & \funp{P}(x_1,...,x_m|y_1,...,y_m) \funp{P}(y_1,...,y_m) \nonumber \\
& = & \prod_{i=1}^{m} \funp{P}(x_i|x_1,...,x_{i-1},y_1,...,y_m) \prod_{i=1}^{m} \funp{P}(y_i | y_{i-1}) \nonumber \\
& = & \prod_{i=1}^{m} \funp{P}(x_i|y_i) \prod_{i=1}^{m} \funp{P}(y_i | y_{i-1}) \nonumber \\
......@@ -409,22 +409,22 @@ $计算这种切分的概率值。
\noindent 其中,${c}(\cdot)$统计训练集中某种现象出现的次数。
\parinterval 在获得转移概率和发射概率的基础上,对于一个句子进行命名实体识别可以被描述为:在观测序列$\seq{X}$(可见状态,即输入的词序列)的条件下,最大化标签序列$\seq{Y}$(隐含状态,即标记序列)的概率,即:
\parinterval 在获得转移概率和发射概率的基础上,对于一个句子进行命名实体识别可以被描述为:在观测序列$\seq{x}$(可见状态,即输入的词序列)的条件下,最大化标签序列$\seq{y}$(隐含状态,即标记序列)的概率,即:
\begin{eqnarray}
\hat{\seq{Y}} = \arg\max_{\seq{Y}}\funp{P}(\seq{Y}|\seq{X})
\hat{\seq{y}} = \arg\max_{\seq{y}}\funp{P}(\seq{y}|\seq{x})
\label{eq:3.3-3}
\end{eqnarray}
\parinterval 根据贝叶斯定理,该概率被分解为$\funp{P}(\seq{Y}|\seq{X})=\frac{\funp{P}(\seq{X},\seq{Y})}{\funp{P}(\seq{X})}$,其中$\funp{P}(\seq{X})$是固定概率,因为$\seq{X}$在这个过程中是确定的不变量。因此只需考虑如何求解分子,即将求条件概率$\funp{P}(\seq{Y}|\seq{X})$的问题转化为求联合概率$\funp{P}(\seq{Y},\seq{X})$的问题:
\parinterval 根据贝叶斯定理,该概率被分解为$\funp{P}(\seq{y}|\seq{x})=\frac{\funp{P}(\seq{x},\seq{y})}{\funp{P}(\seq{x})}$,其中$\funp{P}(\seq{x})$是固定概率,因为$\seq{x}$在这个过程中是确定的不变量。因此只需考虑如何求解分子,即将求条件概率$\funp{P}(\seq{y}|\seq{x})$的问题转化为求联合概率$\funp{P}(\seq{y},\seq{x})$的问题:
\begin{eqnarray}
\hat{\seq{Y}} = \arg\max_{\seq{Y}}\funp{P}(\seq{X},\seq{Y}) \label{eq:markov-sequence-argmax}
\hat{\seq{y}} = \arg\max_{\seq{y}}\funp{P}(\seq{x},\seq{y}) \label{eq:markov-sequence-argmax}
\label{eq:3.3-4}
\end{eqnarray}
\parinterval 将式(\eqref{eq:joint-prob-xy})带入式(\eqref{eq:markov-sequence-argmax})可以得到最终计算公式,如下:
\begin{eqnarray}
\hat{\seq{Y}} = \arg\max_{\seq{Y}}\prod_{i=1}^{m}\funp{P}(x_i|y_i)\funp{P}(y_i|y_{i-1})
\hat{\seq{y}} = \arg\max_{\seq{y}}\prod_{i=1}^{m}\funp{P}(x_i|y_i)\funp{P}(y_i|y_{i-1})
\label{eq:3.3-5}
\end{eqnarray}
......@@ -465,25 +465,25 @@ $计算这种切分的概率值。
\end{figure}
%-------------------------------------------
\parinterval 上述现象也被称作{\small\bfnew{标注偏置}}\index{标注偏置}(Label Bias)\index{Label Bias}。条件随机场模型在隐马尔可夫模型的基础上,解决了这个问题\upcite{lafferty2001conditional}。在条件随机场模型中,以全局范围的统计归一化代替了隐马尔可夫模型中的局部归一化。除此之外,条件随机场模型中并非使用概率计算而是特征函数的方式对可见状态序列$\seq{X}$对应的隐含状态序列$\seq{Y}$的概率进行计算。
\parinterval 上述现象也被称作{\small\bfnew{标注偏置}}\index{标注偏置}(Label Bias)\index{Label Bias}。条件随机场模型在隐马尔可夫模型的基础上,解决了这个问题\upcite{lafferty2001conditional}。在条件随机场模型中,以全局范围的统计归一化代替了隐马尔可夫模型中的局部归一化。除此之外,条件随机场模型中并非使用概率计算而是特征函数的方式对可见状态序列$\seq{x}$对应的隐含状态序列$\seq{y}$的概率进行计算。
\parinterval 条件随机场中一般有若干个特征函数,都是经过设计的、能够反映序列规律的一些二元函数\footnote{二元函数的函数值一般非1即0},并且每个特征函数都有其对应的权重$\lambda$。特征函数一般由两部分组成:能够反映隐含状态序列之间转移规则的转移特征$t(y_{i-1},y_i,\seq{X},i)$和状态特征$s(y_i,\seq{X},i)$。其中$y_i$$y_{i-1}$分别是位置$i$和前一个位置的隐含状态,$\seq{X}$则是可见状态序列。转移特征$t(y_{i-1},y_i,\seq{X},i)$反映了两个相邻的隐含状态之间的转换关系,而状态特征$s(y_i,\seq{X},i)$则反映了第$i$个可见状态应该对应什么样的隐含状态,这两部分共同组成了一个特征函数$F(y_{i-1},y_i,\seq{X},i)$,即
\parinterval 条件随机场中一般有若干个特征函数,都是经过设计的、能够反映序列规律的一些二元函数\footnote{二元函数的函数值一般非1即0},并且每个特征函数都有其对应的权重$\lambda$。特征函数一般由两部分组成:能够反映隐含状态序列之间转移规则的转移特征$t(y_{i-1},y_i,\seq{x},i)$和状态特征$s(y_i,\seq{x},i)$。其中$y_i$$y_{i-1}$分别是位置$i$和前一个位置的隐含状态,$\seq{x}$则是可见状态序列。转移特征$t(y_{i-1},y_i,\seq{x},i)$反映了两个相邻的隐含状态之间的转换关系,而状态特征$s(y_i,\seq{x},i)$则反映了第$i$个可见状态应该对应什么样的隐含状态,这两部分共同组成了一个特征函数$F(y_{i-1},y_i,\seq{x},i)$,即
\begin{eqnarray}
F(y_{i-1},y_i,\seq{X},i) & = & t(y_{i-1},y_i,\seq{X},i)+s(y_i,\seq{X},i)
F(y_{i-1},y_i,\seq{x},i) & = & t(y_{i-1},y_i,\seq{x},i)+s(y_i,\seq{x},i)
\label{eq:3.3-8}
\end{eqnarray}
\parinterval 实际上,基于特征函数的方法更像是对隐含状态序列的一种打分:根据人为设计的模板(特征函数),测试隐含状态之间的转换以及隐含状态与可见状态之间的对应关系是否符合这种模板。在处理序列问题时,假设可见状态序列$\seq{X}$的长度和待预测隐含状态序列$\seq{Y}$的长度均为$m$,且共设计了$k$个特征函数,则有:
\parinterval 实际上,基于特征函数的方法更像是对隐含状态序列的一种打分:根据人为设计的模板(特征函数),测试隐含状态之间的转换以及隐含状态与可见状态之间的对应关系是否符合这种模板。在处理序列问题时,假设可见状态序列$\seq{x}$的长度和待预测隐含状态序列$\seq{y}$的长度均为$m$,且共设计了$k$个特征函数,则有:
\begin{eqnarray}
\funp{P}(\seq{Y}|\seq{X}) & = & \frac{1}{Z(\seq{X})}\exp(\sum_{i=1}^m\sum_{j=1}^{k}\lambda_{j}F_{j}(y_{i-1},y_i,\seq{X},i))
\funp{P}(\seq{y}|\seq{x}) & = & \frac{1}{Z(\seq{x})}\exp(\sum_{i=1}^m\sum_{j=1}^{k}\lambda_{j}F_{j}(y_{i-1},y_i,\seq{x},i))
\label{eq:3.3-9}
\end{eqnarray}
\parinterval 公式(\eqref{eq:3.3-9})中的$Z(X)$即为上面提到的实现全局统计归一化的归一化因子,其计算方式为:
\parinterval 公式(\eqref{eq:3.3-9})中的$Z(x)$即为上面提到的实现全局统计归一化的归一化因子,其计算方式为:
\begin{eqnarray}
Z(\seq{X})=\sum_{\seq{Y}}\exp(\sum_{i=1}^m\sum_{j=1}^k\lambda_{j}F_{j}(y_{i-1},y_i,\seq{X},i))
Z(\seq{x})=\sum_{\seq{y}}\exp(\sum_{i=1}^m\sum_{j=1}^k\lambda_{j}F_{j}(y_{i-1},y_i,\seq{x},i))
\label{eq:3.3-10}
\end{eqnarray}
......
......@@ -16,7 +16,7 @@
\node[ref,anchor=west] (n23) at ([xshift=1em]n22.east){I};
\node[ref,anchor=west] (n24) at ([xshift=1em]n23.east){eat};
\node[ref,anchor=west] (n25) at ([xshift=1em]n24.east){this};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){Can};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){can};
\node[ref,anchor=west] (n27) at ([xshift=1em]n26.east){like};
\node[ref,anchor=west] (n28) at ([xshift=1em]n27.east){him};
\node[ref,anchor=west] (n29) at ([xshift=1em]n28.east){?};
......
\begin{tikzpicture}[scale=0.5]
\tikzstyle{cand} = [draw,line width=1pt,align=center,minimum width=2.6em,minimum height=1.6em,drop shadow={shadow xshift=0.15em},fill=green!15]
\tikzstyle{ref} = [draw,line width=1pt,align=center,minimum width=2.6em,minimum height=1.6em,drop shadow={shadow xshift=0.15em},fill=red!15]
......@@ -17,7 +16,7 @@
\node[ref,anchor=west] (n23) at ([xshift=1em]n22.east){I};
\node[ref,anchor=west] (n24) at ([xshift=1em]n23.east){eat};
\node[ref,anchor=west] (n25) at ([xshift=1em]n24.east){this};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){Can};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){can};
\node[ref,anchor=west] (n27) at ([xshift=1em]n26.east){like};
\node[ref,anchor=west] (n28) at ([xshift=1em]n27.east){him};
\node[ref,anchor=west] (n29) at ([xshift=1em]n28.east){?};
......
......@@ -17,7 +17,7 @@
\node[ref,anchor=west] (n23) at ([xshift=1em]n22.east){I};
\node[ref,anchor=west] (n24) at ([xshift=1em]n23.east){eat};
\node[ref,anchor=west] (n25) at ([xshift=1em]n24.east){this};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){Can};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){can};
\node[ref,anchor=west] (n27) at ([xshift=1em]n26.east){like};
\node[ref,anchor=west] (n28) at ([xshift=1em]n27.east){him};
\node[ref,anchor=west] (n29) at ([xshift=1em]n28.east){?};
......
......@@ -16,7 +16,7 @@
\node[ref,anchor=west] (n23) at ([xshift=1em]n22.east){I};
\node[ref,anchor=west] (n24) at ([xshift=1em]n23.east){eat};
\node[ref,anchor=west] (n25) at ([xshift=1em]n24.east){this};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){Can};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){can};
\node[ref,anchor=west] (n27) at ([xshift=1em]n26.east){like};
\node[ref,anchor=west] (n28) at ([xshift=1em]n27.east){him};
\node[ref,anchor=west] (n29) at ([xshift=1em]n28.east){?};
......@@ -35,7 +35,7 @@
\node[ref,anchor=west] (n43) at ([xshift=1em]n42.east){I};
\node[ref,anchor=west] (n44) at ([xshift=1em]n43.east){eat};
\node[ref,anchor=west] (n45) at ([xshift=1em]n44.east){this};
\node[ref,anchor=west] (n46) at ([xshift=1em]n45.east){Can};
\node[ref,anchor=west] (n46) at ([xshift=1em]n45.east){can};
\node[ref,anchor=west] (n47) at ([xshift=1em]n46.east){like};
\node[ref,anchor=west] (n48) at ([xshift=1em]n47.east){him};
\node[ref,anchor=west] (n49) at ([xshift=1em]n48.east){?};
......
......@@ -18,7 +18,7 @@
\node[ref,anchor=west] (n23) at ([xshift=1em]n22.east){I};
\node[ref,anchor=west] (n24) at ([xshift=1em]n23.east){eat};
\node[ref,anchor=west] (n25) at ([xshift=1em]n24.east){this};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){Can};
\node[ref,anchor=west] (n26) at ([xshift=1em]n25.east){can};
\node[ref,anchor=west] (n27) at ([xshift=1em]n26.east){like};
\node[ref,anchor=west] (n28) at ([xshift=1em]n27.east){him};
\node[ref,anchor=west] (n29) at ([xshift=1em]n28.east){?};
......@@ -37,7 +37,7 @@
\node[ref,anchor=west] (n43) at ([xshift=1em]n42.east){I};
\node[ref,anchor=west] (n44) at ([xshift=1em]n43.east){eat};
\node[ref,anchor=west] (n45) at ([xshift=1em]n44.east){this};
\node[ref,anchor=west] (n46) at ([xshift=1em]n45.east){Can};
\node[ref,anchor=west] (n46) at ([xshift=1em]n45.east){can};
\node[ref,anchor=west] (n47) at ([xshift=1em]n46.east){like};
\node[ref,anchor=west] (n48) at ([xshift=1em]n47.east){him};
\node[ref,anchor=west] (n49) at ([xshift=1em]n48.east){?};
......
......@@ -237,7 +237,7 @@
\begin{example}
机器译文:the the the the
\qquad \ 参考答案:The cat is standing on the ground
\qquad \ 参考答案:The cat is standing on the ground.
\label{eg:4-bleu-example}
\end{example}
......@@ -365,7 +365,7 @@
\label{eq:4-10}
\end{eqnarray}
\parinterval 在上文提到的评价指标中,无论是准确率、召回率还是$\rm F_{mean}$,都是基于单个词汇信息衡量译文质量,而忽略了语序问题。为了将语序问题考虑进来,Meteor会考虑更长的匹配:将机器译文按照最长匹配长度分块,并对“块数”较多的机器译文给予惩罚。例如上例中,机器译文被分为了三个“块”——“Can I have this”、“like he do”、“?”在这种情况下,看起来上例中的准确率、召回率都还不错,但最终会受到很严重的惩罚。这种罚分机制能够识别出机器译文中的词序问题,因为当待测译文词序与参考答案相差较大时,机器译文将会被分割得比较零散,这种惩罚机制的计算公式如式\eqref{eq:4-11},其中$\rm count_{chunks}$表示匹配的块数。
\parinterval 在上文提到的评价指标中,无论是准确率、召回率还是$\rm F_{mean}$,都是基于单个词汇信息衡量译文质量,而忽略了语序问题。为了将语序问题考虑进来,Meteor会考虑更长的匹配:将机器译文按照最长匹配长度分块,并对“块数”较多的机器译文给予惩罚。例如上例中,机器译文被分为了三个“块”——“Can I have it”、“like he”、“?”在这种情况下,看起来上例中的准确率、召回率都还不错,但最终会受到很严重的惩罚。这种罚分机制能够识别出机器译文中的词序问题,因为当待测译文词序与参考答案相差较大时,机器译文将会被分割得比较零散,这种惩罚机制的计算公式如式\eqref{eq:4-11},其中$\rm count_{chunks}$表示匹配的块数。
\begin{eqnarray}
{\rm Penalty} = 0.5 \cdot {\left({\frac{\rm count_{chunks}}{\rm count_{hit}}} \right)^3}
\label{eq:4-11}
......@@ -508,7 +508,7 @@ His house is on the south bank of the river.
\parinterval 将参考答案集扩大后,可以继续沿用BLEU或NIST等基于$n$元语法的方法进行自动评价,但是传统方法往往会忽略多重参考答案中的重复信息,于是对每个$n$元语法进行加权的自动评价方法被提出\upcite{DBLP:conf/eamt/QinS15}。该方法根据每个$n$元语法单元的长度、在参考答案集中出现的次数、被虚词(如“the”,“by”,“a”等)分开后的分散度等方面,确定其在计算最终分数时所占的权重。以BLEU方法为例(\ref{sec:ngram-eval}节),可以将式\eqref{eq:4-7}改写为:
\begin{eqnarray}
\mathrm{BLEU} &=& \mathrm {BP} \cdot {\rm{exp}}(\sum\limits_{n = 1}^N {{w_n} \cdot \log ({I}_n \times \funp{P}_n} ))
\mathrm{BLEU} &=& \mathrm {BP} \cdot {\rm{exp}}(\sum\limits_{n = 1}^N {{w_n} \cdot \log ({I}_n \cdot \funp{P}_n} ))
\label{eq:4-14}\\
{I}_n &=& n\mathrm{-gram_{diver}} \cdot \log (n + \frac{M}{\rm{count_{ref}}})
\label{eq:4-15}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论