Package org.wikipedia.miner.model.Anchor

Examples of org.wikipedia.miner.model.Anchor.Sense


        if (anchor.getSenses().isEmpty()) {
          continue;
        }

        // what is the most likely sense for the given candidate
        Sense bestSense = anchor.getSenses().first();

        // add to the context all articles that map
        // from ngrams with one possible meaning
        // = non-ambiguous meanings
        // and high probability of being links in Wikipedia
        if (anchor.getSenses().size() == 1
            && anchor.getLinkProbability() > 0.5) {
          context.add(bestSense);
          continue;
        }

        // in case if not enough non-ambigious terms were collected
        // additionally collect other mappings based on:

        // a. likelihood of the sense
        double senseProbability = bestSense.getProbability();

        // b. keyphraseness
        double linkProbability = anchor.getLinkProbability();

        if (senseProbability >= 0.9 && linkProbability > 0.5) {
          bestSense.setWeight(senseProbability);
          bestCandidateSenses.add(bestSense, false);
        }

      } catch (SQLException e) {
        System.err.println("Error computing senses for " + anchor);
View Full Code Here

TOP

Related Classes of org.wikipedia.miner.model.Anchor.Sense

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.