Last active
January 24, 2020 06:15
-
-
Save re4388/7168df37b89830fc7b6b4b828e1ad622 to your computer and use it in GitHub Desktop.
universal-sentence-encoder-classfier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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