|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ciagent.CIAgent | +--infofilter.FilterAgent
The FilterAgent
class implements an agent which scores
news articles using a keyword list, maintains a user profile, and
filters articles
Field Summary | |
protected boolean |
buildClusterNet
|
protected boolean |
buildRatingNet
|
protected KMapNet |
clusterNet
|
protected boolean |
clusterNetTrained
|
static java.lang.String |
fileName
|
(package private) InfoFilterFrame |
infoFilter
|
static java.lang.String |
INTERESTING_RATING
|
protected java.lang.String[] |
keywords
|
static java.lang.String |
MILDLY_RATING
|
static java.lang.String |
NEUTRAL_RATING
|
static java.lang.String |
NOTVERY_RATING
|
protected BackProp |
ratingNet
|
protected boolean |
ratingNetTrained
|
static int |
USE_CLUSTERS
|
static int |
USE_KEYWORDS
|
static int |
USE_PREDICTED_RATING
|
static java.lang.String |
USELESS_RATING
|
Fields inherited from class ciagent.CIAgent |
agentPlatform,
children,
DEFAULT_ASYNCTIME,
DEFAULT_SLEEPTIME,
name,
parent,
traceLevel |
Constructor Summary | |
FilterAgent()
Creates a FilterAgent object. |
|
FilterAgent(java.lang.String name)
Creates a FilterAgent object with the given name. |
Method Summary | |
(package private) void |
addAllArticlesToProfile(java.util.Vector articles)
Appends the given set of articles to the profile. |
(package private) void |
addArticleToProfile(NewsArticle currentArt)
Appends the given article to the profile. |
void |
buildClusterNet()
Triggers an autonomous build of Kohonen Map. |
void |
buildRatingNet()
Triggers an autonomous build of a back prop network. |
(package private) void |
computeClusterAverages(java.util.Vector articles)
Computes the average score for each cluster and sets the score of each article in each cluster to that average value. |
(package private) int[] |
countWordMultiKeys(java.lang.String[] keys,
java.lang.String text)
Count the number of occurrences of the specified keys in the text. |
java.lang.String[] |
getKeywords()
Retrieves the list of keywords in the FilterAgent profile. |
java.lang.String |
getTaskDescription()
Retrieves the task description used for display purposes. |
void |
initialize()
Initializes this agent by setting the sleep timer. |
boolean |
isClusterNetTrained()
Indicates whether the cluster net is trained. |
boolean |
isRatingNetTrained()
Indicates whether the rating net is trained. |
void |
process()
Does nothing. |
void |
processCIAgentEvent(CIAgentEvent e)
Processes a CIAgentEvent. |
void |
processTimerPop()
Processes a timer pop by performing neural net training, if requested. |
static FilterAgent |
restoreFromFile(java.lang.String fileName)
Reads a serialized FilterAgent from the specified file. |
void |
saveToFile(java.lang.String fileName)
Writes a serialized version of this FilterAgent to the specified file. |
(package private) void |
score(NewsArticle article,
int filterType)
Scores a single article. |
(package private) void |
score(java.util.Vector articles,
int filterType)
Scores all loaded articles using the given filter type. |
void |
setKeywords(java.lang.String[] keywords)
Sets the list of keywords used in the FilterAgent profile. |
void |
status(java.lang.String msg)
Sends a status event to all registered listeners. |
(package private) void |
trainClusterNet()
Trains the cluster network. |
(package private) void |
trainRatingNet()
Trains the rating network. |
(package private) void |
writeProfileDataDefinition()
Writes the infoFilter metadata file (infofilter.dfn) that is read by the neural networks for training. |
Methods inherited from class java.lang.Object |
|
Field Detail |
transient InfoFilterFrame infoFilter
protected java.lang.String[] keywords
protected KMapNet clusterNet
protected BackProp ratingNet
protected boolean buildClusterNet
protected boolean clusterNetTrained
protected boolean buildRatingNet
protected boolean ratingNetTrained
public static final java.lang.String fileName
public static final int USE_KEYWORDS
public static final int USE_CLUSTERS
public static final int USE_PREDICTED_RATING
public static final java.lang.String USELESS_RATING
public static final java.lang.String NOTVERY_RATING
public static final java.lang.String NEUTRAL_RATING
public static final java.lang.String MILDLY_RATING
public static final java.lang.String INTERESTING_RATING
Constructor Detail |
public FilterAgent()
FilterAgent
object.public FilterAgent(java.lang.String name)
FilterAgent
object with the given name.name
- the String object that contains the name of this agentMethod Detail |
public java.lang.String getTaskDescription()
public void initialize()
public void process()
public void processTimerPop()
public void processCIAgentEvent(CIAgentEvent e)
e
- the CIAgentEvent object to be processedpublic java.lang.String[] getKeywords()
public void setKeywords(java.lang.String[] keywords)
keywords
- a String[] that contains the list of keywordspublic void buildClusterNet()
public void buildRatingNet()
public boolean isClusterNetTrained()
public boolean isRatingNetTrained()
void score(NewsArticle article, int filterType)
article
- the NewsArticle object to be scoredfilterType
- the integer that indicates the type of filter
(USE_KEYWORDS, USE_CLUSTERS, USE_PREDICTED_RATING)void score(java.util.Vector articles, int filterType)
articles
- the vector of NewsArticles object to be scoredfilterType
- the integer that indicates the type of filter
(USE_KEYWORDS, USE_CLUSTERS, USE_PREDICTED_RATING)void computeClusterAverages(java.util.Vector articles)
articles
- the Vector object that contains the articles for which
the cluster score is setint[] countWordMultiKeys(java.lang.String[] keys, java.lang.String text)
keys
- the String[] objects that contain the keystext
- the String object that contains the textvoid writeProfileDataDefinition()
void addArticleToProfile(NewsArticle currentArt)
currentArt
- the NewsArticle object to be addedvoid addAllArticlesToProfile(java.util.Vector articles)
articles
- the Vector object that contains the articles to be
addedvoid trainClusterNet()
void trainRatingNet()
public void status(java.lang.String msg)
msg
- the String that is the message portion of the status eventpublic static FilterAgent restoreFromFile(java.lang.String fileName) throws java.lang.ClassNotFoundException, java.io.IOException
fileName
- the String object that contains the name of the
file containing the serialized FilterAgentpublic void saveToFile(java.lang.String fileName)
fileName
- the String that contains the name of the file to write
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |