Class 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 Detail

      • TopicPredictor

        public TopicPredictor​(String fsafile,
                              String datfile)
      • TopicPredictor

        public TopicPredictor​(String fsafile,
                              String datfile,
                              String charsetname)
    • Method Detail

      • getPredictedTopics

        public List 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 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.