Skip to content

Instantly share code, notes, and snippets.

@hamletbatista
Last active August 18, 2020 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamletbatista/e7641ebcbaeea432eb14061a9c3babe9 to your computer and use it in GitHub Desktop.
Save hamletbatista/e7641ebcbaeea432eb14061a9c3babe9 to your computer and use it in GitHub Desktop.
# Here we combine both lists into a single set of unique phrases
messages = set(df_404s["phrase"].to_list() + df_canonicals["phrase"].to_list())
messages = list(messages)[:-1]
similarity_input_placeholder = tf.placeholder(tf.string, shape=(None))
similarity_message_encodings = embed(similarity_input_placeholder)
with tf.Session() as session:
session.run(tf.global_variables_initializer())
session.run(tf.tables_initializer())
# We are truncating the messages list to 15 to simplify the visualization
run_and_plot(session, similarity_input_placeholder, messages[:15],
similarity_message_encodings)
@s0g00d
Copy link

s0g00d commented Aug 13, 2020

AttributeError: module 'tensorflow' has no attribute 'placeholder'

@hamletbatista
Copy link
Author

@s0g00d try tensorflow 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment