mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
Merge branch 'master' into term-positions
This commit is contained in:
commit
8e78286068
@ -8,9 +8,14 @@ import java.util.List;
|
|||||||
|
|
||||||
// Test the ranking algorithm with prod data. Will not run if the data is not available.
|
// Test the ranking algorithm with prod data. Will not run if the data is not available.
|
||||||
// It's not feasible to include the data in the git repo, as it's ~6 GB of data.
|
// It's not feasible to include the data in the git repo, as it's ~6 GB of data.
|
||||||
|
//
|
||||||
|
// The data is available at
|
||||||
|
// https://downloads.marginalia.nu/link-test-data.tar.gz
|
||||||
|
//
|
||||||
@Disabled
|
@Disabled
|
||||||
class RankingAlgorithmWithRealDataTest {
|
class RankingAlgorithmWithRealDataTest {
|
||||||
|
|
||||||
|
/** Test the regular PageRank algorithm. */
|
||||||
@Test
|
@Test
|
||||||
public void testRegularPR() {
|
public void testRegularPR() {
|
||||||
if (!TestGraphSourceForLinkData.isAvailable()) {
|
if (!TestGraphSourceForLinkData.isAvailable()) {
|
||||||
@ -26,6 +31,25 @@ class RankingAlgorithmWithRealDataTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Test the personalized PageRank algorithm. */
|
||||||
|
@Test
|
||||||
|
public void testRegularPPR() {
|
||||||
|
if (!TestGraphSourceForLinkData.isAvailable()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var graphSource = new TestGraphSourceForLinkData();
|
||||||
|
var results = new PageRankDomainRanker(graphSource,
|
||||||
|
List.of(1476552) // wiby.me
|
||||||
|
)
|
||||||
|
.calculate(10, RankingResultListAccumulator::new);
|
||||||
|
|
||||||
|
for (int i = 0; i < results.size(); i++) {
|
||||||
|
System.out.println(i + " " + graphSource.getName(results.get(i)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Test the inverted link graph pagerank algorithm */
|
||||||
@Test
|
@Test
|
||||||
public void testInvertedLinkGraph() {
|
public void testInvertedLinkGraph() {
|
||||||
if (!TestGraphSourceForInvertedLinkData.isAvailable()) {
|
if (!TestGraphSourceForInvertedLinkData.isAvailable()) {
|
||||||
@ -41,6 +65,7 @@ class RankingAlgorithmWithRealDataTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Test pagerank with similarity data */
|
||||||
@Test
|
@Test
|
||||||
public void testSimilarityPR() {
|
public void testSimilarityPR() {
|
||||||
if (!TestGraphSourceForSimilarityData.isAvailable()) {
|
if (!TestGraphSourceForSimilarityData.isAvailable()) {
|
||||||
@ -56,6 +81,7 @@ class RankingAlgorithmWithRealDataTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Test personalized pagerank with similarity data */
|
||||||
@Test
|
@Test
|
||||||
public void testSimilarityPPR() {
|
public void testSimilarityPPR() {
|
||||||
if (!TestGraphSourceForSimilarityData.isAvailable()) {
|
if (!TestGraphSourceForSimilarityData.isAvailable()) {
|
||||||
|
@ -16,6 +16,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class TestGraphSourceForInvertedLinkData implements GraphSource {
|
public class TestGraphSourceForInvertedLinkData implements GraphSource {
|
||||||
|
// The data is available at
|
||||||
|
// https://downloads.marginalia.nu/link-test-data.tar.gz
|
||||||
private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv");
|
private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv");
|
||||||
private static Path[] linksDataPaths = new Path[] {
|
private static Path[] linksDataPaths = new Path[] {
|
||||||
Paths.get("/home/vlofgren/Exports/Links/domain-links-1.dat"),
|
Paths.get("/home/vlofgren/Exports/Links/domain-links-1.dat"),
|
||||||
|
@ -16,6 +16,9 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class TestGraphSourceForLinkData implements GraphSource {
|
public class TestGraphSourceForLinkData implements GraphSource {
|
||||||
|
// The data is available at
|
||||||
|
// https://downloads.marginalia.nu/link-test-data.tar.gz
|
||||||
|
|
||||||
private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv");
|
private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv");
|
||||||
private static Path[] linksDataPaths = new Path[] {
|
private static Path[] linksDataPaths = new Path[] {
|
||||||
Paths.get("/home/vlofgren/Exports/Links/domain-links-1.dat"),
|
Paths.get("/home/vlofgren/Exports/Links/domain-links-1.dat"),
|
||||||
|
@ -15,6 +15,9 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class TestGraphSourceForSimilarityData implements GraphSource {
|
public class TestGraphSourceForSimilarityData implements GraphSource {
|
||||||
|
// The data is available at
|
||||||
|
// https://downloads.marginalia.nu/link-test-data.tar.gz
|
||||||
|
|
||||||
private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv");
|
private static Path domainDataPath = Paths.get("/home/vlofgren/Exports/Links/domains.export.tsv");
|
||||||
private static Path similarityDataPath = Paths.get("/home/vlofgren/Exports/Links/neighbors.tsv");
|
private static Path similarityDataPath = Paths.get("/home/vlofgren/Exports/Links/neighbors.tsv");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user