Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- test = [hey how you doing?, did you eat? , how was your day?, the car looks so new, the bike is mine,......]
- tf.logging.set_verbosity(tf.logging.ERROR)
- with tf.Session() as session:
- session.run([tf.global_variables_initializer(),
- tf.tables_initializer()])
- message_embeddings = session.run(embed(test))
- import multiprocessing as mp
- pool = mp.Pool(mp.cpu_count())
- def embed(row):
- tf.logging.set_verbosity(tf.logging.ERROR)
- with tf.Session() as session:
- session.run([tf.global_variables_initializer(),
- tf.tables_initializer()])
- message_embeddings = session.run(embed(row))
- return(message_embeddings)
- result = pool.map(embed, [row for row in test])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement