本文整理汇总了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;
}
开发者ID:quhfus,项目名称:DoSeR-Disambiguation,代码行数:10,代码来源:FinalEntityDisambiguatorGeneral.java
示例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;
}
开发者ID:quhfus,项目名称:DoSeR-Disambiguation,代码行数:10,代码来源:Word2VecDisambiguatorGeneral.java
示例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;
}
开发者ID:quhfus,项目名称:DoSeR-Disambiguation,代码行数:10,代码来源:FinalEntityDisambiguation.java
示例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;
}
}
}
开发者ID:quhfus,项目名称:DoSeR-Disambiguation,代码行数:9,代码来源:AbstractWord2VecPageRank.java
示例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;
}
开发者ID:quhfus,项目名称:DoSeR-Disambiguation,代码行数:9,代码来源:AbstractWord2VecPageRank.java
示例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;
}
开发者ID:quhfus,项目名称:DoSeR,代码行数:8,代码来源:AbstractWord2VecPageRank.java
示例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;
}
开发者ID:quhfus,项目名称:DoSeR-Disambiguation,代码行数:45,代码来源:FinalEntityDisambiguatorGeneral.java
示例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;
}
开发者ID:quhfus,项目名称:DoSeR-Disambiguation,代码行数:57,代码来源:Word2VecDisambiguatorGeneral.java
示例9: createCalcurator
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes" })
protected PageRankWithPriors<V, ?> createCalcurator() {
return new PageRank(getGraph(), ALPHA);
}
开发者ID:macc704,项目名称:KBDeX,代码行数:5,代码来源:KVertexPageRankScorer.java
示例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);
}
开发者ID:macc704,项目名称:KBDeX,代码行数:6,代码来源:KVertexPageRankWeightedScorer.java
示例11: analyzeResults
import edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors; //导入依赖的package包/类
public abstract boolean analyzeResults(PageRankWithPriors<Vertex, Edge> pr);
开发者ID:quhfus,项目名称:DoSeR-Disambiguation,代码行数:2,代码来源:AbstractWord2VecPageRank.java
注:本文中的edu.uci.ics.jung.algorithms.scoring.PageRankWithPriors类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论