Merge branch 'master' into term-positions

This commit is contained in:
Viktor Lofgren 2024-09-17 15:20:46 +02:00
commit 8e78286068
4 changed files with 34 additions and 0 deletions

View File

@ -8,9 +8,14 @@ import java.util.List;
// 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.
//
// The data is available at
// https://downloads.marginalia.nu/link-test-data.tar.gz
//
@Disabled
class RankingAlgorithmWithRealDataTest {
/** Test the regular PageRank algorithm. */
@Test
public void testRegularPR() {
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
public void testInvertedLinkGraph() {
if (!TestGraphSourceForInvertedLinkData.isAvailable()) {
@ -41,6 +65,7 @@ class RankingAlgorithmWithRealDataTest {
}
}
/** Test pagerank with similarity data */
@Test
public void testSimilarityPR() {
if (!TestGraphSourceForSimilarityData.isAvailable()) {
@ -56,6 +81,7 @@ class RankingAlgorithmWithRealDataTest {
}
}
/** Test personalized pagerank with similarity data */
@Test
public void testSimilarityPPR() {
if (!TestGraphSourceForSimilarityData.isAvailable()) {

View File

@ -16,6 +16,8 @@ import java.util.List;
import java.util.Map;
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[] linksDataPaths = new Path[] {
Paths.get("/home/vlofgren/Exports/Links/domain-links-1.dat"),

View File

@ -16,6 +16,9 @@ import java.util.List;
import java.util.Map;
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[] linksDataPaths = new Path[] {
Paths.get("/home/vlofgren/Exports/Links/domain-links-1.dat"),

View File

@ -15,6 +15,9 @@ import java.util.List;
import java.util.Map;
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 similarityDataPath = Paths.get("/home/vlofgren/Exports/Links/neighbors.tsv");