mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21:18:58 +00:00
(index) Reduce the value of site and site-adjacent in BM25P calculations
This commit is contained in:
parent
f732f6ae6f
commit
1f3b89cf28
@ -53,9 +53,11 @@ public class Bm25Factor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static double evaluatePriorityScore(SearchResultKeywordScore keyword) {
|
private static double evaluatePriorityScore(SearchResultKeywordScore keyword) {
|
||||||
|
int pcount = keyword.positionCount();
|
||||||
|
|
||||||
double qcount = 0.;
|
double qcount = 0.;
|
||||||
if ((keyword.encodedWordMetadata() & WordFlags.Site.asBit()) != 0)
|
if ((keyword.encodedWordMetadata() & WordFlags.Site.asBit()) != 0)
|
||||||
qcount += 2.;
|
qcount += 0.5;
|
||||||
if ((keyword.encodedWordMetadata() & WordFlags.SiteAdjacent.asBit()) != 0)
|
if ((keyword.encodedWordMetadata() & WordFlags.SiteAdjacent.asBit()) != 0)
|
||||||
qcount += 0.5;
|
qcount += 0.5;
|
||||||
if ((keyword.encodedWordMetadata() & WordFlags.UrlPath.asBit()) != 0)
|
if ((keyword.encodedWordMetadata() & WordFlags.UrlPath.asBit()) != 0)
|
||||||
@ -66,12 +68,16 @@ public class Bm25Factor {
|
|||||||
qcount += 2.5;
|
qcount += 2.5;
|
||||||
if ((keyword.encodedWordMetadata() & WordFlags.Title.asBit()) != 0)
|
if ((keyword.encodedWordMetadata() & WordFlags.Title.asBit()) != 0)
|
||||||
qcount += 1.5;
|
qcount += 1.5;
|
||||||
if ((keyword.encodedWordMetadata() & WordFlags.Subjects.asBit()) != 0)
|
|
||||||
qcount += 1.25;
|
if (pcount > 2) {
|
||||||
if ((keyword.encodedWordMetadata() & WordFlags.NamesWords.asBit()) != 0)
|
if ((keyword.encodedWordMetadata() & WordFlags.Subjects.asBit()) != 0)
|
||||||
qcount += 0.25;
|
qcount += 1.25;
|
||||||
if ((keyword.encodedWordMetadata() & WordFlags.TfIdfHigh.asBit()) != 0)
|
if ((keyword.encodedWordMetadata() & WordFlags.NamesWords.asBit()) != 0)
|
||||||
qcount += 0.5;
|
qcount += 0.25;
|
||||||
|
if ((keyword.encodedWordMetadata() & WordFlags.TfIdfHigh.asBit()) != 0)
|
||||||
|
qcount += 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
return qcount;
|
return qcount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user