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 ed56cc4 commit 1242ffb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions _drafts/2022/bm25.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ $$\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}
\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}
$$

<img src="https://latex.codecogs.com/svg.image?\begin{aligned}\text{IDF}^{bm25}(t)&=\log\frac{N-\text{DF}(t)&plus;0.5}{\text{DF}(t)&plus;0.5}\\&=\log(\frac{N&plus;1}{\text{DF}(t)&plus;0.5}-1)\end{aligned}">


同样, +0.5 是为了平滑,且“分子上凑个数”,满足:当 DF(t)=N 时,这一项为 0。整体上跟 TF-IDF 的差距不大。
Expand All @@ -95,9 +95,9 @@ $$
## 神奇的数字 25
据说是指第 25 次迭代调参才获得最终的算法,参考 https://opensourceconnections.com/blog/2015/10/16/bm25-the-next-generation-of-lucene-relevation/


<img src="https://image.ddot.cc/202311/fdcfb1a1-c20f-4a61-b287-940c22d2711c_rc.png" width=678pt>

<center>
<img src="https://image.ddot.cc/202311/fdcfb1a1-c20f-4a61-b287-940c22d2711c_rc.png" width=678pt>
</center>

## 局限性
适用场景:
Expand Down
10 changes: 5 additions & 5 deletions _posts/2022/2022-11-17-Okapi-BM25.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ $$\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}
\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}
$$

<img src="https://latex.codecogs.com/svg.image?\begin{aligned}\text{IDF}^{bm25}(t)&=\log\frac{N-\text{DF}(t)&plus;0.5}{\text{DF}(t)&plus;0.5}\\&=\log(\frac{N&plus;1}{\text{DF}(t)&plus;0.5}-1)\end{aligned}">


同样, +0.5 是为了平滑,且“分子上凑个数”,满足:当 DF(t)=N 时,这一项为 0。整体上跟 TF-IDF 的差距不大。
Expand All @@ -101,9 +101,9 @@ $$
## 神奇的数字 25
据说是指第 25 次迭代调参才获得最终的算法,参考 https://opensourceconnections.com/blog/2015/10/16/bm25-the-next-generation-of-lucene-relevation/


<img src="https://image.ddot.cc/202311/fdcfb1a1-c20f-4a61-b287-940c22d2711c_rc.png" width=678pt>

<center>
<img src="https://image.ddot.cc/202311/fdcfb1a1-c20f-4a61-b287-940c22d2711c_rc.png" width=678pt>
</center>

## 局限性
适用场景:
Expand Down

0 comments on commit 1242ffb

Please sign in to comment.