I'm porting an image prediction code I have in python to node js using tensorflowjs.
The part of exporting the model for tensorflowjs to load was ok.
the prediction is being done successfully, as a result I get an array with the possibilities.
With this array in Python I would do the following:
`characters = ['1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
characters = sorted(list(characters))
char_to_num = layers.StringLookup( vocabulary=list(characters), mask_token=None )
num_to_char = layers.StringLookup( vocabulary=char_to_num.get_vocabulary(), mask_token=None, invert=True )
` output_text = [0]
for res in results: res = tf.strings.reduce_join(num_to_char(res)).numpy().decode("utf-8") output_text.append(res)
return output_text
`
My doubt is, how do I write the function "layers.StringLookup" in nodejs with tensorflowjs or keras js ?