MCPcopy Create free account

hub / github.com/WenRichard/KBQA-BERT / functions

Functions292 in github.com/WenRichard/KBQA-BERT

↓ 1 callersFunctionconvert_examples_to_features
Loads a data file into a list of `InputBatch`s.
bert/extract_features.py:210
↓ 1 callersMethodconvert_examples_to_features
Convert a set of `InputExample`s to a list of `InputFeatures`.
run_similarity.py:306
↓ 1 callersFunctionconvert_single_example
将一个样本进行分析,然后将字转化为id, 标签转化为id,然后结构化到InputFeatures对象中 :param ex_index: index :param example: 一个样本 :param label_list: 标签列表 :param ma
run_ner.py:252
↓ 1 callersMethodconvert_single_example
Converts a single `InputExample` into a single `InputFeatures`.
run_similarity.py:427
↓ 1 callersFunctioncreate_attention_mask_from_input_mask
Create 3D attention mask from a 2D tensor mask. Args: from_tensor: 2D or 3D Tensor of shape [batch_size, from_seq_length, ...]. to_mask: in
bert/modeling.py:526
↓ 1 callersFunctioncreate_db
()
Data/load_dbdata.py:14
↓ 1 callersFunctioncreate_float_feature
(values)
bert/create_pretraining_data.py:171
↓ 1 callersFunctioncreate_instances_from_document
Creates `TrainingInstance`s for a single document.
bert/create_pretraining_data.py:220
↓ 1 callersFunctioncreate_masked_lm_predictions
Creates the predictions for the masked LM objective.
bert/create_pretraining_data.py:335
↓ 1 callersFunctioncreate_model
Creates a classification model.
bert/run_squad.py:549
↓ 1 callersFunctioncreate_model
Creates a classification model.
bert/run_classifier.py:541
↓ 1 callersMethodcreate_model
Creates a classification model.
run_similarity.py:137
↓ 1 callersMethodcreate_model
(self)
bert/modeling_test.py:71
↓ 1 callersFunctioncreate_training_instances
Create `TrainingInstance`s from raw text.
bert/create_pretraining_data.py:176
↓ 1 callersMethodcrf_layer
calculate crf loss :param project_logits: [1, num_steps, num_tags] :return: scalar loss
lstm_crf_layer.py:148
↓ 1 callersFunctiondel_file
(path)
run_ner.py:582
↓ 1 callersFunctionembedding_lookup
Looks up words embeddings for id tensor. Args: input_ids: int32 Tensor of shape [batch_size, seq_length] containing word ids. vocab_s
bert/modeling.py:381
↓ 1 callersFunctionembedding_postprocessor
Performs various post-processing on a word embedding tensor. Args: input_tensor: float Tensor of shape [batch_size, seq_length, embedding
bert/modeling.py:430
↓ 1 callersMethodeval
(self)
run_similarity.py:628
↓ 1 callersFunctionfbeta
Multi-class fbeta metric for Tensorflow Parameters ---------- labels : Tensor of tf.int32 or tf.int64 The true labels predicti
tf_metrics.py:97
↓ 1 callersMethodflatten_recursive
Flattens (potentially nested) a tuple/dictionary/list to a list.
bert/modeling_test.py:257
↓ 1 callersMethodfrom_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
bert/modeling.py:82
↓ 1 callersFunctiongather_indexes
Gathers the vectors at the specific positions over a minibatch.
bert/run_pretraining.py:308
↓ 1 callersFunctionget_activation
Maps a string to a Python function, e.g., "relu" => `tf.nn.relu`. Args: activation_string: String name of the activation function. Returns:
bert/modeling.py:281
↓ 1 callersMethodget_dev_examples
(self, data_dir)
run_similarity.py:81
↓ 1 callersMethodget_dev_examples
(self, data_dir)
run_ner.py:211
↓ 1 callersMethodget_dev_examples
Gets a collection of `InputExample`s for the dev set.
bert/run_classifier.py:165
↓ 1 callersMethodget_embedding_output
Gets output of the embedding lookup (i.e., input to the transformer). Returns: float Tensor of shape [batch_size, seq_length, hidden_size]
bert/modeling.py:250
↓ 1 callersMethodget_embedding_table
(self)
bert/modeling.py:261
↓ 1 callersFunctionget_final_text
Project the tokenized prediction back to the original text.
bert/run_squad.py:926
↓ 1 callersMethodget_labels
(self)
run_ner.py:220
↓ 1 callersMethodget_labels
Gets the list of labels for this data set.
bert/run_classifier.py:173
↓ 1 callersFunctionget_last_checkpoint
(model_path)
run_ner.py:823
↓ 1 callersFunctionget_masked_lm_output
Get loss and log probs for the masked LM.
bert/run_pretraining.py:240
↓ 1 callersFunctionget_next_sentence_output
Get loss and log probs for the next sentence prediction.
bert/run_pretraining.py:285
↓ 1 callersMethodget_result
(self, tokens, tags, config=None)
terminal_predict.py:371
↓ 1 callersMethodget_sentence_examples
(self, questions)
run_similarity.py:105
↓ 1 callersMethodget_test_examples
(self, data_dir)
run_ner.py:216
↓ 1 callersMethodget_test_examples
Gets a collection of `InputExample`s for prediction.
bert/run_classifier.py:169
↓ 1 callersMethodget_train_examples
(self, data_dir)
run_ner.py:206
↓ 1 callersMethodget_train_examples
Gets a collection of `InputExample`s for the train set.
bert/run_classifier.py:161
↓ 1 callersMethodget_unreachable_ops
Finds all of the tensors in graph that are unreachable from outputs.
bert/modeling_test.py:194
↓ 1 callersFunctioninput_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
bert/extract_features.py:100
↓ 1 callersFunctionis_whitespace
(c)
bert/run_squad.py:232
↓ 1 callersFunctionkb_fuzzy_classify_test
进行问答测试: 1、 实体检索:输入问题,ner得出实体集合,在数据库中检索与输入实体相关的所有三元组 2、 属性映射——bert分类/文本相似度 + 非语义匹配:如果所得三元组的关系(attribute)属性是 输入问题 字符串的子集,将所得三元组的答案(
kbqa_test.py:101
↓ 1 callersFunctionlayer_norm_and_dropout
Runs layer normalization followed by dropout.
bert/modeling.py:369
↓ 1 callersFunctionload_vocab
Loads a vocabulary file into a dictionary.
bert/tokenization.py:70
↓ 1 callersFunctionloaddata
()
Data/load_dbdata.py:45
↓ 1 callersFunctionmain
(argv)
conlleval.py:289
↓ 1 callersFunctionmetric_fn
(label_ids, pred_ids)
run_ner.py:528
↓ 1 callersFunctionmodel_fn_builder
构建模型 :param bert_config: :param num_labels: :param init_checkpoint: :param learning_rate: :param num_train_steps: :param
run_ner.py:458
↓ 1 callersFunctionmodel_fn_builder
Returns `model_fn` closure for TPUEstimator.
bert/run_squad.py:589
↓ 1 callersFunctionmodel_fn_builder
Returns `model_fn` closure for TPUEstimator.
bert/run_pretraining.py:109
↓ 1 callersFunctionmodel_fn_builder
Returns `model_fn` closure for TPUEstimator.
bert/run_classifier.py:586
↓ 1 callersFunctionmodel_fn_builder
Returns `model_fn` closure for TPUEstimator.
bert/extract_features.py:148
↓ 1 callersMethodmodel_fn_builder
Returns `model_fn` closurimport_tfe for TPUEstimator.
run_similarity.py:181
↓ 1 callersFunctionpredict_online
do online prediction. each time make prediction for one instance. you can change to a batch if you want. :param line: a list. element is
terminal_predict.py:84
↓ 1 callersFunctionpredict_outline
do online prediction. each time make prediction for one instance. you can change to a batch if you want. :param line: a list. element is
terminal_predict.py:128
↓ 1 callersMethodprocess_feature
Write a InputFeature to the TFRecordWriter as a tf.train.Example.
bert/run_squad.py:1066
↓ 1 callersMethodproject_bilstm_layer
hidden layer between lstm layer and logits :param lstm_outputs: [batch_size, num_steps, emb_size] :return: [batch_size, num_
lstm_crf_layer.py:104
↓ 1 callersMethodproject_crf_layer
hidden layer between input layer and logits :param lstm_outputs: [batch_size, num_steps, emb_size] :return: [batch_size, num
lstm_crf_layer.py:131
↓ 1 callersFunctionread_examples
Read a list of `InputExample`s from an input file.
bert/extract_features.py:319
↓ 1 callersFunctionreport
(counts, out=None)
conlleval.py:173
↓ 1 callersFunctionreport_notprint
(counts, out=None)
conlleval.py:199
↓ 1 callersMethodresult_to_json
将模型标注序列和输入序列结合 转化为结果 :param string: 输入序列 :param tags: 标注结果 :return:
terminal_predict.py:376
↓ 1 callersFunctionresult_to_pair
(writer)
run_ner.py:776
↓ 1 callersFunctionreturn_report
(input_file)
conlleval.py:283
↓ 1 callersMethodrun_tester
(self, tester)
bert/modeling_test.py:135
↓ 1 callersMethodstart
(self)
terminal_predict.py:322
↓ 1 callersMethodto_dict
Serializes this instance to a Python dictionary.
bert/modeling.py:96
↓ 1 callersMethodto_json_string
Serializes this instance to a JSON string.
bert/modeling.py:101
↓ 1 callersFunctiontransformer_model
Multi-headed, multi-layer Transformer from "Attention is All You Need". This is almost an exact implementation of the original Transformer encoder.
bert/modeling.py:756
↓ 1 callersFunctiontruncate_seq_pair
Truncates a pair of sequences to a maximum sequence length.
bert/create_pretraining_data.py:390
↓ 1 callersFunctionuniq
(iterable)
conlleval.py:147
↓ 1 callersFunctionvalidate_flags_or_throw
Validate the input FLAGS or throw an exception.
bert/run_squad.py:1096
↓ 1 callersFunctionwrite_instance_to_example_files
Create TF example files from `TrainingInstance`s.
bert/create_pretraining_data.py:93
↓ 1 callersFunctionwrite_predictions
Write final predictions to the json file and log-odds of null if needed.
bert/run_squad.py:740
↓ 1 callersFunctionwrite_tokens
将序列解析结果写入到文件中 只在mode=test的时候启用 :param tokens: :param mode: :return:
run_ner.py:235
Method__init__
(self, word, start, end, type, merge=False)
terminal_predict.py:314
Method__init__
(self, config)
terminal_predict.py:365
Method__init__
Constructs a InputExample. Args: guid: Unique id for the example. text_a: string. The untokenized text of the first seque
run_similarity.py:20
Method__init__
(self, input_ids, input_mask, segment_ids, label_id)
run_similarity.py:41
Method__init__
(self, batch_size=args.batch_size)
run_similarity.py:119
Method__init__
(self)
conlleval.py:29
Method__init__
BLSTM-CRF 网络 :param embedded_chars: Fine-tuning embedding input :param hidden_unit: LSTM的隐含单元个数 :param cell_type: RNN
lstm_crf_layer.py:13
Method__init__
Constructs a InputExample. Args: guid: Unique id for the example. text_a: string. The untokenized text of the first seque
run_ner.py:136
Method__init__
(self, input_ids, input_mask, segment_ids, label_ids, )
run_ner.py:153
Method__init__
(self, qas_id, question_text, doc_tokens, orig_ans
bert/run_squad.py:163
Method__init__
(self, unique_id, example_index, doc_span_index, t
bert/run_squad.py:200
Method__init__
(self, filename, is_training)
bert/run_squad.py:1060
Method__init__
(self, parent, batch_size=13, seq_length=7,
bert/modeling_test.py:33
Method__init__
(self, tokens, segment_ids, masked_lm_positions, masked_lm_labels, is_random_next)
bert/create_pretraining_data.py:68
Method__init__
(self, vocab_file, do_lower_case=True)
bert/tokenization.py:113
Method__init__
Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input.
bert/tokenization.py:137
Method__init__
(self, vocab, unk_token="[UNK]", max_input_chars_per_word=100)
bert/tokenization.py:252
Method__init__
Constructs a InputExample. Args: guid: Unique id for the example. text_a: string. The untokenized text of the first sequence. For sin
bert/run_classifier.py:130
Method__init__
(self, input_ids, input_mask, segment_ids, label_id)
bert/run_classifier.py:151
Method__init__
(self)
bert/run_classifier.py:191
Method__init__
Constructs a AdamWeightDecayOptimizer.
bert/optimization.py:87
Method__init__
Constructs BertConfig. Args: vocab_size: Vocabulary size of `inputs_ids` in `BertModel`. hidden_size: Size of the encoder layers and
bert/modeling.py:33
← previousnext →101–200 of 292, ranked by callers