make tclib use the vocab based model.

Modify the model.fbs needs a bit update because it is needed to fix
the memory misalignment issue detected by ubasan. It is compiled from
the code in cl/339531379

BUG=b:169370175,chromium:1121403
TEST=unit test on nocturne

Cq-Depend: 2493741
Change-Id: Ie2937b8c4030d12100055cc40d35c130e5b42180
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/libtextclassifier/+/2493581
Reviewed-by: Andrew Moylan <amoylan@chromium.org>
Reviewed-by: Honglin Yu <honglinyu@chromium.org>
Commit-Queue: Honglin Yu <honglinyu@chromium.org>
Tested-by: Honglin Yu <honglinyu@chromium.org>
2 files changed
tree: 2c3e608ec12f807fd8b085b39a94facd459cb406
  1. annotator/
  2. lang_id/
  3. utils/
  4. BUILD.gn
  5. CONTRIBUTING.md
  6. LICENSE
  7. OWNERS
  8. README.md
README.md

libtextclassifier

A library for on-device text classification (address, telephone number, emails etc.).

Usage in Chrome OS

To use libtextclassifier, one also needs to install a flatbuffer model defined in “model.fbs”. For simplicity, this model file will be installed in the ebuild of ml-service.

And libtextclassifier currently depends on the chrome-icu package which requires explicitly initializing the icu data, just like chrome.

The ml-service is currently the only user of this library. If another library in Chrome OS also wants to use it, please let the owners of ml-service and libtextclassifier know because then,

  1. we need to make libtextclassifier into a shared library to save space;
  2. we may also need to move the installation of libtextclassifier‘s model file into libtextclassifier’s ebuild.