Package org.tribuo.sequence
Class SequenceModelExplorer
java.lang.Object
org.tribuo.sequence.SequenceModelExplorer
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.command.CommandGroup
public class SequenceModelExplorer
extends Object
implements com.oracle.labs.mlrg.olcut.command.CommandGroup
A CLI for interacting with a
SequenceModel
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Command line options. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfeatureInfo
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, String featureName) Shows information on a particular feature.org.jline.reader.Completer[]
Completers for files.getName()
Loads a model.static void
Runs the sequence model explorer.minCount
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, int minCount) Shows the number of features which occurred more than minCount times in the training data.modelDescription
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Shows the model description.numFeatures
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Shows the number of features in this model.outputInfo
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Shows the output information.void
Start the command shelltopFeatures
(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, int numFeatures) Shows the top n features in this model.
-
Constructor Details
-
SequenceModelExplorer
public SequenceModelExplorer()Builds a sequence model explorer shell.
-
-
Method Details
-
getName
- Specified by:
getName
in interfacecom.oracle.labs.mlrg.olcut.command.CommandGroup
-
getDescription
- Specified by:
getDescription
in interfacecom.oracle.labs.mlrg.olcut.command.CommandGroup
-
fileCompleter
public org.jline.reader.Completer[] fileCompleter()Completers for files.- Returns:
- The completers for file commands.
-
startShell
public void startShell()Start the command shell -
loadModel
@Command(usage="<filename> <is-protobuf-format> - Load a model from disk.", completers="fileCompleter") public String loadModel(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, File path, boolean protobuf) Loads a model.- Parameters:
ci
- The shell instance.path
- The path to load.protobuf
- Load in a protobuf format model.- Returns:
- A status string.
-
modelDescription
@Command(usage="Shows the model description") public String modelDescription(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Shows the model description.- Parameters:
ci
- The command interpreter.- Returns:
- The model description.
-
featureInfo
@Command(usage="Shows the information on a particular feature") public String featureInfo(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, String featureName) Shows information on a particular feature.- Parameters:
ci
- The command interpreter.featureName
- The feature name.- Returns:
- The feature information.
-
outputInfo
@Command(usage="Shows the output information.") public String outputInfo(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Shows the output information.- Parameters:
ci
- The command interpreter.- Returns:
- The output information.
-
topFeatures
@Command(usage="<int> - Shows the top N features in the model") public String topFeatures(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, int numFeatures) Shows the top n features in this model.- Parameters:
ci
- The command interpreter.numFeatures
- The number of features to display.- Returns:
- The top features.
-
numFeatures
@Command(usage="Shows the number of features in the model") public String numFeatures(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci) Shows the number of features in this model.- Parameters:
ci
- The command interpreter.- Returns:
- The number of features.
-
minCount
@Command(usage="<min count> - Shows the number of features that occurred more than min count times.") public String minCount(com.oracle.labs.mlrg.olcut.command.CommandInterpreter ci, int minCount) Shows the number of features which occurred more than minCount times in the training data.- Parameters:
ci
- The command interpreter.minCount
- The minimum occurrence count.- Returns:
- The number of features which occurred more than minCount times.
-
main
Runs the sequence model explorer.- Parameters:
args
- CLI arguments.
-