keras-team / keras-hub

Pretrained model hub for Keras 3
Apache License 2.0
790 stars 242 forks source link

Scope `BertTokenClassifier` task model and supporting infra #624

Open jbischof opened 1 year ago

jbischof commented 1 year ago

BertClassifier supports one output for the entire input sequence, but per-token classification is important for applications such as POS and NER tagging. This will require some scoping and design:

  1. Do we need a separate BertTokenClassifierPreprocessor or is just passing a label tensor the same length as the input enough?
  2. Do we want to offer a script that can turn a standard dataset like conll03 into something our preprocessor can use? In general most token labels are for "words" and not the subword tokens created by WordPiece/SentencePiece.
  3. Create a BertTokenClassifier task model with the correct task-specific layers and preprocessing.
ADITYADAS1999 commented 1 year ago

hey jbischof this issue is still open for contributors?

jbischof commented 1 year ago

@ADITYADAS1999 anything tagged with "scoping required" means that we don't know how to do it yet unfortunately! However, if you are super interested in token classification you could prototype it for us in a keras.io example. Let me know if that's interesting to you.

ADITYADAS1999 commented 1 year ago

@ADITYADAS1999 anything tagged with "scoping required" means that we don't know how to do it yet unfortunately! However, if you are super interested in token classification you could prototype it for us in a keras.io example. Let me know if that's interesting to you.

thanks for informing jbischof. So this are all ideas but not implemented.

jbischof commented 1 year ago

Yes @ADITYADAS1999, anything tagged "scoping required" means we want to do it but we don't know how. We generally save these for ourselves because it's a big ask for contributors to design our API.

shivance commented 1 year ago

Hi I've linked a colab with prototype of alignment preprocessor in #754, should help in scoping. Thoughts @mattdangerw @chenmoneygithub ?