Package com.yahoo.fsa.topicpredictor
Class TopicPredictor
java.lang.Object
com.yahoo.fsa.MetaData
com.yahoo.fsa.topicpredictor.TopicPredictor
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 Summary
ConstructorDescriptionTopicPredictor
(String fsafile, String datfile) TopicPredictor
(String fsafile, String datfile, String charsetname) -
Method Summary
Modifier and TypeMethodDescriptiongetPredictedTopics
(String segment) Returns a list of PredictedTopic objects, one for each topic the segment maps to.getPredictedTopics
(String segment, int maxTopics) Returns a list of PredictedTopic objects, one for each topic the segment maps to.Methods inherited from class com.yahoo.fsa.MetaData
getDirectRecordEntry, getIndirectRecordEntry, getIndirectRecordEntry, getIntEntry, getStringArrayEntry, getStringEntry, isOk, main, user
-
Constructor Details
-
TopicPredictor
-
TopicPredictor
-
-
Method Details
-
getPredictedTopics
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
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.
-