def embed_text()

in text-semantic-search/embeddings_extraction/etl/pipeline.py [0:0]


def embed_text(text):
  import tensorflow_hub as hub
  global encoder
  if encoder is None:
    encoder = hub.Module(
      'https://tfhub.dev/google/universal-sentence-encoder/2')
  embedding = encoder(text)
  return embedding