Class TopicPredictor

java.lang.Object
com.yahoo.fsa.MetaData
com.yahoo.fsa.topicpredictor.TopicPredictor

public class TopicPredictor extends MetaData
Class for accessing the topic prediction automata. Look up the predicted topics for a term. Each topic has an attached weight and a term vector (topicSegments).
Author:
Peter Boros
  • Constructor Details

    • TopicPredictor

      public TopicPredictor(String fsafile, String datfile)
    • TopicPredictor

      public TopicPredictor(String fsafile, String datfile, String charsetname)
  • Method Details

    • getPredictedTopics

      public List<PredictedTopic> getPredictedTopics(String segment)
      Returns a list of PredictedTopic objects, one for each topic the segment maps to. The returned list contains all topics, as opposed to the two-argument version.
      Parameters:
      segment - The segment string to find (all) topics for.
      Returns:
      (Linked)List of PredictedTopic objects.
    • getPredictedTopics

      public List<PredictedTopic> getPredictedTopics(String segment, int maxTopics)
      Returns a list of PredictedTopic objects, one for each topic the segment maps to. The returned list length is cut off at 'maxTopics' entries, maxTopics=0 returns all topics.
      Parameters:
      segment - The segment string to find topics for.
      maxTopics - The max number of topics to return, 0 for all topics
      Returns:
      (Linked)List of PredictedTopic objects.