Package com.yahoo.fsa.topicpredictor
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 Summary
Constructors Constructor Description TopicPredictor(java.lang.String fsafile, java.lang.String datfile)
TopicPredictor(java.lang.String fsafile, java.lang.String datfile, java.lang.String charsetname)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List
getPredictedTopics(java.lang.String segment)
Returns a list of PredictedTopic objects, one for each topic the segment maps to.java.util.List
getPredictedTopics(java.lang.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
-
-
-
-
Method Detail
-
getPredictedTopics
public java.util.List getPredictedTopics(java.lang.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 java.util.List getPredictedTopics(java.lang.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.
-
-