Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/google-research/language
/ functions
Functions
6,154 in github.com/google-research/language
⨍
Functions
6,154
◇
Types & classes
800
↳
Endpoints
12
Function
apply_target
Return target string with non-terminals replaced with substitutions.
language/compgen/nqg/model/qcfg/qcfg_rule.py:92
Method
approx_vocab_size
(self)
language/labs/consistent_zero_shot_nmt/data_generators/translate_multilingual.py:56
Method
as_domain_sym
(entity_id)
language/nql/nql/__init__.py:712
Method
as_fixed_length_tensor
(seq, seq_len)
language/realm/featurization.py:303
Method
as_pprintable
(v)
language/nql/nql/__init__.py:1925
Method
as_range_sym
(entity_id)
language/nql/nql/__init__.py:715
Method
as_weighted_triples
Make the value of a SparseTensor for a relation human-readable. The human-readable format is a dictionary mapping tuples of strings (rel_name
language/nql/nql/__init__.py:696
Function
assert_same
Assert that both structures are equivalent. This function is more strict than tf.nest.assert_same_structure since it also requires that Tensors h
language/common/utils/nest_utils.py:137
Function
assert_shape_match
(inp, out)
language/labs/consistent_zero_shot_nmt/utils/model_utils.py:185
Function
assert_shapes_match
(decode_steps_a, decode_steps_b)
language/xsp/model/decode_utils.py:157
Method
assign_weights
Assign weights from checkpoint to model.
language/search_agents/muzero/transformer_encoder.py:254
Method
at_most_k_cells_north
(k, c)
language/nql/nql/nql_test.py:486
Function
attention
Multihead dot-product attention. Args: query_antecedent: <float>[batch_size, query_length, query_emb_size] memory_antecedent: <float>[batch
language/xsp/model/common_layers.py:315
Function
attention_bias_ignore_padding
Create a bias tensor to be added to attention logits. Out-of-range elements will have an effective negative-infinity value. Args: source_len
language/xsp/model/common_layers.py:365
Function
attention_bias_lower_triangle
Create a bias tensor to be added to attention logits. Masked elements will have an effective negative-infinity value. Args: length: Integer
language/xsp/model/common_layers.py:344
Function
augment_exemplars
Generates (input, output) pair where the input is retrieval-augmented. Args: example: Original RawExample. exemplars: List of exemplars to
language/casper/augment/casper_formatters.py:263
Function
basic_decoder
Decoder. Args: features: Dictionary of input Tensors. mode: train or eval. Keys from tf.estimator.ModeKeys. vocab: A list of strings of
language/labs/exemplar_decoding/models/hypernet.py:305
Function
basic_decoder
Decoder. Args: features: Dictionary of input Tensors. mode: train or eval. Keys from tf.estimator.ModeKeys. vocab: A list of strings of
language/labs/exemplar_decoding/models/baselines.py:228
Function
basic_gnmt_bahdanau_att_multi
Hparams for LSTM with bahdanau attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:350
Function
basic_gnmt_luong_att_multi
Hparams for LSTM with luong attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:358
Function
basic_nmt_bilstm_bahdanau_att_multi
Hparams for LSTM with bahdanau attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:296
Function
basic_nmt_bilstm_luong_att_multi
Hparams for LSTM with luong attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:304
Function
batch_boolean_mask
Get indices of true values. Args: mask: [batch_size, num_values] Returns: true_indices: [batch_size, max_true] gathered_mask: [batch
language/labs/exemplar_decoding/utils/tensor_utils.py:54
Function
batch_gather
Gather indices into any dimension rather than dimension 0 of a tensor. Gathering is usually performed on dimension 0 of a tensor, such as a word
language/labs/exemplar_decoding/utils/tensor_utils.py:112
Method
batch_size
(self)
language/labs/exemplar_decoding/models/attention.py:200
Function
beam_decoder
Beam search decoder. Args: features: Dictionary of input Tensors. mode: train or eval. Keys from tf.estimator.ModeKeys. vocab: A list o
language/labs/exemplar_decoding/models/hypernet.py:478
Function
beam_decoder
Beam search decoder. Args: features: Dictionary of input Tensors. mode: train or eval. Keys from tf.estimator.ModeKeys. vocab: A list o
language/labs/exemplar_decoding/models/baselines.py:397
Function
beam_search
Beam search for transformer machine translation. Args: inputs: array: [batch_size, length] int32 sequence of tokens. cache: flax attention
language/gscan/xattn_model/model/decode.py:170
Function
beam_search
Beam search with length penalties. Requires a function that can take the currently decoded sybmols and return the logits for the next symbol. The
language/xsp/model/beam_search.py:282
Function
beam_search_decode
Decode for a given number of steps.
language/capwap/utils/transformer_utils.py:553
Function
beam_search_loop_body_fn
Beam search loop state update function.
language/gscan/xattn_model/model/decode.py:230
Function
beam_search_loop_cond_fn
Beam search loop termination condition.
language/gscan/xattn_model/model/decode.py:207
Function
bert_preprocess
Pre-processes a text tuple into BERT format. Args: text_segments (Tensor): 1-D Tensor of un-tokenized text segments (string). These will
language/conpono/reconstruct/preprocess.py:477
Function
bert_tokens_to_words
Maps word-pieces to the full word they are a part of. Given a word-piece tokenized sequence, returns a sequence of the same length which, at posi
language/search_agents/muzero/utils.py:197
Function
best_export_path
(model_dir, best_prefix="best")
language/common/utils/export_utils.py:59
Function
body
A decoding step.
language/capwap/synthetic/generate_questions.py:275
Method
body
(self, features)
language/labs/consistent_zero_shot_nmt/models/agreement.py:347
Method
body
(self, features)
language/labs/consistent_zero_shot_nmt/models/agreement.py:500
Method
body
Process features and produce outputs.
language/labs/consistent_zero_shot_nmt/models/basic.py:172
Function
books_pipeline
Read Books Corpus filenames and create Beam pipeline.
language/conpono/cpc/preproc/books_preproc_pipeline.py:205
Function
books_pipeline
Read Books Corpus filenames and create Beam pipeline.
language/conpono/create_pretrain_data/books_preproc_pipeline.py:155
Function
boolean_mask
Select elements from tensor where mask is True, and pads the rest with 0. Example: tensor = [1 2 3 4 5 6 7] mask = [T T F F T T T] ou
language/capwap/utils/tensor_utils.py:24
Method
bottom
Transforms features to feed into body. Ensures that all language tags are transformed using input modality. Args: features: dict of st
language/labs/consistent_zero_shot_nmt/models/basic.py:44
Function
bucket_by_quantiles
Dynamically bucket a `tf.data.Dataset` based on the element's length. Keeps track of a histogram of the input elements lengths, and yields batches
language/boolq/utils/ops.py:128
Function
bucket_fn
Compute the element bucket and update the histogram.
language/boolq/utils/ops.py:169
Method
build
(self, input_shape)
language/labs/exemplar_decoding/models/linear.py:199
Method
build
Parameter variables are already constructed in __init__. This function should never be called and aims only to keep consistency.
language/labs/exemplar_decoding/models/hyperlstm.py:309
Method
build
(self, input_shape)
language/serene/layers.py:172
Function
build_bidirectional_rnn
Builds sequences encoded with a bidirectional RNN.
language/labs/consistent_zero_shot_nmt/utils/model_utils.py:345
Function
build_count_matrix
Build a sparse matrix of size ngrams to doc ids with counts.
language/labs/drkit/search_utils.py:46
Method
build_encoder_fn
Function to be called by tf.data.Dataset.map from TFDS to encoder input. For example, the encoder will probably want to take the text input,
language/serene/preprocessing.py:142
Method
build_encoder_fn
(self)
language/serene/preprocessing.py:347
Function
build_feature_dict_mapper
Build a function for tf.data.Dataset.map. Args: feature_names: List of feature names. Returns: A function converting tuples into (dictio
language/nql/nql/dataset.py:248
Function
build_logits
Builds logits for sequences and a given modality.
language/labs/consistent_zero_shot_nmt/utils/model_utils.py:425
Function
build_model
Wrapper around for Decomposable Attention model for NQ long answer scoring. Args: question_tok_wid: <int32> [batch_size, question_len] ques
language/question_answering/decatt_docreader/models/nq_long_decatt_model.py:208
Function
build_model_fn
Builds model function based on model_config.
language/xsp/model/model_builder.py:50
Function
build_planner_inputs
Convert text to TextInputs for conditional text planner. Args: question: <string>, space-separated token string. answer: <string>, space-se
language/capwap/utils/text_utils.py:297
Function
build_question_starter_vocab
Build a vocab of first word question tokens.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py:43
Function
build_question_starter_vocab_boolq
Build a vocab of first word question tokens.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py:64
Function
build_text_inputs
Convert text to TextInputs. Args: text: <string>, space-separated token string. length: Length to pad or truncate to. lookup_table: Ins
language/capwap/utils/text_utils.py:249
Function
build_thief_vocab
Return unigram freqs of thief dataset used for building random paras.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py:83
Function
build_train_op
Creates the training operation.
language/xsp/model/adam_weight_decay.py:255
Function
build_train_op_with_pretraining
(loss, model_config, pretrained_variable_names, use_tpu)
language/xsp/model/adam_weight_decay.py:267
Function
build_unidirectional_rnn
Builds sequences encoded with a unidirectional RNN.
language/labs/consistent_zero_shot_nmt/utils/model_utils.py:320
Function
build_vocab
find all words in input corpus to build a vocabulary.
language/bert_extraction/steal_bert_classifier/data_generation/preprocess_util.py:29
Function
bytes_feature_list
(values)
language/capwap/utils/io_utils.py:67
Function
calculate_metrics
Computes metrics for the scored_annotations for each subset. Standard subsets can include all of the data, only the true positives labeled by the
language/diffqg/metrics.py:368
Method
call
(self, inputs)
language/labs/exemplar_decoding/models/linear.py:258
Method
call
Run the cell and output projection on inputs, starting from state.
language/labs/exemplar_decoding/models/output_wrapper.py:188
Method
call
Run one step of HyperLSTM. Args: inputs: input Tensor, 2D, `[batch, num_units]. state: if `state_is_tuple` is False, this must be a s
language/labs/exemplar_decoding/models/hyperlstm.py:370
Method
call
Perform a step of attention-wrapped RNN. - Step 1: Mix the `inputs` and previous step's `attention` output via `cell_input_fn`. - Step
language/labs/consistent_zero_shot_nmt/modules/attention_wrappers.py:169
Method
call
(self, inputs)
language/serene/layers.py:24
Method
call
(self, inputs, **kwargs)
language/serene/layers.py:103
Method
call
(self, inputs)
language/serene/layers.py:146
Method
call
(self, inputs, **kwargs)
language/serene/layers.py:195
Method
call
(self, inputs, **kwargs)
language/serene/layers.py:209
Method
call
(self, inputs, **kwargs)
language/serene/layers.py:254
Method
call
(self, inputs, **kwargs)
language/serene/layers.py:300
Method
call
(self, inputs, **kwargs)
language/serene/layers.py:359
Method
call
Compute similarity between inputs via product. In tensor size descriptions, ... indicates an arbitrary number of dimensions. For example,
language/serene/layers.py:388
Method
call
(self, y_true, y_pred)
language/serene/losses.py:29
Method
call
(self, y_true, y_pred)
language/serene/losses.py:44
Method
call
Model forward pass. Args: inputs: Input dictionary, dependent on type of embedder used embed_claim: Whether to embed the claim
language/serene/model.py:218
Method
call
Computes scores for a batch of anchored rule applications. Args: wordpiece_encodings: <float>[batch_size, max_num_wordpieces, bert_dims]
language/compgen/nqg/model/parser/nqg_model.py:110
Method
call
Returns scores for a batch of anchored rule applications. Args: wordpiece_ids_batch: <int>[batch_size, max_num_wordpieces] num_wordpi
language/compgen/nqg/model/parser/nqg_model.py:167
Method
call
(self, inputs)
language/nql/nql/__init__.py:1815
Method
call
(self, y_true, y_pred)
language/nql/nql/__init__.py:1829
Method
call
(self, inputs)
language/common/layers/affine_transform.py:54
Function
call_apply_masking
(x)
language/conpono/cpc/run_cc_cpc.py:461
Function
call_apply_masking
(x)
language/conpono/cpc/run_bilin_cpc.py:507
Function
call_get_target_tokens
(x)
language/conpono/cpc/run_cc_cpc.py:452
Function
call_get_target_tokens
(x)
language/conpono/cpc/run_bilin_cpc.py:498
Function
call_sample_mask_indices
(x)
language/conpono/cpc/run_cc_cpc.py:445
Function
call_sample_mask_indices
(x)
language/conpono/cpc/run_bilin_cpc.py:491
Function
can_derive
Return True if `goal_rule` can be derived given `rules`. We perform a relatively naive breadth first search (BFS), with early pruning in cases wh
language/compgen/nqg/model/induction/derivation_utils.py:126
Function
can_parse
Return True if source and target can be derived given rules using parser. Args: source: Source string (cannot contain non-terminals). targe
language/compgen/csl/qcfg/qcfg_parser.py:122
Function
can_parse
Return True if target can be derived given rules using parser. Args: target: Target string (can contain non-terminals or terminals). rules:
language/compgen/csl/qcfg/qcfg_target_parser.py:120
Function
can_parse
Returns True if there exists >=1 parse of target_string given rules.
language/compgen/csl/targets/target_grammar.py:101
Function
can_parse
Return True if source and target can be derived given rules using parser. Args: source: Source string (cannot contain non-terminals). targe
language/compgen/nqg/model/qcfg/qcfg_parser.py:108
Function
can_parse
Returns True if there exists >=1 parse of target_string given rules.
language/compgen/nqg/model/parser/inference/targets/target_grammar.py:120
← previous
next →
3,501–3,600 of 6,154, ranked by callers