% !Mode:: "TeX:GBK"

\def\CTeXPreproc{Created by ctex v0.2.13, don't edit!}
\documentclass[cjk,t,compress,12pt]{beamer}
%\documentclass{article}
%\usepackage{beamerarticle}
\usepackage{pstricks}
\usepackage{etex}
\usepackage{eso-pic,graphicx}
\usepackage{fancybox}
\usepackage{amsmath,amssymb}
\usepackage{setspace}
\usepackage{xcolor}
\usepackage{CJK}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{hyperref}
\usepackage{array}

\usepgflibrary{arrows} % LATEX and plain TEX and pure pgf
\usetikzlibrary{arrows} % LATEX and plain TEX when using Tik Z
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,shapes}

\usetikzlibrary{shadows} % LATEX and plain TEX when using Tik Z

\usetikzlibrary{positioning,fit,calc}

\usetikzlibrary{mindmap,backgrounds} % mind map

\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}

\setbeamertemplate{items}[ball]
\usefonttheme[onlymath]{serif}  % fout of math

\definecolor{ugreen}{rgb}{0,0.5,0}
\definecolor{lgreen}{rgb}{0.9,1,0.8}
\definecolor{xtgreen1}{rgb}{0.824,0.898,0.8}
\definecolor{xtgreen}{rgb}{0.914,0.945,0.902}
\definecolor{lightgray}{gray}{0.85}

\setbeamercolor{uppercol}{fg=white,bg=ugreen}
\setbeamercolor{lowercol}{fg=black,bg=xtgreen}

%\definecolor{ublue}{rgb}{0,0.298,0.525}
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\setbeamercolor{uppercolblue}{fg=white,bg=ublue}
\setbeamercolor{lowercolblue}{fg=black,bg=blue!10}


%\usetheme{default}
%\usetheme{Darmstadt}
%\usetheme{Madrid}
%\usetheme{Frankfurt}
%\usetheme{Dresden}
%\usetheme{Boadilla}
%\usecolortheme{dolphin}


\usefonttheme[onlylarge]{structurebold}

\begin{CJK}{GBK}{song}
\end{CJK}

\setbeamerfont*{frametitle}{size=\large,series=\bfseries}
\setbeamertemplate{navigation symbols}{\begin{CJK}{GBK}{hei} 第二章 词法、语法及概率思想基础 \hspace*{2em} 肖桐\&朱靖波 \end{CJK} \hspace*{2em} \today \hspace*{2em} \insertframenumber{}/\inserttotalframenumber}

\setbeamertemplate{itemize items}[circle] % if you want a circle
\setbeamertemplate{itemize subitem}[triangle] % if you wnat a triangle
\setbeamertemplate{itemize subsubitem}[ball] % if you want a ball

\begin{document}

\begin{CJK}{GBK}{you}

\title{\Large{词法、语法及概率思想基础}}
\author{\large{\textbf{肖桐\ \ 朱靖波}}}
\institute{
\blue{\url{xiaotong@mail.neu.edu.cn}} \black{} \\
\blue{\url{zhujingbo@mail.neu.edu.cn}} \black{} \\
\vspace{1.0em}
东北大学 自然语言处理实验室 \\
\blue{\underline{\url{http://www.nlplab.com}}} \black{} \\
\vspace{0.2cm}
\hspace{0.1cm} \includegraphics[scale=0.1]{../Figures/logo.pdf}
}
\date{}

\maketitle

\setlength{\leftmargini}{1em}
\setlength{\leftmarginii}{1em}


\section{中文分词}

%%% 进一步扩展，基于n-gram LM的方法
\begin{frame}{进一步扩展：基于$n$-gram语言模型的方法}

\begin{itemize}
\item 这种方法也被称作基于1-gram(统计)语言模型的方法\\
      所谓统计语言模型就是计算$\textrm{P}(w_1 w_2 ... w_m)$的概率
\end{itemize}

{\scriptsize
\tabcolsep 5pt
\begin{tabular}{l | l | l l l}
链式法则 & 1-gram & 2-gram & ... & $n$-gram \\
$\textrm{P}(w_1 w_2 ... w_n)=$ & $\textrm{P}(w_1 w_2 ... w_n)=$ & $\textrm{P}(w_1 w_2 ... w_n)=$ & ... & $\textrm{P}(w_1 w_2 ... w_n)=$ \\
$\textrm{P}(w_1) \times$ & $\textrm{P}(w_1) \times$ & $\textrm{P}(w_1) \times$ & ... & $\textrm{P}(w_1) \times$ \\
$\textrm{P}(w_2|w_1) \times$ & $\textrm{P}(w_2) \times$ & $\textrm{P}(w_2|w_1) \times$ & ... & $\textrm{P}(w_2|w_1) \times$ \\
$\textrm{P}(w_3|w_1 w_2) \times$ & $\textrm{P}(w_3) \times$ & $\textrm{P}(w_3|w_2) \times$ & ... & $\textrm{P}(w_3|w_1 w_2) \times$ \\
$\textrm{P}(w_4|w_1 w_2 w_3) \times$ & $\textrm{P}(w_4) \times$ & $\textrm{P}(w_4|w_3) \times$ & ... & $\textrm{P}(w_4|w_1 w_2 w_3) \times$ \\
... & ... & ... & ... & ... \\
$\textrm{P}(w_m|w_1...w_{m-1})$ & $\textrm{P}(w_m)$ & $\textrm{P}(w_m|w_{m-1})$ & ... & $\textrm{P}(w_m|w_{m-n+1} ... w_{m-1})$ \\
\end{tabular}
}

\begin{itemize}
\item<2-> \textbf{$n$-gram语言模型}的核心思想就是当前词($w_m$)出现的概率只依赖于前$n-1$个词($w_{m-n+1} ... w_{m-1}$)

\vspace{-2em}

\begin{eqnarray}
&   & \textrm{P}_{2\textrm{-gram}}(\textrm{'确实/现在/数据/很/多'}) \nonumber \\
& = & \textrm{P}(\textrm{'确实'}) \times \textrm{P}(\textrm{'现在'$|$'确实'}) \times \textrm{P}(\textrm{'数据'$|$'现在'}) \times  \nonumber \\
&   & \textrm{P}(\textrm{'很'$|$'数据'}) \times \textrm{P}(\textrm{'多'$|$'很'}) \nonumber
\end{eqnarray}

\vspace{-1em}

\item<2-> \textbf{训练} - 相对频率估计：$\textrm{P}(\textrm{'现在'$|$'确实'}) = \frac{count(\textrm{'确实 现在'})}{count(\textrm{'确实'})}$

\end{itemize}

\end{frame}

\subsection{统计思想}

\subsection{统计建模实例1：基于全切分的概率分词}

\end{CJK}
\end{document}
