本文整理汇总了Java中edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors类的典型用法代码示例。如果您正苦于以下问题:Java PageRankWithPriors类的具体用法?Java PageRankWithPriors怎么用?Java PageRankWithPriors使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PageRankWithPriors类属于edu.uci.ics.jung.algorithms.scoring包,在下文中一共展示了PageRankWithPriors类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performPageRank
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
@Override
protected PageRankWithPriors<Vertex, Edge> performPageRank() {
PageRankWithPriors<Vertex, Edge> pr = new PageRankWithPriors<Vertex, Edge>(
graph, MapTransformer.getInstance(edgeWeights),
getRootPrior(graph.getVertices()), 0.13);
pr.setMaxIterations(250);
pr.evaluate();
return pr;
}
示例2: performPageRank
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
@Override
protected PageRankWithPriors<Vertex, Edge> performPageRank() {
PageRankWithPriors<Vertex, Edge> pr = new PageRankWithPriors<Vertex, Edge>(
graph, MapTransformer.getInstance(edgeWeights),
getRootPrior(graph.getVertices()), 0.09);
pr.setMaxIterations(iterations);
pr.evaluate();
return pr;
}
示例3: performPageRank
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
@Override
protected PageRankWithPriors<Vertex, Edge> performPageRank() {
PageRankWithPriors<Vertex, Edge> pr = new PageRankWithPriors<Vertex, Edge>(
graph, MapTransformer.getInstance(edgeWeights),
getRootPrior(graph.getVertices()), 0.13);
pr.setMaxIterations(75);
pr.evaluate();
return pr;
}
示例4: solve
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
public void solve() {
while (true) {
PageRankWithPriors<Vertex, Edge> pr = performPageRank();
if (analyzeResults(pr)) {
break;
}
}
}
示例5: performPageRank
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
protected PageRankWithPriors<Vertex, Edge> performPageRank() {
PageRankWithPriors<Vertex, Edge> pr = new PageRankWithPriors<Vertex, Edge>(
graph, MapTransformer.getInstance(edgeWeights),
getRootPrior(graph.getVertices()), 0.15);
pr.setMaxIterations(200);
pr.evaluate();
return pr;
}
示例6: performPageRank
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
protected PageRankWithPriors<Vertex, Edge> performPageRank() {
PageRankWithPriors<Vertex, Edge> pr = new PageRankWithPriors<Vertex, Edge>(graph,
MapTransformer.getInstance(edgeWeights), getRootPrior(graph.getVertices()), 0.15);
pr.setMaxIterations(200);
pr.evaluate();
return pr;
}
示例7: analyzeResults
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
@Override
public boolean analyzeResults(PageRankWithPriors<Vertex, Edge> pr) {
boolean disambiguationStop = true;
Collection<Vertex> vertexCol = graph.getVertices();
for (int i = 0; i < repList.size(); i++) {
if (!disambiguatedSurfaceForms.get(i)) {
int qryNr = repList.get(i).getQueryNr();
double maxScore = 0;
SummaryStatistics stats = new SummaryStatistics();
String tempSolution = "";
List<Candidate> scores = new ArrayList<Candidate>();
for (Vertex v : vertexCol) {
if (v.getEntityQuery() == qryNr && v.isCandidate()) {
scores.add(new Candidate(pr.getVertexScore(v)));
double score = Math.abs(pr.getVertexScore(v));
stats.addValue(score);
System.out.println("Score for: "+v.getUris().get(0)+" : "+score);
if (score > maxScore) {
tempSolution = v.getUris().get(0);
maxScore = score;
}
}
}
SurfaceForm rep = repList.get(i);
Collections.sort(scores, Collections.reverseOrder());
double secondMax = scores.get(1).score;
if (!Double.isInfinite(maxScore)) {
double avg = stats.getMean();
double threshold = computeThreshold(avg, maxScore);
// if (secondMax < threshold) {
updateGraph(rep.getCandidates(), tempSolution,
rep.getQueryNr());
rep.setDisambiguatedEntity(tempSolution);
System.out.println("Ich disambiguiere: "+tempSolution);
disambiguatedSurfaceForms.set(i);
disambiguationStop = false;
break;
}
// }
}
}
return disambiguationStop;
}
示例8: analyzeResults
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
@Override
public boolean analyzeResults(PageRankWithPriors<Vertex, Edge> pr) {
boolean disambiguationStop = true;
Collection<Vertex> vertexCol = graph.getVertices();
for (int i = 0; i < repList.size(); i++) {
if (!disambiguatedSurfaceForms.get(i) && repList.get(i).isRelevant()) {
int qryNr = repList.get(i).getQueryNr();
double maxScore = 0;
SummaryStatistics stats = new SummaryStatistics();
String tempSolution = "";
List<Candidate> scores = new ArrayList<Candidate>();
for (Vertex v : vertexCol) {
if (v.getEntityQuery() == qryNr && v.isCandidate()) {
scores.add(new Candidate(v.getUris().get(0), pr
.getVertexScore(v)));
double score = Math.abs(pr.getVertexScore(v));
stats.addValue(score);
if (score > maxScore) {
tempSolution = v.getUris().get(0);
maxScore = score;
}
}
}
SurfaceForm rep = repList.get(i);
SurfaceForm clone = origList.get(i);
Collections.sort(scores, Collections.reverseOrder());
double secondMax = scores.get(1).score;
List<String> newCandidates = new ArrayList<String>();
for(int j = 0; j < maximumcandidatespersf; j++) {
if(scores.size() > j) {
newCandidates.add(scores.get(j).can);
} else {
break;
}
}
if (!Double.isInfinite(maxScore)) {
double avg = stats.getMean();
double threshold = computeThreshold(avg, maxScore);
if (secondMax < threshold && disambiguate) {
updateGraph(rep.getCandidates(), tempSolution,
rep.getQueryNr());
rep.setDisambiguatedEntity(tempSolution);
clone.setDisambiguatedEntity(tempSolution);
disambiguatedSurfaceForms.set(i);
disambiguationStop = false;
break;
} else {
clone.setCandidates(newCandidates);
}
}
}
}
return disambiguationStop;
}
示例9: createCalcurator
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
protected PageRankWithPriors<V, ?> createCalcurator() {
return new PageRank(getGraph(), ALPHA);
}
示例10: createCalcurator
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected PageRankWithPriors<V, ?> createCalcurator() {
return new PageRank(getGraph(), edgeWeights, ALPHA);
}
示例11: analyzeResults
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
public abstract boolean analyzeResults(PageRankWithPriors<Vertex, Edge> pr);