public class PseudoWordReporter extends Object implements AssignmentReporter
AssignmentReporter
that creates a PseudoWord answer key .
This should be used in conjunction with a PseudoWordContextExtractor
.
When reporting, primary keys are expected to be the pseudo word while
secondary keys are expected to be the actual word used in a given instance.
The reporter will record the number of times each secondary key was assigned
to a particular cluster for each primary key. When the report is finalized,
it will generate a lines of the form:
primaryKey secondaryKey clusterNumber assignmentCount
This can later be used to determine what words best describe each cluster.Constructor and Description |
---|
PseudoWordReporter(OutputStream stream)
Creates a new
PseudoWordReporter . |
Modifier and Type | Method and Description |
---|---|
void |
assignContextToKey(String primaryKey,
String secondaryKey,
int contextId)
Records an assignment of
contextId to secondaryKey and
primaryKey . |
String[] |
contextLabels(String primaryKey)
Return an array mapping context ids to secondary keys.
|
void |
finalizeReport()
Finalizes the assignment report.
|
void |
updateAssignment(String primaryKey,
String secondaryKey,
int clusterId)
Updates the assignment report with the knowledge that
primaryKey
and secondaryKey were associated with clusterId once. |
public PseudoWordReporter(OutputStream stream)
PseudoWordReporter
.stream
- The stream to which the answer key should be written.public void updateAssignment(String primaryKey, String secondaryKey, int clusterId)
primaryKey
and secondaryKey
were associated with clusterId
once.updateAssignment
in interface AssignmentReporter
public void finalizeReport()
finalizeReport
in interface AssignmentReporter
public void assignContextToKey(String primaryKey, String secondaryKey, int contextId)
contextId
to secondaryKey
and
primaryKey
.assignContextToKey
in interface AssignmentReporter
public String[] contextLabels(String primaryKey)
contextLabels
in interface AssignmentReporter
Copyright © 2012. All Rights Reserved.