Commit 1ff89b8a by 曹润柘

合并分支 'caorunzhe' 到 'master'

Caorunzhe

查看合并请求 !77
parents da787f7c b85e6355
......@@ -44,21 +44,21 @@
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt44) at (n44.east) {\small{{\color{white} \textbf{-0.1}}}};
\node[anchor=south,unit,text=red] (w4) at ([yshift=0.5em]n41.north){$w_4$};
\draw[->,ublue,very thick] (n11.east) -- (n21.west);
\draw[->,ublue,very thick] (n11.east) -- (n22.west);
\draw[->,ublue,very thick] (n11.east) -- (n23.west);
\draw[->,ublue,very thick,dotted] (n11.east) -- (n21.west);
% \draw[->,ublue,very thick] (n11.east) -- (n22.west);
\draw[->,ublue,very thick,dotted] (n11.east) -- (n23.west);
\draw[->,ublue,very thick] (pt21.south) -- (n31.west);
\draw[->,ublue,very thick] (pt21.south) -- (n32.west);
\draw[->,ublue,very thick] (pt21.south) -- (n33.west);
\draw[->,ublue,very thick] (pt22.south) -- (n34.west);
\draw[->,ublue,very thick] (pt22.south) -- (n35.west);
\draw[->,ublue,very thick] (pt22.south) -- (n36.west);
\draw[->,ublue,very thick,dotted] (pt21.south) -- (n31.west);
\draw[->,ublue,very thick,dotted] (pt21.south) -- (n32.west);
\draw[->,ublue,very thick,dotted] (pt21.south) -- (n33.west);
\draw[->,ublue,very thick,dotted] (pt22.south) -- (n34.west);
\draw[->,ublue,very thick,dotted] (pt22.south) -- (n35.west);
% \draw[->,ublue,very thick] (pt22.south) -- (n36.west);
\draw[->,ublue,very thick] (pt31.south) -- (n41.west);
\draw[->,ublue,very thick] (pt32.south) -- (n42.west);
\draw[->,ublue,very thick] (pt34.south) -- (n43.west);
\draw[->,ublue,very thick] (pt35.south) -- (n44.west);
\draw[->,ublue,very thick,dotted] (pt31.south) -- (n41.west);
\draw[->,ublue,very thick,dotted] (pt32.south) -- (n42.west);
\draw[->,ublue,very thick,dotted] (pt34.south) -- (n43.west);
\draw[->,ublue,very thick,dotted] (pt35.south) -- (n44.west);
% \draw[->,red,ultra thick,opacity=0.7,line width=2pt]([xshift=-1em]n11.west) -- (n11.east) -- (n22.west) -- (pt22.south) -- (n36.west) -- ([xshift=1em]pt36.south);
\draw[->,red,ultra thick,opacity=0.7,line width=2pt]([xshift=-1em]n11.west) -- (n11.west);
......
......@@ -28,13 +28,13 @@
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt36) at (n36.east) {\small{{\color{white} \textbf{-1.3}}}};
\node[anchor=south,unit,text=red] (w3) at ([yshift=0.5em]n34.north){$w_3$};
\draw[->,ublue,very thick] (n11.east) -- (n21.west);
\draw[->,ublue,very thick] (n11.east) -- (n22.west);
\draw[->,ublue,very thick] (n11.east) -- (n23.west);
\draw[->,ublue,very thick,dotted] (n11.east) -- (n21.west);
% \draw[->,ublue,very thick,dashed] (n11.east) -- (n22.west);
\draw[->,ublue,very thick,dotted] (n11.east) -- (n23.west);
\draw[->,ublue,very thick] (pt22.south) -- (n34.west);
\draw[->,ublue,very thick] (pt22.south) -- (n35.west);
\draw[->,ublue,very thick] (pt22.south) -- (n36.west);
\draw[->,ublue,very thick,dotted] (pt22.south) -- (n34.west);
\draw[->,ublue,very thick,dotted] (pt22.south) -- (n35.west);
% \draw[->,ublue,very thick,dashed] (pt22.south) -- (n36.west);
% \draw[->,red,ultra thick,opacity=0.7,line width=2pt]([xshift=-1em]n11.west) -- (n11.east) -- (n22.west) -- (pt22.south) -- (n36.west) -- ([xshift=1em]pt36.south);
\draw[->,red,ultra thick,opacity=0.7,line width=2pt]([xshift=-1em]n11.west) -- (n11.west);
......@@ -42,4 +42,10 @@
\draw[->,red,ultra thick,opacity=0.7,line width=2pt](pt22.south) -- (n36.west);
\draw[->,red,ultra thick,opacity=0.7,line width=2pt](pt36.south) -- ([xshift=1em]pt36.south);
%\begin{pgfonlayer}{background}
% \node [rectangle,inner sep=0.2em,rounded corners=3pt,very thick,dashed,fill=red!40] [fit = (n11)] (box1) {};
% \node [rectangle,inner sep=0.2em,rounded corners=3pt,dotted,fill=red!40] [fit = (n22) (pt22)] (box2) {};
% \node [rectangle,inner sep=0.2em,rounded corners=3pt,very thick,dotted,fill=red!40] [fit = (n36) (pt36)] (box3) {};
%\end{pgfonlayer}
\end{tikzpicture}
\ No newline at end of file
......@@ -11,16 +11,16 @@
\begin{tikzpicture}
\node [anchor=west] (label1) at (0,0) {总词数:$6 + 8 + 5 = 20$};
\node [anchor=north west] (p1) at (label1.south west) {$P(\textrm{})=1/20=0.05$};
\node [anchor=north west] (p2) at (p1.south west) {$P(\textrm{})=3/20=0.15$};
\node [anchor=north west] (p3) at (p2.south west) {$P(\textrm{确实})=1/20=0.05$};
\node [anchor=north west] (p1) at (label1.south west) {$\funp{P}(\textrm{})=1/20=0.05$};
\node [anchor=north west] (p2) at (p1.south west) {$\funp{P}(\textrm{})=3/20=0.15$};
\node [anchor=north west] (p3) at (p2.south west) {$\funp{P}(\textrm{确实})=1/20=0.05$};
\node [anchor=north west] (label11) at ([xshift=18.0em,yshift=1.63em]label1.south west) {更多数据-总词数:100K $\sim$ 1M};
\node [anchor=north west] (p12) at (label11.south west) {$P(\textrm{})=0.000010$};
\node [anchor=north west] (p22) at (p12.south west) {$P(\textrm{})=0.001812$};
\node [anchor=north west] (p32) at (p22.south west) {$P(\textrm{确实})=0.000001$};
\node [anchor=north west] (p12) at (label11.south west) {$\funp{P}(\textrm{})=0.000010$};
\node [anchor=north west] (p22) at (p12.south west) {$\funp{P}(\textrm{})=0.001812$};
\node [anchor=north west] (p32) at (p22.south west) {$\funp{P}(\textrm{确实})=0.000001$};
......
\definecolor{ublue}{rgb}{0.152,0.250,0.545}
\begin{tikzpicture}%画图中的属性如xshift应该是通用的,前面的关键字如xlabel规定了修改的部分
\begin{tikzpicture}
\begin{axis}[
width=10cm, height=4.5cm,
symbolic x coords={未抽取词,do,want,what,am,people,look},%自定义x坐标
xtick=data,%自定义x坐标
symbolic x coords={未抽取词,do,want,what,am,people,look},
xtick=data,
ytick={0,0.05,0.1,0.15,0.2,0.25},
xlabel={低概率词汇},
ylabel={词汇概率},
legend pos=outer north east,%图标位置
legend pos=outer north east,
xlabel style={align=right,xshift=5.3cm,yshift=0.8cm,font=\footnotesize},
ylabel style={rotate=-90,yshift=2cm,xshift=1cm,font=\footnotesize},
y tick style={opacity=0},%隐藏y轴刻度线
x tick style={opacity=0},%隐藏x轴刻度线
y tick style={opacity=0},
x tick style={opacity=0},
x tick label style={anchor=base,font=\footnotesize,yshift=-0.5cm},
y tick label style={font=\footnotesize,/pgf/number format/.cd,fixed,precision=2},%y轴精度,不用科学表示
y axis line style={opacity=0},%隐藏y轴
tick align=inside,%原本的横行线
ymajorgrids,%显示横行网格线
axis x line*=bottom,%显示x轴坐标汉字(应该是对齐)
major grid style={dotted,draw=ublue},%横行线颜色
axis on top,%网格线位于顶层
legend style={anchor=north west,font=\footnotesize},%图标格式
y tick label style={font=\footnotesize,/pgf/number format/.cd,fixed,precision=2},
y axis line style={opacity=0},
tick align=inside,
ymajorgrids,
axis x line*=bottom,
major grid style={dotted,draw=ublue},
axis on top,
legend style={anchor=north west,font=\footnotesize},
ymin=0,
ymax=0.25]
\addplot [ybar,bar shift=-2mm,bar width=4mm,fill=blue!40,draw=blue!40,area legend] coordinates{(未抽取词,0) (do,0.05) (want,0.05) (what,0.05) (am,0.1) (people,0.15) (look,0.2)};%area legend图例显示长方形颜色
\addplot [ybar,bar shift=-2mm,bar width=4mm,fill=blue!40,draw=blue!40,area legend] coordinates{(未抽取词,0) (do,0.05) (want,0.05) (what,0.05) (am,0.1) (people,0.15) (look,0.2)};
\addplot [ybar,bar shift=2mm,bar width=4mm,fill=red!40,draw=red!40,area legend] coordinates{(未抽取词,0.03) (do,0.062) (want,0.062) (what,0.062) (am,0.09) (people,0.122) (look,0.138)};
\legend{未平滑,平滑后}%右上图例
\legend{未平滑,平滑后}
\end{axis}
\end{tikzpicture}
......
......@@ -44,21 +44,21 @@
\node [anchor=north,rotate=90,inner sep=1pt,minimum width=2em,fill=black] (pt44) at (n44.east) {\small{{\color{white} \textbf{-0.1}}}};
\node[anchor=south,unit,text=red] (w4) at ([yshift=0.5em]n41.north){$w_4$};
\draw[->,ublue,very thick] (n11.east) -- (n21.west);
\draw[->,ublue,very thick] (n11.east) -- (n22.west);
\draw[->,ublue,very thick] (n11.east) -- (n23.west);
% \draw[->,ublue,very thick] (n11.east) -- (n21.west);
\draw[->,ublue,very thick,dotted] (n11.east) -- (n22.west);
\draw[->,ublue,very thick,dotted] (n11.east) -- (n23.west);
\draw[->,ublue,very thick] (pt21.south) -- (n31.west);
\draw[->,ublue,very thick] (pt21.south) -- (n32.west);
\draw[->,ublue,very thick] (pt21.south) -- (n33.west);
\draw[->,ublue,very thick] (pt22.south) -- (n34.west);
\draw[->,ublue,very thick] (pt22.south) -- (n35.west);
\draw[->,ublue,very thick] (pt22.south) -- (n36.west);
\draw[->,ublue,very thick,dotted] (pt21.south) -- (n31.west);
% \draw[->,ublue,very thick] (pt21.south) -- (n32.west);
\draw[->,ublue,very thick,dotted] (pt21.south) -- (n33.west);
\draw[->,ublue,very thick,dotted] (pt22.south) -- (n34.west);
\draw[->,ublue,very thick,dotted] (pt22.south) -- (n35.west);
\draw[->,ublue,very thick,dotted] (pt22.south) -- (n36.west);
\draw[->,ublue,very thick] (pt31.south) -- (n41.west);
\draw[->,ublue,very thick] (pt32.south) -- (n42.west);
\draw[->,ublue,very thick] (pt34.south) -- (n43.west);
\draw[->,ublue,very thick] (pt35.south) -- (n44.west);
\draw[->,ublue,very thick,dotted] (pt31.south) -- (n41.west);
% \draw[->,ublue,very thick] (pt32.south) -- (n42.west);
\draw[->,ublue,very thick,dotted] (pt34.south) -- (n43.west);
\draw[->,ublue,very thick,dotted] (pt35.south) -- (n44.west);
% \draw[->,red,ultra thick,opacity=0.7,line width=2pt]([xshift=-1em]n11.west) -- (n11.west) -- ([xshift=0.5em,yshift=-0.5em]n11.west) -- ([xshift=-0.5em,yshift=-0.5em]n11.east) -- (n11.east) -- (n21.west) -- ([xshift=0.5em,yshift=-0.5em]n21.west) -- ([xshift=-0.5em,yshift=-0.5em]n21.east) -- (n21.east) -- (n32.west) -- ([xshift=0.5em,yshift=-0.5em]n32.west) -- ([xshift=0.5em,yshift=-0.5em]n32.east) -- (n32.east) -- (n42.west) -- ([xshift=0.5em,yshift=-0.5em]n42.west) -- ([xshift=-0.5em,yshift=-0.5em]n42.east) -- (n42.east) -- ([xshift=1em]pt42.south);
% \draw[->,red,ultra thick,opacity=0.7,line width=2pt]([xshift=-1em,yshift=-0.5em]n11.west) -- ([yshift=-0.5em]n11.east) -- (n11.east) -- ([xshift=-0.3em,yshift=-0.5em]n21.west) -- ([xshift=0.5em,yshift=-0.5em]n21.west) -- ([xshift=-0.5em,yshift=-0.5em]n21.east) -- (n21.east) -- (n32.west) -- ([xshift=0.5em,yshift=-0.5em]n32.west) -- ([xshift=-0.5em,yshift=-0.5em]n32.east) -- (n32.east) -- (n42.west) -- ([xshift=0.5em,yshift=-0.5em]n42.west) -- ([xshift=-0.5em,yshift=-0.5em]n42.east) -- (n42.east) -- ([xshift=1em]pt42.south);
......
......@@ -3,8 +3,8 @@
\begin{axis}[
width=12cm,
height=4cm,
xlabel={{$P(x)$}},
ylabel={{$I(x)$}},
xlabel={{$\funp{P}(x)$}},
ylabel={{$\funp{I}(x)$}},
ylabel style={yshift=-1.5em,font=\footnotesize},
xlabel style={yshift=0.3em,font=\footnotesize},
xtick={0,0.2,...,1.0},
......@@ -23,7 +23,7 @@ xticklabel style={font=\small}, %坐标轴字体大小
yticklabel style={font=\small}
]
\addplot[draw=ublue,samples=100,thick] {-log2(x)};
\legend{\footnotesize{$I(x) = -\log P(x)$}}
\legend{\footnotesize{$\funp{I}(x) = -\log \funp{P}(x)$}}
\end{axis}
\end{tikzpicture}
......
......@@ -13,7 +13,7 @@
\node [draw,thick,minimum size=10pt] at (\i,0) {1};
}
}
\node [anchor=west] at (33em,0) {$\textrm{P}(\text{1}) = 5/30$};
\node [anchor=west] at (33em,0) {$\funp{P}(\text{1}) = 5/30$};
\end{scope}
\begin{scope}[yshift=-2.5em]
......@@ -22,7 +22,7 @@
\node [draw,thick,minimum size=10pt] at (\i,0) {{\color{red} 2}};
}
}
\node [anchor=west] at (33em,0) {$\textrm{P}(\text{2}) = 4/30$};
\node [anchor=west] at (33em,0) {$\funp{P}(\text{2}) = 4/30$};
\end{scope}
\begin{scope}[yshift=-5.0em]
......@@ -31,7 +31,7 @@
\node [draw,thick,minimum size=10pt] at (\i,0) {{\color{ublue} 3}};
}
}
\node [anchor=west] at (33em,0) {$\textrm{P}(\text{3}) = 6/30$};
\node [anchor=west] at (33em,0) {$\funp{P}(\text{3}) = 6/30$};
\end{scope}
\begin{scope}[yshift=-7.5em]
......@@ -40,7 +40,7 @@
\node [draw,thick,minimum size=10pt] at (\i,0) {{\color{ugreen} 4}};
}
}
\node [anchor=west] at (33em,0) {$\textrm{P}(\text{4}) = 12/30$};
\node [anchor=west] at (33em,0) {$\funp{P}(\text{4}) = 12/30$};
\end{scope}
\begin{scope}[yshift=-10.0em]
......@@ -49,7 +49,7 @@
\node [draw,thick,minimum size=10pt] at (\i,0) {{\color{purple} 5}};
}
}
\node [anchor=west] at (33em,0) {$\textrm{P}(\text{5}) = 2/30$};
\node [anchor=west] at (33em,0) {$\funp{P}(\text{5}) = 2/30$};
\end{scope}
\begin{scope}[yshift=-12.5em]
......@@ -58,7 +58,7 @@
\node [draw,thick,minimum size=10pt] at (\i,0) {{\color{orange} 6}};
}
}
\node [anchor=west] at (33em,0) {$\textrm{P}(\text{6}) = 1/30$};
\node [anchor=west] at (33em,0) {$\funp{P}(\text{6}) = 1/30$};
\end{scope}
\end{tikzpicture}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论