Class SuggestionsChanges
java.lang.Object
org.languagetool.rules.spelling.suggestions.SuggestionsChanges
Helper class for SuggestionChangesTest, tracks experiment configuration and results
Rules should use getInstance() != null -> getInstance().getCurrentExperiment() in constructors to fetch relevant parameters
Use isRunningExperiment if no parameters are needed
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentMap<SuggestionChangesExperiment,
Long> private final SuggestionChangesTestConfig
private final ConcurrentMap<SuggestionChangesExperiment,
Integer> private SuggestionChangesExperiment
private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,
SuggestionChangesDataset>, Long> private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,
SuggestionChangesDataset>, Integer> private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,
SuggestionChangesDataset>, Integer> private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,
SuggestionChangesDataset>, Integer> private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,
SuggestionChangesDataset>, Integer> private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,
SuggestionChangesDataset>, Integer> private final List<SuggestionChangesExperiment>
private static SuggestionsChanges
private final ConcurrentMap<SuggestionChangesExperiment,
Integer> private final ConcurrentMap<SuggestionChangesExperiment,
Integer> private final ConcurrentMap<SuggestionChangesExperiment,
Integer> private final ConcurrentMap<SuggestionChangesExperiment,
Integer> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
SuggestionsChanges
(SuggestionChangesTestConfig config, BufferedWriter reportWriter) -
Method Summary
Modifier and TypeMethodDescriptionprivate List<SuggestionChangesExperiment>
generateExperiments
(List<SuggestionChangesExperimentRuns> experimentSpecs) @Nullable SuggestionChangesExperiment
static @Nullable SuggestionsChanges
null if nothing is configured, i.e.(package private) static void
init
(@NotNull SuggestionChangesTestConfig config, @Nullable BufferedWriter reportWriter) static boolean
isRunningExperiment
(String name) void
setCurrentExperiment
(@Nullable SuggestionChangesExperiment experiment) For testing changes to suggestion ordering using a data corpus; iterate over experiments (including grid search for parameters) original behavior (for A/B testing) can be modeled by an experiment without parameters and an arbitrary namevoid
trackExperimentResult
(org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment, SuggestionChangesDataset> source, int position, int resultTextSize, long resultComputationTime)
-
Field Details
-
instance
-
config
-
experiments
-
correctSuggestions
-
notFoundSuggestions
-
suggestionPosSum
-
textSize
-
computationTime
-
numSamples
-
datasetCorrectSuggestions
private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,SuggestionChangesDataset>, datasetCorrectSuggestionsInteger> -
datasetNotFoundSuggestions
private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,SuggestionChangesDataset>, datasetNotFoundSuggestionsInteger> -
datasetSuggestionPosSum
private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,SuggestionChangesDataset>, datasetSuggestionPosSumInteger> -
datasetNumSamples
private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,SuggestionChangesDataset>, datasetNumSamplesInteger> -
datasetTextSize
private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,SuggestionChangesDataset>, datasetTextSizeInteger> -
datasetComputationTime
private final ConcurrentMap<org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment,SuggestionChangesDataset>, datasetComputationTimeLong> -
currentExperiment
-
-
Constructor Details
-
SuggestionsChanges
-
-
Method Details
-
getInstance
null if nothing is configured, i.e. in most normal use cases -
init
static void init(@NotNull @NotNull SuggestionChangesTestConfig config, @Nullable @Nullable BufferedWriter reportWriter) -
gridsearch
-
generateExperiments
private List<SuggestionChangesExperiment> generateExperiments(List<SuggestionChangesExperimentRuns> experimentSpecs) -
getConfig
-
getCurrentExperiment
-
setCurrentExperiment
For testing changes to suggestion ordering using a data corpus; iterate over experiments (including grid search for parameters) original behavior (for A/B testing) can be modeled by an experiment without parameters and an arbitrary name -
isRunningExperiment
-
trackExperimentResult
public void trackExperimentResult(org.apache.commons.lang3.tuple.Pair<SuggestionChangesExperiment, SuggestionChangesDataset> source, int position, int resultTextSize, long resultComputationTime) -
getExperiments
-