Skip to content

Commit

Permalink
Revert "revert nlp, notation changes, revise gitignore"
Browse files Browse the repository at this point in the history
This reverts commit 46b7c4c.
  • Loading branch information
astonzhang committed Nov 14, 2018
1 parent c3af0aa commit d130096
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ build/environment.yml
build/gluonbook
build/data
build/README.md
build/build
build/mdd.zip
*.json
*.params
*.DS_Store
Expand Down
8 changes: 1 addition & 7 deletions chapter_appendix/notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@
|$\nabla_{\cdot} y$|$y$关于$\cdot$的梯度|


## 概率和统计
|||
|:--|:-:|
|$\mathbb{P}(\cdot)$|概率分布|
|$\cdot \sim \mathbb{P}$|随机变量$\cdot$的概率分布是$\mathbb{P}$|
|$\mathbb{P}(\cdot \mid \cdot)$|条件概率分布|
|$\mathbb{E}_\cdot\left(f(\cdot)\right)$|函数$f(\cdot)$对$\cdot$的数学期望|


## 复杂度

Expand Down
4 changes: 2 additions & 2 deletions chapter_natural-language-processing/fasttext.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

在fastText中,每个中心词被表示成子词的集合。下面我们用单词“where”作为例子来了解子词是如何产生的。首先,我们在单词的首尾分别添加特殊字符“<”和“>”以区分作为前后缀的子词。然后,将单词当成一个由字符构成的序列来提取$n$元语法。例如当$n=3$时,我们得到所有长度为3的子词:

$$\textrm{``<wh"}, \ \textrm{``whe"}, \ \textrm{``her"}, \ \textrm{``ere"}, \ \textrm{``re>"},$$
$$\textrm{<wh}, \ \textrm{whe}, \ \textrm{her}, \ \textrm{ere}, \ \textrm{re>},$$

以及特殊子词$\textrm{``<where>"}$。
以及特殊子词$\textrm{<where>}$。

在fastText中,对于一个词$w$,我们将它所有长度在3到6的子词和特殊子词的并集记为$\mathcal{G}_w$。那么词典则是所有词的子词集合的并集。假设词典中子词$g$的向量为$\boldsymbol{z}_g$,那么跳字模型中词$w$的作为中心词的向量$\boldsymbol{v}_w$则表示成

Expand Down
4 changes: 2 additions & 2 deletions chapter_natural-language-processing/glove.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ $$\sum_{i\in\mathcal{V}} \sum_{j\in\mathcal{V}} h(x_{ij}) \left(\mathbf{u}_j^\to

|$w_k$=|“solid”|“gas”|“water”|“fashion”|
|--:|:-:|:-:|:-:|
|$p_1=\mathbb{P}(w_k\mid\text{``ice"})$|0.00019|0.000066|0.003|0.000017|
|$p_2=\mathbb{P}(w_k\mid\text{``steam"})$|0.000022|0.00078|0.0022|0.000018|
|$p_1=\mathbb{P}(w_k\mid\text{"ice"})$|0.00019|0.000066|0.003|0.000017|
|$p_2=\mathbb{P}(w_k\mid\text{"steam"})$|0.000022|0.00078|0.0022|0.000018|
|$p_1/p_2$|8.9|0.085|1.36|0.96|

我们可以观察到以下现象:
Expand Down

0 comments on commit d130096

Please sign in to comment.