Commit 6df15d1f authored by Li Lin's avatar Li Lin Committed by Commit Bot

Pass lower case text to text annotator.

There is a issue with text classifier that some capitalized words are not
annotated properly. Convert the text to lower case for now.

Bug: b/159756246
Test: manual test
Change-Id: I66d355f503890a2b1d3c183853210fb1fd4aa8a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2261818Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Reviewed-by: default avatarYue Li <updowndota@chromium.org>
Commit-Queue: Li Lin <llin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782080}
parent 4d17989b
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <map> #include <map>
#include "base/i18n/case_conversion.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chromeos/components/quick_answers/quick_answers_model.h" #include "chromeos/components/quick_answers/quick_answers_model.h"
...@@ -118,7 +119,12 @@ void IntentGenerator::LoadModelCallback(const QuickAnswersRequest& request, ...@@ -118,7 +119,12 @@ void IntentGenerator::LoadModelCallback(const QuickAnswersRequest& request,
if (text_classifier_) { if (text_classifier_) {
TextAnnotationRequestPtr text_annotation_request = TextAnnotationRequestPtr text_annotation_request =
machine_learning::mojom::TextAnnotationRequest::New(); machine_learning::mojom::TextAnnotationRequest::New();
text_annotation_request->text = request.selected_text;
// TODO(b/159664194): There is a issue with text classifier that some
// capitalized words are not annotated properly. Convert the text to lower
// case for now. Clean up after the issue is fixed.
text_annotation_request->text = base::UTF16ToUTF8(
base::i18n::ToLower(base::UTF8ToUTF16(request.selected_text)));
text_annotation_request->default_locales = text_annotation_request->default_locales =
request.context.device_properties.language; request.context.device_properties.language;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment