!pip install --upgrade tensorflow_hub import tensorflow_hub as hub model = hub.KerasLayer("https://tfhub.dev/google/nnlm-en-dim128/2") embeddings = model(["The rain in Spain.", "falls", "mainly", "In the plain!"]) print(embeddings.shape) #(4,128)
TensorFlow Hub is a repository of trained machine learning models ready for fine-tuning and deployable anywhere. Reuse trained models like BERT and Faster R-CNN with just a few lines of code.
Use the Faster R-CNN Inception ResNet V2 640x640 model for detecting objects in images.
Learn how you can use TensorFlow Hub to build ML solutions with real world impact.
To explore ML solutions for your mobile and web apps including TensorFlow Hub, visit the Google on-device machine learning page.
TensorFlow Hub makes BERT simple to use with new preprocessing models.