MCPcopy Create free account
hub / github.com/google-research/language / __init__

Method __init__

language/realm/retrieval.py:297–309  ·  view source on GitHub ↗

Constructs the DocumentEmbedder.

(self, hub_module_spec, featurizer, use_tpu, run_config=None)

Source from the content-addressed store, hash-verified

295 """
296
297 def __init__(self, hub_module_spec, featurizer, use_tpu, run_config=None):
298 """Constructs the DocumentEmbedder."""
299 if run_config is None:
300 if use_tpu:
301 raise ValueError('Must supply a RunConfig if use_tpu.')
302 else:
303 run_config = tf_estimator.tpu.RunConfig() # Just supply a default.
304
305 self._hub_module_spec = hub_module_spec
306 self._featurizer = featurizer
307 self._use_tpu = use_tpu
308 self._run_config = run_config
309 self._log_interval = 10 # When embedding, log every 10 seconds.
310
311 def embed(self, get_documents_dataset, total_docs, batch_size):
312 """Embeds a Dataset of documents using Estimator.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected