I have been looking at the NER example with Trax in this notebook. However, the notebook only gives an example for training the model. I can't find any examples of how to use this model to extract entities from a new string of text.
I've tried the following:
- Instantiate the model in 'predict' mode. When trying this I get the same error reported in https://github.com/google/trax/issues/556
AssertionError: In call to configurable 'SelfAttention' (<class 'trax.layers.research.efficient_attention.SelfAttention'>)
- Instantiate the model in 'eval' mode and then running
model(sentence)
as I would with other models. In this case the instantiation works but I get the following error when running the model:TypeError: Serial.forward input must be a tuple or list; instead got <class 'numpy.ndarray'>
. Presumably this is because in 'eval' mode the model needs 2 entries passed in rather than one sentence
How can I use this Reformer to extract entities from a new sentence?