public class SemEvalReporter extends Object implements AssignmentReporter
AssignmentReporter
that creates a SenseEval or SemEval answer key.
This should be used in conjunction with a SemEvalContextExtractor
.
When reporting, Primary keys are not used. Secondary keys are expected to be
the instance identifier. For each call to updateAssignment
, the
reporter will generate a line of the form
word.pos word.pos.idNumber word.pos.clusterNumber
which designates word.pos.idNumber is the secondary key. The line signifies
that the given word instance was assigned to a cluster identified by
clusterNumber.Constructor and Description |
---|
SemEvalReporter(OutputStream stream)
Creates a new
SemEvalReporter . |
Modifier and Type | Method and Description |
---|---|
void |
assignContextToKey(String primaryKey,
String secondaryKey,
int contextId)
Records a contexts identifier for an instance of
primaryKey . |
String[] |
contextLabels(String primaryKey)
Returns the secondary keys assigned to this
primaryKey based on
their associated context ids. |
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 SemEvalReporter(OutputStream stream)
SemEvalReporter
.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)
primaryKey
. The
identifies recorded aresecondaryKey
and contextId
.
secondaryKey
can be any string. contextId
can should be
between 0 and the total number of contexts that will be observed, i.e.
contexts for a single primaryKey
simply get idsj based on the
order in which they are processed.assignContextToKey
in interface AssignmentReporter
public String[] contextLabels(String primaryKey)
primaryKey
based on
their associated context ids. This list can be used if a Wordsi
algorithm needs to report it's clustering assignments. Reporting
SenseEval/SemEval or Pseudo Word Disambiguation assignments are two good
use cases which require this functionality.contextLabels
in interface AssignmentReporter
Copyright © 2012. All Rights Reserved.