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
↓ 2 callers
Method
get_f1
Computes token-level overlap of the two questions. This is equivalent to Rouge-1's f-measure or the commonly reported SQuAD F1 in question an
language/diffqg/metrics.py:282
↓ 2 callers
Method
get_features
Convert list of tokens to a feature dict.
language/labs/drkit/bert_utils.py:226
↓ 2 callers
Method
get_features
Convert list of tokens to a feature dict.
language/labs/drkit/bert_utils_v2.py:221
↓ 2 callers
Function
get_features_and_labels
Get dict of features and labels.
language/xsp/model/input_pipeline.py:226
↓ 2 callers
Function
get_file_names
(root, file_pattern)
language/multivec/models/ranking_model_experiment_inbatch.py:165
↓ 2 callers
Method
get_hashes
Get the hash values of x. Each element is hashed w times, where w is the width of the count-min sketch specified in the constructor of CountM
language/emql/cm_sketch.py:74
↓ 2 callers
Function
get_ints_feature
(ex, name)
language/realm/retrieval.py:182
↓ 2 callers
Method
get_location_preps
(self)
language/gscan/data/vocabulary.py:53
↓ 2 callers
Function
get_model_dir
Returns model directory specified in either FLAGS or TF_CONFIG.
language/capwap/utils/experiment_utils.py:117
↓ 2 callers
Method
get_name_to_features
Return feature dict for decoding purposes. Models are responsible for preprocessing and therefore should already know what raw features are c
language/mentionmemory/tasks/base_task.py:85
↓ 2 callers
Function
get_nt_index
Return the index of the NT.
language/compgen/csl/qcfg/qcfg_rule.py:78
↓ 2 callers
Function
get_nts
Return a list of symbols that are NT.
language/compgen/csl/qcfg/qcfg_rule.py:115
↓ 2 callers
Function
get_p_r_f1
(tp, fp, fn)
language/decontext/eval_util.py:29
↓ 2 callers
Function
get_positions_shift
(positions: tf.Tensor, exclusive: bool)
language/mentionmemory/utils/mention_preprocess_utils.py:537
↓ 2 callers
Method
get_rouge_L
(self, paired_anno: annotation.PairedAnnotation)
language/diffqg/metrics.py:231
↓ 2 callers
Function
get_score
Equivalent of rule scoring in `forest_utils.forest_score_function`.
language/compgen/csl/model/inference/inference_parser.py:27
↓ 2 callers
Method
get_scores
Computes scores. P(lhs|rhs) = sum over types { P(type|rhs) * P(lhs|type) } logP(lhs|rhs) = log sum over types { P(type|rhs) * P(lhs|type) }
language/compgen/csl/model/weighted_model.py:70
↓ 2 callers
Function
get_sent
(pred)
language/decontext/eval_util.py:69
↓ 2 callers
Function
get_tempdir
Return tempdir.
language/capwap/utils/experiment_utils.py:97
↓ 2 callers
Function
get_text_span
Returns the text in the example's document in the given token span.
language/question_answering/bert_joint/run_nq.py:269
↓ 2 callers
Function
get_tokenization_info
(module_handle)
language/orqa/utils/bert_utils.py:23
↓ 2 callers
Function
get_tokens
(s)
language/bert_extraction/steal_bert_qa/utils/evaluate_squad_2.py:67
↓ 2 callers
Function
get_tokens_and_mask
Tokenize text and pad to max_length.
language/labs/drkit/input_fns.py:144
↓ 2 callers
Method
get_type_names
All declared types. Returns: an list of string type names.
language/nql/nql/__init__.py:1168
↓ 2 callers
Method
get_wikipedia_urls
Return a list of all wikipedia urls in this database. Returns: A list of wikipedia url strings in db
language/serene/wiki_db.py:75
↓ 2 callers
Function
global_to_local_offset
Converts a byte index within the article to the byte offset within the candidate.
language/canine/tydiqa/data.py:196
↓ 2 callers
Method
id_to_string
(self, i: int)
language/canine/tydiqa/char_splitter.py:78
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
language/labs/drkit/run_dualencoder_qa.py:703
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
language/labs/drkit/hotpotqa/answer_extractor.py:770
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
language/bert_extraction/steal_bert_qa/models/run_squad.py:700
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
language/conpono/evals/run_squad.py:687
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
language/question_answering/bert_joint/run_nq.py:1007
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
language/question_answering/b2t2/run_b2t2.py:465
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
language/question_answering/b2t2/run_dual_encoder.py:273
↓ 2 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
language/capwap/synthetic/generate_questions.py:360
↓ 2 callers
Function
int64_feature
(value)
language/capwap/utils/io_utils.py:43
↓ 2 callers
Method
is_frozen
Returns whether or not the SymbolTable for a type is frozen. Args: type_name: string name of a type. Returns whether or not the type's
language/nql/nql/__init__.py:1330
↓ 2 callers
Function
is_nt
Return whether the token is NT or not.
language/compgen/csl/qcfg/qcfg_rule.py:90
↓ 2 callers
Function
is_whitespace
(c)
language/labs/drkit/run_dualencoder_lsf.py:515
↓ 2 callers
Method
jump_to
A singleton set. Args: entity_name: a string naming an entity type_name: the string type name of the named entity Returns:
language/nql/nql/__init__.py:471
↓ 2 callers
Function
l2_normalize
Divide by the L2-norm to normalize the input vector(s). For the edge case of the zero vector, this simply returns zero. Args: v: Numpy vecto
language/common/inputs/embedding_utils.py:267
↓ 2 callers
Function
latest_export_path
Get the latest exported path based on timestamp.
language/common/utils/export_utils.py:53
↓ 2 callers
Function
layer_norm
Implements layer norm from [Ba et al. 2016] Layer Normalization. See eqn. 4 in (https://arxiv.org/pdf/1607.06450.pdf). Args: layer_inputs (t
language/labs/memory/model_utils.py:30
↓ 2 callers
Function
lines_in
Enumerate lines in a stream. Call file_like's iterator method and iterate over that. Will skip any lines starting with # and blank lines. Arg
language/nql/nql/io.py:28
↓ 2 callers
Function
load_config
Loads a serialized model config into a ModelConfig object.
language/xsp/model/model_config.py:67
↓ 2 callers
Function
load_dataset
Loads a dataset from a set of sharded TFRecord files.
language/realm/example_generator.py:329
↓ 2 callers
Method
load_dataset_from_file
(cls, file_path, save_directory, k=0)
language/gscan/data/dataset.py:234
↓ 2 callers
Function
load_decontext_label_from_dict
Reconstruct decontext label from its json representation.
language/decontext/decontext_util.py:33
↓ 2 callers
Function
load_embeddings
Load the fastText embeddings.
language/boolq/run_recurrent_model_boolq.py:83
↓ 2 callers
Method
load_entities
Load entity ids and masks.
language/labs/drkit/hotpotqa/demo.py:695
↓ 2 callers
Function
load_featurizer
Loads a Featurizer.
language/realm/example_generator.py:358
↓ 2 callers
Function
load_featurizer
(params)
language/realm/model.py:254
↓ 2 callers
Method
load_from_dict
(cls, joint_rule)
language/compgen/csl/augment/joint_sampler.py:75
↓ 2 callers
Method
load_kb_embeddings
Construct or load KB embeddings. Args: name: task name params: params Returns: a tensor for kb embeddings
language/emql/model.py:101
↓ 2 callers
Function
load_predictions
Load predictions from file. Wordpieces are converted back (approximately) into PTB-style tokens. Args: filename: Path to prediction file.
language/capwap/utils/metric_utils.py:47
↓ 2 callers
Function
load_questions
Load and process GQA questions. Args: questions_file: JSON file containing GQA questions. vocab: A text_utils.Vocab instance. Returns:
language/capwap/preprocessing/gqa_qa.py:59
↓ 2 callers
Function
load_spider_examples
Loads examples from the Spider dataset from the specified files.
language/xsp/data_preprocessing/spider_preprocessing.py:74
↓ 2 callers
Function
load_spider_tables
Loads database schemas from the specified filenames.
language/xsp/data_preprocessing/spider_preprocessing.py:65
↓ 2 callers
Method
load_vocab
Load vocab from file. Args: vocab_file: vocab file Returns: a mapping from word to id
language/emql/data_loader.py:214
↓ 2 callers
Method
load_weights
Load model weights from file.
language/mentionmemory/encoders/base_encoder.py:57
↓ 2 callers
Function
local_flag_settings
Get the current tf.flags.FLAGS settings.
language/nql/demos/gridworld_scaling/scaling_eval.py:170
↓ 2 callers
Function
make_bert_state
( environment_state: types.EnvState, tokenizer, idf_lookup: Mapping[str, float], use_target_do
language/search_agents/muzero/env.py:1048
↓ 2 callers
Function
make_example_id
Create a string example id for claim-evidence pairs. Args: claim_id: Fever claim id wikipedia_url: The wikipedia url of the evidence se
language/serene/analysis.py:100
↓ 2 callers
Method
make_prediction_fn
Creates task prediction function for inference.
language/mentionmemory/tasks/memory_generation_task.py:75
↓ 2 callers
Method
make_tf_examples
(self, example, is_training)
language/question_answering/bert_joint/run_nq_test.py:48
↓ 2 callers
Function
marginal_log_loss
Loss based on the negative marginal log-likelihood.
language/orqa/models/orqa_model.py:80
↓ 2 callers
Function
mask_to_score
(mask)
language/orqa/models/orqa_model.py:76
↓ 2 callers
Function
mask_tokens_by_spans
Mask `mask_rate` fraction of spans.
language/mentionmemory/utils/mention_preprocess_utils.py:93
↓ 2 callers
Method
maybe_get_child
(self, symbol)
language/compgen/nqg/common/cky/trie_utils.py:50
↓ 2 callers
Function
merge_eval
(main_eval, new_eval, prefix)
language/bert_extraction/steal_bert_qa/utils/evaluate_squad_2.py:147
↓ 2 callers
Function
metric_fn
(query_mask, block_mask, labels, predictions, mask_query)
language/orqa/models/ict_model.py:146
↓ 2 callers
Function
metric_max_over_ground_truths
(metric_fn, prediction, ground_truths)
language/labs/drkit/evaluate.py:360
↓ 2 callers
Method
minibatch_np
(self, cell_names)
language/nql/nql/nql_test.py:719
↓ 2 callers
Function
model_fn_builder
Returns `model_fn` closure for TPUEstimator.
language/labs/drkit/run_dualencoder_qa.py:559
↓ 2 callers
Function
model_fn_builder
Returns `model_fn` closure for TPUEstimator.
language/labs/drkit/run_multihop_follow.py:392
↓ 2 callers
Function
model_fn_builder
Returns `model_fn` closure for TPUEstimator.
language/labs/drkit/hotpotqa/demo.py:870
↓ 2 callers
Method
model_metaqa
Compute logits for MetaQA multi-hop reasoning task. MetaQA model is made of 4 different parts: 1. Construct KB triple query to retrieve the t
language/emql/model.py:341
↓ 2 callers
Method
model_query2box
Model query2box for 9 different tasks. This function simulate 9 compositional queries as defined in the Query2Box paper: 1c: X.follow(R
language/emql/model.py:962
↓ 2 callers
Method
model_webqsp
Compute logits for more evaluation. Args: features: features params: hyper-parameters top_k: top k to retrieve at each hop
language/emql/model.py:484
↓ 2 callers
Function
move_directory
(from_dir, to_dir)
language/realm/refresh_doc_embeds.py:52
↓ 2 callers
Method
my_func
(self)
language/canine/tensor_contracts_test.py:246
↓ 2 callers
Function
nest_to_flat_dict
Convert a nested structure into a flat dictionary. Args: nest: A nested structure. Returns: flat_dict: A dictionary with strings keys th
language/common/utils/nest_utils.py:108
↓ 2 callers
Method
non_parallel_process
(self, example)
language/xsp/model/run_inference.py:290
↓ 2 callers
Method
non_parallel_process
(self, example)
language/xsp/data_preprocessing/convert_to_tfrecords.py:130
↓ 2 callers
Method
none
An empty set for some type. Args: type_name: the string type name Returns: A NeuralQueryExpression for an all-zeros vector for t
language/nql/nql/__init__.py:871
↓ 2 callers
Function
normalize_answer
Normalize answer.
language/orqa/utils/eval_utils.py:25
↓ 2 callers
Function
normalize_entities
Normalizes database entities (table and column names).
language/xsp/data_preprocessing/wikisql_preprocessing.py:48
↓ 2 callers
Function
normalize_sql
Normalizes WikiSQL SQL queries.
language/xsp/data_preprocessing/wikisql_preprocessing.py:34
↓ 2 callers
Function
normalize_sql_str
Normalizes the format of a SQL string for string comparison.
language/xsp/evaluation/official_evaluation.py:60
↓ 2 callers
Function
normalize_text
Lower text and remove punctuation, articles and extra whitespace.
language/bert_extraction/steal_bert_qa/data_generation/preprocess_util.py:200
↓ 2 callers
Function
num_tpu_shards
Get the number of TPU shards.
language/common/utils/tpu_utils.py:32
↓ 2 callers
Function
numpy_size
Size in bytes of a numpy object. Only works for a couple of numpy types. Args: msg: A string used in error messages. m: numpy array or s
language/nql/demos/gridworld_scaling/scaling_eval.py:267
↓ 2 callers
Function
overlaps
(first_span: Tuple[int, int], second_span: Tuple[int,
language/mentionmemory/data/prepare_tacred.py:103
↓ 2 callers
Function
overlaps
(first_span: Tuple[int, int], second_span: Tuple[int,
language/mentionmemory/data/prepare_webred.py:151
↓ 2 callers
Function
parse_date
Try to parse date from string. Args: date_str: String representation of the date. Returns: date: Tuple of (year, month, day).
language/templama/templama.py:112
↓ 2 callers
Method
parse_date
Try to parse date from string.
language/templama/sling2facts.py:406
↓ 2 callers
Function
parse_shard
Parse a single shard in input template to get shard string and quantity.
language/bert_extraction/steal_bert_classifier/embedding_perturbations/embedding_util.py:233
↓ 2 callers
Function
pool
Pool `embed` along the second dimension. Args: embed: <tf.float32>[batch, seq_len, dim] seq_len: <tf.int32>[batch] sequence lengths of `em
language/boolq/run_recurrent_model_boolq.py:286
↓ 2 callers
Method
populate_fn
(unused_span_begin, unused_span_end, unused_parser_rule, unused_children)
language/compgen/csl/qcfg/qcfg_target_parser.py:234
↓ 2 callers
Method
postprocess
Post-process model outputs to readable format.
language/labs/drkit/hotpotqa/demo.py:767
← previous
next →
1,001–1,100 of 6,154, ranked by callers