|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.combi.CombinationStrategy
de.fu_berlin.ties.combi.InsideOutsideStrategy
public class InsideOutsideStrategy
A combination strategy using inside/outside tagging. Classes are prefixed with "I-" (in this class) or "B-" (begin of a new instance of this class), "A" is used for anything else/outside of any class.
CombinationState.isEnd()
is not
supported by this class and will always return false
.
Field Summary |
---|
Fields inherited from class de.fu_berlin.ties.combi.CombinationStrategy |
---|
CONFIG_COMBINATION |
Constructor Summary | |
---|---|
InsideOutsideStrategy(Set<String> theClasses)
Creates a new instance, using "O/I/B" mode: the "B-" is only used where required for disambiguation, otherwise the "I-" prefix is used. |
|
InsideOutsideStrategy(Set<String> theClasses,
boolean bStartingAllClasses)
Creates a new instance, using "O/I/B" mode (setting isBStartingAll() to false ). |
Method Summary | |
---|---|
Set<String>[] |
activeClasses()
Builds a set of class names (Strings) to pass to the classifier to consider for the next decision. |
Set<String>[] |
allClasses()
Returns an array of immutable sets of all classes (Strings) that can possible occur during classification for each classifier. |
boolean |
isBStartingAll()
Whether the "B-" prefix is used for the first item of each instance ("O/B/I" mode) or only for the first item of instances immediately following an instance of the same class ("O/I/B" mode). |
String |
toString()
Returns a string representation of this object. |
String[] |
translateCurrentState(CombinationState currentState)
Translates an expected class to a class name to feed to the classifiers in training mode. |
CombinationState |
translateResult(PredictionDistribution[] predictions)
Translates the classes predicted by the classifiers in a decision for the caller. |
Methods inherited from class de.fu_berlin.ties.combi.CombinationStrategy |
---|
createStrategy, createStrategy, getValidClasses, reset, resetHook, state, updateState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InsideOutsideStrategy(Set<String> theClasses)
theClasses
- a set of valid class names (String)public InsideOutsideStrategy(Set<String> theClasses, boolean bStartingAllClasses)
isBStartingAll()
to false
). In this mode, the "B-"
is only used where required for disambiguation, otherwise the "I-" prefix
is used.
theClasses
- a set of valid class names (String)bStartingAllClasses
- if true
, the "B-" prefix is used
for the first item of each instance ("O/B/I" mode); otherwise it is used
only for first item of instances immediately following an instance of the
same class ("O/I/B" mode)Method Detail |
---|
public Set<String>[] activeClasses()
SortedSet
).
activeClasses
in class CombinationStrategy
public Set<String>[] allClasses()
allClasses
in class CombinationStrategy
public boolean isBStartingAll()
public String[] translateCurrentState(CombinationState currentState) throws IllegalArgumentException
CombinationStrategy.translateResult(PredictionDistribution[])
.
The return value can be feed to the classifiers for training it.
translateCurrentState
in class CombinationStrategy
currentState
- the current state
IllegalArgumentException
- if the specified argument is invalid
(non-empty string that is not in the set of valid classes, or empty
string when null
was given in the preceding call)public CombinationState translateResult(PredictionDistribution[] predictions) throws IllegalArgumentException
translateResult
in class CombinationStrategy
predictions
- array containing the prediction distributions of
all classifier
IllegalArgumentException
- if the specified argument was invalid
(not in the set of currently active classes
public String toString()
toString
in class CombinationStrategy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |