Skip to content

Commit

Permalink
Remove typing_correction_enable_number_decoder flag.
Browse files Browse the repository at this point in the history
This flag is set true by default.

PiperOrigin-RevId: 681269488
  • Loading branch information
taku910 authored and hiroyuki-komatsu committed Oct 2, 2024
1 parent 032535d commit 269a246
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
7 changes: 0 additions & 7 deletions src/prediction/dictionary_prediction_aggregator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1713,13 +1713,6 @@ void DictionaryPredictionAggregator::AggregateTypingCorrectedPrediction(

// Populates number when number candidate is not added.
bool number_added = base_selected_types & NUMBER;
if (!request.request()
.decoder_experiment_params()
.typing_correction_enable_number_decoder()) {
// disables number decoder by assuming that number candidate
// is already added.
number_added = true;
}

for (const auto &query : queries) {
absl::string_view key = query.correction;
Expand Down
14 changes: 0 additions & 14 deletions src/prediction/dictionary_prediction_aggregator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2200,9 +2200,6 @@ TEST_F(DictionaryPredictionAggregatorTest,

config_->set_use_typing_correction(true);

request_->mutable_decoder_experiment_params()
->set_typing_correction_enable_number_decoder(true);

Segments segments;
SetUpInputForSuggestionWithHistory("にしゆうこ", "", "", composer_.get(),
&segments);
Expand All @@ -2216,23 +2213,12 @@ TEST_F(DictionaryPredictionAggregatorTest,

data_and_aggregator->set_supplemental_model(mock.get());

request_->mutable_decoder_experiment_params()
->set_typing_correction_enable_number_decoder(false);
std::vector<Result> results;
aggregator.AggregateTypingCorrectedPrediction(*prediction_convreq_, segments,
&results);
EXPECT_EQ(results.size(), 1);

request_->mutable_decoder_experiment_params()
->set_typing_correction_enable_number_decoder(true);
results.clear();
aggregator.AggregateTypingCorrectedPrediction(*prediction_convreq_, segments,
&results);
EXPECT_EQ(results.size(), 2);
EXPECT_EQ(results[1].value, "25"); // default is full width.

request_->mutable_decoder_experiment_params()
->set_typing_correction_enable_number_decoder(false);
data_and_aggregator->set_supplemental_model(nullptr);
}

Expand Down
3 changes: 0 additions & 3 deletions src/protocol/commands.proto
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,6 @@ message DecoderExperimentParams {
// Bitmap of enabled variation character types.
optional uint32 variation_character_types = 8 [default = 0];

// Applies the number decoder to the output of typing corrector
optional bool typing_correction_enable_number_decoder = 89 [default = false];

// Enables final results reranking against literal results.
// If zero, the previous implementation is used.
optional int32 typing_correction_result_reranker_mode = 95 [default = 0];
Expand Down

0 comments on commit 269a246

Please sign in to comment.