Skip to content

Commit

Permalink
update retrivetg
Browse files Browse the repository at this point in the history
  • Loading branch information
guogaiblueelephant committed Sep 21, 2023
1 parent da440e3 commit e3b14a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/zh/posts/llm/RetrieveTextGeneration.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ $$
match(q,d)
=\frac
{\rm{IDF}(q)\rm{tf}(q, d)(k_1+1)}{\rm{tf}(q,d)+k_1(1-b+\frac{b\left|d\right|}{avgdl})}
\tag {3.1}
$$

其中IDF(q)表示词q的逆文档频率,tf(q,d)表示词q在文本d中出现的次数,|d|表示文本d的长度,avgdl表示所有文本的平均长度。k1,b为调优参数。
Expand All @@ -74,6 +75,7 @@ $$

$$
score(q,d) = \sum\limits_{q \in q} match(q, d)
\tag {3.2}
$$

(5)根据相似度对文本排序,返回与查询最相似的Top-N文本。
Expand Down

0 comments on commit e3b14a8

Please sign in to comment.