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
↓ 1 callers
Function
application_idx_fn
(span_begin, span_end, rule)
language/compgen/nqg/model/parser/data/example_converter.py:124
↓ 1 callers
Method
apply_action
(self, action: int)
language/search_agents/muzero/state_tree.py:299
↓ 1 callers
Method
apply_action_to_stack
Expand `stack` with the rule corresponding to `action`. Args: stack: A sequence of `nltk.Nonterminal`s representing the current stack.
language/search_agents/muzero/state_tree.py:469
↓ 1 callers
Method
apply_gradients
See base class.
language/xsp/model/adam_weight_decay.py:52
↓ 1 callers
Function
apply_lstm
Run a bi-directional LSTM over the `x`. Args: x: <tf.float32>[batch, seq_len, dim] seq_len: <tf.int32>[batch] for None, sequence lengths of
language/boolq/run_recurrent_model_boolq.py:202
↓ 1 callers
Function
apply_masking
Applies BERT masking. Args: token_ids (Tensor): 1-D Tensor of token IDs (ints) target_token_ids (Tensor): 1-D Tensor of token IDs (ints)
language/conpono/reconstruct/preprocess.py:385
↓ 1 callers
Function
apply_norm
Applies layer normalization to x. Based on "Layer Normalization": https://arxiv.org/abs/1607.06450 Args: x: <float>[..., input_size] e
language/xsp/model/common_layers.py:106
↓ 1 callers
Function
aprf_relationwise
Returns precision, recall and F score for each relation.
language/labs/drkit/evaluate.py:472
↓ 1 callers
Method
are_paired_annos_duplicate
( self, paired_annos: List[annotation.PairedAnnotation] )
language/diffqg/metrics.py:115
↓ 1 callers
Method
as_read_head
Get the next minibatch from a dataset. Arguments: dset: a tf.data.Dataset Returns: a TF expression that evaluates to the next mi
language/nql/nql/util.py:344
↓ 1 callers
Method
as_tf
Convert a NeuralQueryExpression expression to a Tensorflow expression. If called on a Tensorflow expression, it will return expr unchanged.
language/nql/nql/__init__.py:680
↓ 1 callers
Method
as_top_k
Return top-k (entity-name, weight) tuples for each row of a matrix. Args: k: integer matrix: numpy ndarray of shape (num_entity_sets,
language/nql/nql/__init__.py:726
↓ 1 callers
Method
assert_all_tensors_reachable
Checks that all the tensors in the graph are reachable from outputs.
language/canine/modeling_test.py:170
↓ 1 callers
Function
assert_rank
Raises an exception if the tensor rank is not of the expected rank. Args: tensor: A tf.Tensor to check the rank of. expected_rank: Python i
language/canine/bert_modeling.py:1024
↓ 1 callers
Method
assign_relation_splits
Assign the data example to corresponding splits.
language/gscan/data/dataset.py:844
↓ 1 callers
Function
attention_layer
Performs multi-headed attention from `from_tensor` to `to_tensor`.
language/capwap/utils/transformer_utils.py:428
↓ 1 callers
Function
augmented_neighbors_list
Retrieve and convert the neighbors to a list. Args: q_id: a question id neighbors: a table mapping q_id to a list of top candidates is_
language/multivec/preprocessing/create_training_data.py:117
↓ 1 callers
Function
average_precision
(y_true, y_scores, k)
language/multivec/models/metrics.py:177
↓ 1 callers
Function
bad_tok
(tokens, vocab)
language/labs/exemplar_decoding/models/model_function.py:43
↓ 1 callers
Function
balance_atoms
Attempts to ensure every atom is represented in the first set.
language/compgen/nqg/tasks/mcd_utils.py:320
↓ 1 callers
Function
basic_gnmt_bahdanau_att
Hparams for LSTM with bahdanau attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:332
↓ 1 callers
Function
basic_gnmt_luong_att
Hparams for LSTM with luong attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:341
↓ 1 callers
Function
basic_nmt_bilstm_bahdanau_att
Hparams for LSTM with bahdanau attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:278
↓ 1 callers
Function
basic_nmt_bilstm_luong_att
Hparams for LSTM with luong attention.
language/labs/consistent_zero_shot_nmt/models/basic.py:287
↓ 1 callers
Function
basic_tokenize
Performs basic word tokenization for BERT. Args: text_input: A Tensor of untokenized strings. lower_case: A bool indicating whether or not
language/conpono/reconstruct/preprocess.py:62
↓ 1 callers
Function
batch
Groups examples into batches, dropping remainder.
language/realm/example_generator.py:185
↓ 1 callers
Method
batch_bleurt
Batches calls to the wrapped BLEURT model for efficiency. Note this method does not handle batching and only a single batch should be passed.
language/diffqg/metrics.py:240
↓ 1 callers
Function
batch_feature_dicts
Combines a batch of feature dicts into a single dict. Args: feature_dicts: a list of dicts, each mapping strings to Numpy arrays or TF Te
language/realm/featurization.py:628
↓ 1 callers
Function
batch_multiply
Batch multiply a vector with a sparse tensor.
language/labs/drkit/model_fns.py:1390
↓ 1 callers
Function
batch_word_to_char_ids
Batched version of word_to_char_ids. This is a deterministic function that should be computed during preprocessing. We pin this op to the CPU any
language/common/inputs/char_utils.py:56
↓ 1 callers
Function
beam_init
Initializes the beam search state data structure.
language/gscan/xattn_model/model/decode.py:144
↓ 1 callers
Function
beam_search
Construct new beams using the old ones based on gradient differences.
language/bert_extraction/steal_bert_classifier/embedding_perturbations/discrete_invert_embeddings.py:153
↓ 1 callers
Function
bleu_score
Compute BLEU score for predictions.
language/capwap/utils/metric_utils.py:304
↓ 1 callers
Function
boolq_preprocess
Preprocess boolq as fever-like claims TFDS format. Args: common_config: Common global config data_dir: Where to write data to download_
language/serene/fever_cli.py:254
↓ 1 callers
Method
build
Build the index in memory. Args: load_wiki: Whether to load wiki embeddings load_fever: Whether to load fever claim embeddings
language/serene/wiki_index.py:262
↓ 1 callers
Method
build
(self, input_shape)
language/common/layers/affine_transform.py:37
↓ 1 callers
Function
build_bert_inputs
Convert example <Tensor [30, 70]> into bert inputs.
language/conpono/cpc/run_cc_cpc.py:259
↓ 1 callers
Function
build_bert_inputs
Convert example <Tensor [30, 70]> into bert inputs.
language/conpono/cpc/run_bilin_cpc.py:277
↓ 1 callers
Function
build_coref_positive_negative_mask
Decides which samples are positive / negative for coref resolution loss. positive_mask[i, j] is True <=> mention j in `all_mention_target_ids` co
language/mentionmemory/modules/mention_losses.py:28
↓ 1 callers
Function
build_distractors
Create inputs with distractors.
language/conpono/cpc/run_cc_cpc.py:191
↓ 1 callers
Function
build_distractors
Create inputs with distractors.
language/conpono/cpc/run_bilin_cpc.py:197
↓ 1 callers
Method
build_encoder_fn
(self)
language/serene/preprocessing.py:464
↓ 1 callers
Method
build_follow_input_fn
Build input function for set-follow operations. Args: batch_size: batch_size mode: 'train' or 'test' epochs: number of epochs
language/emql/data_loader.py:737
↓ 1 callers
Method
build_intersection_input_fn
Build input function for set intersections. Args: name: 'intersection' or 'union' batch_size: batch_size mode: 'train' or 'test
language/emql/data_loader.py:676
↓ 1 callers
Method
build_membership_input_fn
Build set membership input_fn. Args: batch_size: batch_size mode: 'train' or 'test' epochs: epochs n_take: number of exam
language/emql/data_loader.py:614
↓ 1 callers
Method
build_metaqa_input_fn
Return tensors in required shape. Args: batch_size: batch_size mode: 'train' or 'test' epochs: epochs n_take: number of e
language/emql/data_loader.py:882
↓ 1 callers
Method
build_mixture_input_fn
Build mixture input_fn of membership, intersection, union, set_follow. Args: batch_size: batch_size mode: 'train' or 'test' epo
language/emql/data_loader.py:799
↓ 1 callers
Method
build_model
Builds model by instantiating flax module associated with task.
language/mentionmemory/tasks/ultra_fine_entity_typing_task.py:145
↓ 1 callers
Function
build_model_fn
Build model function. Args: name: name of the model -- 'membership' or 'intersection' or 'union' data_loader: data loader eval_name: if
language/emql/model.py:1158
↓ 1 callers
Function
build_mtb_positive_negative_mask
Decides which samples are positive / negative for MTB loss. On of the argument `mtb_positive_mask` contains information regarding how many unique
language/mentionmemory/modules/mention_losses.py:84
↓ 1 callers
Method
build_query2box_input_fn
Build input function. Build input function and return the inputs in their required formats: 1c: ent, rel 2c: ent, rel1, rel2
language/emql/data_loader.py:1031
↓ 1 callers
Function
build_record_example
Create the bert inptus for this record.
language/conpono/evals/run_record.py:165
↓ 1 callers
Function
build_subset
(sents_data)
language/bert_extraction/steal_bert_classifier/data_generation/preprocess_edit_distance_one.py:50
↓ 1 callers
Function
build_tensorize_text_fn
Builds a function to turn text into word/char ids.
language/boolq/run_recurrent_model_boolq.py:173
↓ 1 callers
Function
build_vocab
(sents_data)
language/bert_extraction/steal_bert_classifier/data_generation/preprocess_edit_distance_one.py:38
↓ 1 callers
Method
build_webqsp_input_fn
Return tensors in required shape. Args: batch_size: batch_size mode: 'train' or 'test' epochs: epochs n_take: number of e
language/emql/data_loader.py:951
↓ 1 callers
Function
calc_exact_match
Calculates exact match for a test set and its corresponding predictions.
language/compir/evaluate/evaluate_predictions_utils.py:24
↓ 1 callers
Function
cap_length
Cap total length of q, a, r to length.
language/question_answering/b2t2/compute_vcr_features.py:124
↓ 1 callers
Method
check_cvt_entity
This function check if an entity is cvt. We simply assume that tail entities of a ent2cvt relation is a cvt entity. And head entities of a cv
language/emql/data_loader.py:516
↓ 1 callers
Function
check_doc_len
(document, paragraph, num)
language/conpono/cpc/preproc/preprocessing_utils.py:128
↓ 1 callers
Method
check_model_completeness
Verify that the model has been fully configured. Args: model: a fully-configured Model
language/nql/nql/util.py:232
↓ 1 callers
Method
check_neighbor
(self, input_ex: Example, neighbor_ex: Example, state: Any)
language/casper/retrieve/query_retrievers.py:94
↓ 1 callers
Method
check_neighbor
Returns whether the neighbor is usable.
language/casper/retrieve/query_retrievers.py:149
↓ 1 callers
Function
check_person_name
Check if example does not have exact match for PersonName. The filtered example could be: Who is her boss ? ### ( Yield :output ( FindManager :re
language/compgen/csl/tasks/smcalflow/tools/filter_examples.py:32
↓ 1 callers
Function
check_year
Check if example does not have exact match for year. The filtered example usually requires additional context, e.g. Can you create an event at 11
language/compgen/csl/tasks/smcalflow/tools/filter_examples.py:59
↓ 1 callers
Function
checkpoints_iterator
Iterate all checkpoints in model directory in order they are created.
language/capwap/utils/experiment_utils.py:190
↓ 1 callers
Function
cider_score
Compute CIDEr score for predictions.
language/capwap/utils/metric_utils.py:316
↓ 1 callers
Function
claim_preprocess
Preprocess only claims TFDS format. Args: common_config: Common global config data_dir: Where to write data to download_dir: Where to d
language/serene/fever_cli.py:234
↓ 1 callers
Function
clean_predicted_sequence
Cleans a set of predicted SQL queries.
language/xsp/model/run_inference.py:111
↓ 1 callers
Function
clean_wikilink
Applies media wiki link formatting (e.g., stripping, capitalizing, etc.)
language/fruit/wiki_utils.py:259
↓ 1 callers
Function
cleanup_encoded_modules
()
language/realm/refresh_doc_embeds.py:57
↓ 1 callers
Method
clear_entity_type_vocabulary
Clear the vocabulary for an entity type. Args: type_name: string name of type
language/nql/nql/__init__.py:984
↓ 1 callers
Method
close
(self)
language/question_answering/bert_joint/run_nq.py:1100
↓ 1 callers
Function
col_tab_f1
Computes the F1 of tables and columns mentioned in the two queries.
language/xsp/evaluation/official_evaluation.py:171
↓ 1 callers
Method
collater_fn
(batch: Dict[str, tf.Tensor])
language/mentionmemory/tasks/base_task.py:146
↓ 1 callers
Function
column_is_foreign_key
Returns whether a column object is marked as a foreign key.
language/xsp/data_preprocessing/schema_utils.py:125
↓ 1 callers
Function
compute_all_scores
This function computes values of the following metrics: LENGTH, ROUGE-L, STR-EM, QA-EM, QA-F1, QA-HIT, OVERALL SCORE. Args: hypotheses: a dict
language/asqa/scoring.py:320
↓ 1 callers
Function
compute_attention
Build an attention matrix between 3-tensors `t1` and `t2`. Args: t1: <tf.float32>[batch, seq_len1, dim1] t2: <tf.float32>[batch, seq_len2,
language/boolq/run_recurrent_model_boolq.py:240
↓ 1 callers
Method
compute_average_embs
Compute the text encoding of questions. We take a bag of word approach. Question encoding is an average pooling of word embeddings. Args
language/emql/model.py:457
↓ 1 callers
Function
compute_bce_loss
Compute binary cross-entropy loss for logits.
language/labs/drkit/run_dualencoder_lsf.py:1497
↓ 1 callers
Method
compute_bert_cls_embs
Return the embedding of CLS token in BERT. Args: token_ids: BERT token ids segment_ids: BERT segment ids masks: BERT mask
language/emql/model.py:738
↓ 1 callers
Function
compute_binary_loss
(logits, labels, mask)
language/labs/drkit/hotpotqa/answer_extractor.py:719
↓ 1 callers
Function
compute_claim_recall
Compute the recall position for a single claim. Args: claim_json: The json of the fever claim ranked_claim_evidence: A ranked list of evide
language/serene/callbacks.py:95
↓ 1 callers
Function
compute_correct_candidates
Compute correct span.
language/orqa/models/orqa_model.py:321
↓ 1 callers
Function
compute_eval_metrics
Compute eval metrics.
language/orqa/models/text_classifier_model.py:108
↓ 1 callers
Function
compute_eval_metrics
Compute eval metrics.
language/orqa/models/orqa_model.py:366
↓ 1 callers
Function
compute_exact
(a_gold, a_pred)
language/bert_extraction/steal_bert_qa/utils/evaluate_squad_2.py:73
↓ 1 callers
Function
compute_extractive_predictions_using_results_only
Computes final extractive predictions based on logits.
language/capwap/synthetic/generate_answers.py:477
↓ 1 callers
Function
compute_f1
Compute word level F1 score between gold and predicted output.
language/bert_extraction/steal_bert_qa/utils/evaluate_squad_2.py:77
↓ 1 callers
Function
compute_f1_from_labels
Aggregates the metrics to overall change detection metrics. Args: labels: Label of each example Returns: Aggregated metrics over the cha
language/diffqg/metrics.py:309
↓ 1 callers
Function
compute_f1_single
Computes F1 score for a single prediction/ground_truth pair. This function computes the token-level intersection between the predicted and ground
language/search_agents/muzero/utils.py:52
↓ 1 callers
Method
compute_input_shapes
(self)
language/serene/preprocessing.py:557
↓ 1 callers
Function
compute_joint_mlp_logits
Computes joint span (start, end) logits from sequence input.
language/capwap/synthetic/generate_answers.py:173
↓ 1 callers
Function
compute_len
Compute average lenght of predictions. Args: predictions: {key: answer} dict of predicted answers target_keys: an optional set of keys. If
language/asqa/scoring.py:189
↓ 1 callers
Function
compute_loss
Compute loss.
language/orqa/models/text_classifier_model.py:98
↓ 1 callers
Function
compute_loss
Compute loss.
language/orqa/models/orqa_model.py:336
↓ 1 callers
Function
compute_loss_from_sptensors
Cross-entropy loss when both answers and probabilities are sparse.
language/labs/drkit/model_fns.py:583
↓ 1 callers
Function
compute_metrics
Compute accuracy on examples.
language/compgen/nqg/model/parser/inference/eval_model.py:79
↓ 1 callers
Function
compute_michigan_coverage
Prints out statistics for asql conversions.
language/xsp/data_preprocessing/estimate_asql_coverage_michigan.py:70
↓ 1 callers
Function
compute_pred_dict
Computes official answer key from raw logits.
language/question_answering/bert_joint/run_nq.py:1239
← previous
next →
1,701–1,800 of 6,154, ranked by callers