MCPcopy Create free account

hub / github.com/PaddlePaddle/Knover / functions

Functions590 in github.com/PaddlePaddle/Knover

↓ 107 callersMethodget
Get the value of corresponding key.
knover/utils/args.py:49
↓ 70 callersMethodload
(self, filename, group_name=None)
knover/utils/args.py:67
↓ 41 callersFunctionpad_batch_data
Pad the instances to the max sequence length in batch.
knover/utils/tensor_utils.py:80
↓ 22 callersMethodadd_cmdline_args
Add cmdline arguments.
knover/core/model.py:43
↓ 18 callersMethodadd
Add a new hypothesis to the list.
projects/Q-TOD/infer.py:225
↓ 17 callersFunctionparse_args
Parse hyper-parameters from cmdline.
knover/utils/args.py:85
↓ 12 callersMethod_gen_self_attn_mask
Generate self attention masking matrix. This is a helpful function to generate different types of attention masking matrix. 1. Bi-dir
knover/data/dialog_reader.py:622
↓ 12 callersMethodstart
Record start timestamp.
knover/utils/misc.py:32
↓ 11 callersMethodquery
Query database for a given domain and constraints. Args: domain (str, optional): The current domain. Defaults to None.
projects/DSTC10-Track2/task1/utils.py:1059
↓ 10 callersMethod_convert_number
Convert arabic numerals to English representation. Args: token (str): The token. Returns: str: The token aft
projects/DSTC10-Track2/task1/utils.py:466
↓ 10 callersMethod_generation_network
Run Transformer generation network. Args: tokens_ids: represents the token id of each token, shape is [batch_size, max_seq_len, 1
knover/models/unified_transformer.py:236
↓ 10 callersFunctioncheck_cuda
Check CUDA.
knover/utils/misc.py:56
↓ 10 callersMethoddisplay
(self)
knover/utils/args.py:81
↓ 9 callersMethod_get_pooled_output
Get pooled output of the last output embedding in Transformer. Args: enc_out: the output embeddings of Transformer, shape is [bat
knover/models/unified_transformer.py:189
↓ 9 callersMethodrun
Run postprocessing. Args: ds_seq (str): The dialogue state of model generation. prev_ds (dict, optional): The previou
projects/DSTC10-Track2/task1/utils.py:587
↓ 8 callersMethodadd
Add a new hypothesis to the list.
projects/QKConv/infer.py:143
↓ 8 callersMethodtokenize
Tokenizes a piece of text.
knover/utils/tokenization.py:173
↓ 7 callersMethod_convert_example_to_record
Convert example to record which can be used as the model's input.
knover/data/nsp_reader.py:51
↓ 7 callersMethod_execute
Execute program in static graph mode. Args: program: The executable program. inputs: A dict mapping variable names to
knover/core/model.py:538
↓ 7 callersFunctionmask
Add masking and return target's labels and indices. Add mask for batch_tokens, return out, mask_label, mask_idx; Note: mask_idx (masking inde
knover/utils/reader_utils.py:29
↓ 7 callersFunctionrun_cmd
Helpful function for running shell command in py scripts.
knover/scripts/train.py:76
↓ 7 callersFunctionto_optimized_size
Padding sequence to speedup matmul OP. According to the tensor cores documentation from NVIDIA, the matmul OP in fp16 must all be multiples of
knover/utils/tensor_utils.py:35
↓ 6 callersMethod_pad_batch_records
Padding a batch of records and construct model's inputs.
knover/data/nsp_reader.py:115
↓ 6 callersMethodconvert_tokens_to_ids
Convert tokens to ids.
knover/utils/tokenization.py:192
↓ 6 callersMethodinfer_step
Run one inference step.
knover/core/task.py:43
↓ 5 callersMethod_calc_logits
Get the logits of generation task. The network may share weight with token embeddings. Args: enc_out: the output embeddi
knover/models/unified_transformer.py:318
↓ 5 callersMethod_get_classifier_output
Get the output logits of the classifier network. Args: pooled_out: represents the input embedding of classifier network, shape is
knover/models/unified_transformer.py:218
↓ 5 callersMethod_parse_src
Parse source sequence and return corresponding fields.
knover/data/dialog_reader.py:159
↓ 5 callersMethod_read_file
Read a data file and yield records.
knover/data/dialog_reader.py:396
↓ 5 callersFunctionconvert_to_knowledge
Get formated knowledge.
projects/PLATO-KAG/holle/build_selection_infer_data.py:67
↓ 5 callersMethodget_data_loader
Get the model's DataLoader. Args: model: the trained model. is_infer: whether to run model in inference mode.
knover/core/task.py:82
↓ 5 callersFunctionget_logger
Get logger.
projects/AG-DST/utils.py:22
↓ 5 callersMethodupdate
Update N-gram blocking strategy related data.
knover/modules/ops.py:142
↓ 4 callersFunction_build_linear_column_parallel
(x, n_in, n_out, name, initializer, num_partitions, part_id)
knover/modules/transformer_block.py:23
↓ 4 callersMethod_delete_redundant_slot_value
Delete redundant slot values. Args: ds_dict (dict): The dialogue state. Returns: dict: The new dialogue stat
projects/DSTC10-Track2/task1/utils.py:1031
↓ 4 callersMethod_get_batch_knowledge_ids
Get batch knowledge ids.
knover/data/kag_reader.py:311
↓ 4 callersMethod_get_batch_single_item
Get batch single item.
knover/data/kag_reader.py:320
↓ 4 callersMethod_get_batch_size
Get the batch size of inputs.
knover/models/unified_transformer.py:484
↓ 4 callersMethod_merge_field_values
(self, field_values1, field_values2)
knover/data/dialog_reader.py:308
↓ 4 callersMethod_parse_knowledge
Parse knowledge sequence and return corresponding fields.
knover/data/dialog_reader.py:224
↓ 4 callersFunctionconvert_to_tgt
Get formated knowledge.
projects/PLATO-KAG/holle/build_training_data.py:37
↓ 4 callersFunctionconvert_to_tgt
Get formated knowledge.
projects/PLATO-KAG/wow/build_selection_infer_data.py:90
↓ 4 callersFunctionconvert_to_tgt
Get formated knowledge.
projects/PLATO-KAG/wow/build_training_data.py:91
↓ 4 callersFunctionflatten_ds
Flatten dialogue state from dict to sequence. Args: ds_dict(dcit): The dialogue state dict. schema(dict): The schema of the
projects/AG-DST/utils.py:71
↓ 4 callersFunctionget_schema
Get schema for a dataset.
projects/AG-DST/utils.py:34
↓ 4 callersMethodinit
Initalize N-gram blocking strategy related data.
knover/modules/ops.py:93
↓ 4 callersFunctionload_program_state
Loading parameters from both. Support both static and dygraph mode.
knover/tools/convert_checkpoint.py:71
↓ 4 callersFunctionparse_ds
Parse dialogue state from sequence to dict. Args: ds_seq (str): The sequence of dialogue state. remove_nm (bool, optional): If Tr
projects/DSTC10-Track2/task1/utils.py:110
↓ 4 callersFunctionpreprocess_text
Preprocess utterance and table value.
projects/Q-TOD/infer.py:150
↓ 4 callersMethodpreprocess_text
Preprocess utterance and table value.
projects/QKConv/utils/smd_dataset.py:87
↓ 4 callersMethodsave
(self, filename)
knover/utils/args.py:62
↓ 4 callersMethodsort_key
The key of record. We will apply sorting before batching. It can decrease the number of padding and speedup training.
knover/data/dialog_reader.py:147
↓ 4 callersFunctiontokenize
Minimal tokenize the given text.
projects/DSTC10-Track2/task2/tools/minimal_tokenizer.py:163
↓ 4 callersMethodupdate
(self, ground_label, infer_label)
projects/AG-DST/evaluate_dst.py:85
↓ 3 callersFunction__split_heads
Split input embeddings into multiply chunks. Reshape the last dimension of inpunt tensor x so that it becomes two dimensions and then
knover/modules/transformer_block.py:139
↓ 3 callersMethod_convert_numbers
Convert arabic numerals to English representation. Args: tokens (list): The token list. Returns: list: The t
projects/DSTC10-Track2/task1/utils.py:455
↓ 3 callersMethod_gen_tgt_attn_mask
Generate tgt attention masking matrix. This is a helpful function to generation different type of attention masking matrix using in generatio
knover/data/dialog_reader.py:655
↓ 3 callersMethod_get_feed
Convert inputs into model's input data format. Convert hierarchical list into LoD Tensor, and keep numpy.ndarray. Args:
knover/core/model.py:350
↓ 3 callersMethod_get_similarity_score
Get similarity score.
knover/models/diamante.py:58
↓ 3 callersMethod_parse_tgt
Parse target sequence and return corresponding fields.
knover/data/dialog_reader.py:275
↓ 3 callersMethod_rerank
Rerank the matching result based on the database matching score of the specified slot. Args: db_res (list): Database matching res
projects/DSTC10-Track2/task1/utils.py:969
↓ 3 callersMethod_split_token
Split English and arabic numerals. Args: token (str): The token. alpha_alone (bool, optional): If True, the letters i
projects/DSTC10-Track2/task1/utils.py:494
↓ 3 callersMethodadd_cmdline_args
Add cmdline arguments.
knover/tasks/classification.py:26
↓ 3 callersFunctionbuild_data
build training data
projects/Diamante/build_data.py:26
↓ 3 callersMethodconvert_ids_to_tokens
Convert ids to tokens.
knover/utils/tokenization.py:202
↓ 3 callersMethodget_metrics
Get metrics.
knover/core/task.py:73
↓ 3 callersMethodmerge_subword
Merge subword.
knover/utils/tokenization.py:206
↓ 3 callersFunctionpost_process_context
Post-process the context id sequence. Truncate the <bos> token. Convert token ids to words (merge = True) or tokens (merge = False). Arg
knover/tasks/dialog_generation.py:301
↓ 3 callersMethodpreprocess
(self, text)
knover/utils/tokenization.py:169
↓ 3 callersMethodreset
Reset pass time.
knover/utils/misc.py:41
↓ 3 callersFunctionsave_model
Save model. In normal mode, only the master GPU need to save the model. In sharding mode, it need to save each part of model in GPUs.
knover/scripts/train.py:277
↓ 3 callersFunctionsave_static
Save model in static mode(paddle 1.x). This function will save all model parameters in a directory.
knover/tools/convert_checkpoint.py:81
↓ 3 callersMethodscore
(self)
projects/AG-DST/evaluate_dst.py:118
↓ 3 callersFunctionwrite_train_tsv
write data
projects/Diamante/build_data.py:15
↓ 2 callersFunction__filter__
(tok_id)
knover/utils/reader_utils.py:81
↓ 2 callersFunction_build_linear_row_parallel
(x, n_in, n_out, name, initializer, num_partitions, part_id)
knover/modules/transformer_block.py:35
↓ 2 callersMethod_calc_nsp_logits
(self, recognition_out)
knover/models/plato.py:134
↓ 2 callersMethod_convert_time
Convert numeric representation of time to English representation. Args: utt_ls (list): The utterance list. token_idx
projects/DSTC10-Track2/task1/utils.py:389
↓ 2 callersMethod_distributed_batch_reader
Distributed batch reader. Slice dataset and feed batches to different devices. Args: batch_reader: A batch reader.
knover/data/dialog_reader.py:535
↓ 2 callersMethod_encode
Run Transformer encode pass. Args: emb_input: represents the input embeddings of Transformer, shape is [batch_size, max_seq_len,
knover/models/unified_transformer.py:275
↓ 2 callersMethod_extract_entities
(self, response)
projects/QKConv/utils/metrics.py:76
↓ 2 callersMethod_extract_entities
(self, response)
projects/Q-TOD/evaluate.py:149
↓ 2 callersFunction_f1_score
Get F1 score.
projects/PLATO-KAG/holle/build_selection_infer_data.py:39
↓ 2 callersMethod_gen_input
Generate input embeddings of Transformer Args: token_ids: represents the token id of each token, shape is [batch_size, max_seq_le
knover/models/unified_transformer.py:101
↓ 2 callersMethod_get_feed_dict
Get model's input feed dict. Args: is_infer: If true, get inference input feed dict, otherwise get training / evaluation input fe
knover/core/model.py:401
↓ 2 callersMethod_get_token_type
Get slot name for a specific token. Args: utt_ls (list): The utterance list. token_idx (int): The index of token.
projects/DSTC10-Track2/task1/utils.py:358
↓ 2 callersMethod_parse_topic
Parse topic sequence and return corresponding fields.
knover/data/kag_reader.py:67
↓ 2 callersMethod_post_process
Post processing. Args: utt (str): The utterance. Returns: str: The utterance after post processing.
projects/DSTC10-Track2/task1/utils.py:526
↓ 2 callersMethod_recognition_network
Run recognition network. Args: token_ids: represents the token id of each token, shape is [batch_size, max_seq_len, 1]
knover/models/plato.py:85
↓ 2 callersMethod_run_generation
Run generation.
knover/models/unified_transformer.py:568
↓ 2 callersMethod_update_max_lens
Update max_lens.
knover/data/dialog_reader.py:456
↓ 2 callersFunctionbasic_convert_fn
Basic convert function.
knover/tools/convert_checkpoint.py:39
↓ 2 callersFunctioncheck_in_turn_repetition
Check the in-turn repetition. Calcuate tri-gram repetition. Args: pred: Words or tokens or token_ids. is_cn: Chinese version
knover/tasks/dialog_generation.py:385
↓ 2 callersMethoddata_generator
Yield batches from a file or a record reader. If `reader` is set, it will yield batches from the record reader, otherwise yield batches from
knover/data/dialog_reader.py:563
↓ 2 callersMethodevaluate
(self, preds, refs)
projects/QKConv/utils/metrics.py:31
↓ 2 callersFunctionf1_metric
calculate f1 metric
projects/PLATO-KAG/tools/generation_metrics.py:84
↓ 2 callersFunctionf1_metric
calculate f1 metric
projects/PLATO-KAG/holle/eval_multi_ref_generation.py:88
↓ 2 callersFunctionf1_score
Compute F1 scores Args: preds (list[str]): list of prediction refs (list[str]): list of reference avg (bool, optional): w
projects/QKConv/utils/metrics.py:177
↓ 2 callersFunctionfirst_val
Get the first value.
projects/PLATO-KAG/wow/build_selection_infer_data.py:38
↓ 2 callersFunctionfirst_val
Get the first value.
projects/PLATO-KAG/wow/build_training_data.py:39
next →1–100 of 590, ranked by callers