<commit_before>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<h1>Using pre-trained embeddings with TensorFlow Hub</h1>\n",
    "\n",
    "This notebook illustrates:\n",
    "<ol>\n",
    "    <li>How to instantiate a TensorFlow Hub module</li>\n",
    "    <li>How to find pre-trained TensorFlow Hub modules for a variety of purposes</li>\n",
    "    <li>How to examine the embeddings of a Hub module</li>\n",
    "    <li>How one Hub module composes representations of sentences from individual words</li>\n",
    "    <li>How to assess word embeddings using a semantic similarity test</li>\n",
    "</ol>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Install the TensorFlow Hub library"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install -q tensorflow-hub\n",
    "!pip install -q -upgrade tensorflow"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Make sure to restart your notebook's kernel before proceeding further."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "import tensorflow_hub as hub\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import os\n",
    "import re\n",
    "import seaborn as sns\n",
    "import scipy\n",
    "import math"
   ]
  },
  {<commit_msg>Adding - to pip upgrade in reusable embeddings lab<commit_after>{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<h1>Using pre-trained embeddings with TensorFlow Hub</h1>\n",
    "\n",
    "This notebook illustrates:\n",
    "<ol>\n",
    "    <li>How to instantiate a TensorFlow Hub module</li>\n",
    "    <li>How to find pre-trained TensorFlow Hub modules for a variety of purposes</li>\n",
    "    <li>How to examine the embeddings of a Hub module</li>\n",
    "    <li>How one Hub module composes representations of sentences from individual words</li>\n",
    "    <li>How to assess word embeddings using a semantic similarity test</li>\n",
    "</ol>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Install the TensorFlow Hub library"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "!pip install -q tensorflow-hub\n",
    "!pip install -q --upgrade tensorflow"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Make sure to restart your notebook's kernel before proceeding further."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "import tensorflow_hub as hub\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import os\n",
    "import re\n",
    "import seaborn as sns\n",
    "import scipy\n",
    "import math"
   ]
  },
  {
{'fraction_non_alphanumeric': 0.16945876288659795, 'fraction_numerical': 0.002577319587628866, 'mean_word_length': 2.665879574970484, 'pattern_counts': {'":': 40, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7394246', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1055, 'n_words': 297}