<jupyter_start><jupyter_text>Tensorflow Hub Reference: https://www.tensorflow.org/hub/Tensorflow hub is a library for reusable machine learning modeules in tensorflow. A module is a self-contained piece of a Tensorflow graph, along with its weights, that can be reused across other, similar tasks. By reusing the module, a developer can train a model using a smaller dataset, improve generalization, or simply speed up the training.Here we demo several topics using pretrained modules from tensorflow hub.* Image Retraining* Word Embedding* Universal Sentence EncoderDownload ```shcurl -L "https://tfhub.dev/google/universal-sentence-encoder/2?tf-hub-format=compressed" | tar -zxvC /tmp/moduleA```  Word Embedding<jupyter_code>with tf.Graph().as_default():
    module_url = "https://tfhub.dev/google/nnlm-en-dim128-with-normalization/1"
    embed = hub.Module(module_url)
    embeddings = embed(["A long sentence.", "single-word"])

    with tf.Session() as sess:
        sess.run(tf.global_variables_initializer())
        sess.run(tf.tables_initializer())

        data = sess.run(embeddings)
        print(data)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10227272727272728, 'fraction_numerical': 0.004370629370629371, 'mean_word_length': 4.585365853658536, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '636405', 'license': 'MIT', 'n_tokens_mistral': 346, 'n_tokens_neox': 330, 'n_words': 103, 'path': 'deep_learning/time_series_sequences/tfhub_word_embedding.ipynb', 'repo_name': 'jiankaiwang/sophia.ml', 'size': '1144'}