Skip to content

Instantly share code, notes, and snippets.

@re4388
Last active January 24, 2020 06:15
Show Gist options
  • Save re4388/7168df37b89830fc7b6b4b828e1ad622 to your computer and use it in GitHub Desktop.
Save re4388/7168df37b89830fc7b6b4b828e1ad622 to your computer and use it in GitHub Desktop.
universal-sentence-encoder-classfier
!pip3 install --quiet "tensorflow>=1.7"
!pip3 install --quiet tensorflow-hub
!pip3 install seaborn
import tensorflow as tf
import tensorflow_hub as hub
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import re
import seaborn as sns
import keras.layers as layers
from keras.models import Model
from keras import backend as K
np.random.seed(10)
import matplotlib.pyplot as plt
plt.style.use('ggplot')
module_url = "https://tfhub.dev/google/universal-sentence-encoder-large/3"
embed = hub.Module(module_url)
embed_size = embed.get_output_info_dict()['default'].get_shape()[1].value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment