Skip to content

Commit

Permalink
test multiline formula
Browse files Browse the repository at this point in the history
  • Loading branch information
GaoangLiu committed Nov 4, 2023
1 parent 612c31b commit ed56cc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions _drafts/2022/bm25.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ $$\text{TF}^{bm25}(t, d) = \frac{x \cdot (k+1)}{x + k(1 - b(1 - \frac{\text{DL}}
## IDF 上的约束
这一项说是拓展了二元独立模型的得分函数,具体推理可以参考[博客](https://www.cnblogs.com/bentuwuying/p/6730891.html)

$\begin{aligned}
$$
\begin{aligned}
\text{IDF}^{bm25}(t) &= \log \frac{N - \text{DF}(t) + 0.5}{\text{DF}(t) + 0.5} \\
&= \log (\frac{N+1}{\text{DF}(t)+0.5} - 1)
\end{aligned}$
\end{aligned}
$$


同样, +0.5 是为了平滑,且“分子上凑个数”,满足:当 DF(t)=N 时,这一项为 0。整体上跟 TF-IDF 的差距不大。

Expand Down
7 changes: 5 additions & 2 deletions _posts/2022/2022-11-17-Okapi-BM25.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ $$\text{TF}^{bm25}(t, d) = \frac{x \cdot (k+1)}{x + k(1 - b(1 - \frac{\text{DL}}
## IDF 上的约束
这一项说是拓展了二元独立模型的得分函数,具体推理可以参考[博客](https://www.cnblogs.com/bentuwuying/p/6730891.html)

$\begin{aligned}
$$
\begin{aligned}
\text{IDF}^{bm25}(t) &= \log \frac{N - \text{DF}(t) + 0.5}{\text{DF}(t) + 0.5} \\
&= \log (\frac{N+1}{\text{DF}(t)+0.5} - 1)
\end{aligned}$
\end{aligned}
$$


同样, +0.5 是为了平滑,且“分子上凑个数”,满足:当 DF(t)=N 时,这一项为 0。整体上跟 TF-IDF 的差距不大。

Expand Down

0 comments on commit ed56cc4

Please sign in to comment.