Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Happleasei/Chinese-Grammatical-error-diagnosis
/ functions
Functions
1,299 in github.com/Happleasei/Chinese-Grammatical-error-diagnosis
⨍
Functions
1,299
◇
Types & classes
276
↓ 1 callers
Method
bpe
(self, token)
BERT_CRF/models/transformers/tokenization_xlm.py:615
↓ 1 callers
Function
build_tf_to_pytorch_map
A map of modules from TF to PyTorch. This time I use a map to keep the PyTorch model as identical to the original PyTorch model as possible.
BERT_CRF/models/transformers/modeling_transfo_xl.py:48
↓ 1 callers
Function
build_tf_xlnet_to_pytorch_map
A map of modules from TF to PyTorch. I use a map to keep the PyTorch model as identical to the original PyTorch model as possible.
BERT_CRF/models/transformers/modeling_xlnet.py:45
↓ 1 callers
Function
bytes_to_unicode
Returns list of utf-8 byte and a mapping to unicode strings. We specifically avoids mapping to whitespace/control characters the bpe code bar
BERT_CRF/models/transformers/tokenization_gpt2.py:68
↓ 1 callers
Method
cache_mem
cache hidden states into memory.
BERT_CRF/models/transformers/modeling_xlnet.py:654
↓ 1 callers
Method
cal_f1
(self)
HMM/evaluating.py:50
↓ 1 callers
Method
cal_precision
(self)
HMM/evaluating.py:33
↓ 1 callers
Method
cal_recall
(self)
HMM/evaluating.py:42
↓ 1 callers
Method
check_output
(self, result)
BERT_BILSTM_CRF/bert/modeling_test.py:114
↓ 1 callers
Function
clean
Clean current folder remove saved model and training log
BERT_BILSTM_CRF/utils.py:95
↓ 1 callers
Method
clean_up_tokenization
Clean up a list of simple English tokenization artifacts like spaces before punctuations and abreviated forms.
BERT_CRF/models/transformers/tokenization_utils.py:1062
↓ 1 callers
Function
config_model
(tag_to_id)
BERT_BILSTM_CRF/main_BERT_bilstm_crf.py:81
↓ 1 callers
Function
convert_examples_to_features
Loads a data file into a list of `InputBatch`s.
BERT_BILSTM_CRF/bert/extract_features.py:210
↓ 1 callers
Function
convert_examples_to_features
Loads a data file into a list of `InputBatch`s `cls_token_at_end` define the location of the CLS token: - False (Default, BERT/
BERT_CRF/processors/ner_span.py:64
↓ 1 callers
Method
convert_tag
(self, tag_list)
XLNET_BILSTM_CRF/xlnet_data_utils.py:95
↓ 1 callers
Method
count_correct_tags
计算每种标签预测正确的个数(对应精确率、召回率计算公式上的tp),用于后面精确率以及召回率的计算
HMM/evaluating.py:91
↓ 1 callers
Function
create_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_BILSTM_CRF/bert/modeling.py:524
↓ 1 callers
Method
create_feed_dict
:param is_train: Flag, True for train batch :param batch: list train/evaluate data :return: structured data to feed
BERT_BILSTM_CRF/model.py:184
↓ 1 callers
Function
create_float_feature
(values)
BERT_BILSTM_CRF/bert/create_pretraining_data.py:174
↓ 1 callers
Function
create_instances_from_document
Creates `TrainingInstance`s for a single document.
BERT_BILSTM_CRF/bert/create_pretraining_data.py:223
↓ 1 callers
Method
create_mask
Creates causal attention mask. Float mask where 1.0 indicates masked, 0.0 indicates not-masked. Args: qlen: TODO Lysandr
BERT_CRF/models/transformers/modeling_xlnet.py:624
↓ 1 callers
Function
create_masked_lm_predictions
Creates the predictions for the masked LM objective.
BERT_BILSTM_CRF/bert/create_pretraining_data.py:342
↓ 1 callers
Function
create_model
(session, Model_class, path, config, logger)
BERT_BILSTM_CRF/utils.py:175
↓ 1 callers
Function
create_model
Creates a classification model.
BERT_BILSTM_CRF/bert/run_squad.py:550
↓ 1 callers
Function
create_model
Creates a classification model.
BERT_BILSTM_CRF/bert/run_classifier_with_tfhub.py:37
↓ 1 callers
Function
create_model
Creates a classification model.
BERT_BILSTM_CRF/bert/run_classifier.py:574
↓ 1 callers
Method
create_model
(self)
BERT_BILSTM_CRF/bert/modeling_test.py:71
↓ 1 callers
Function
create_sinusoidal_embeddings
(n_pos, dim, out)
BERT_CRF/models/transformers/modeling_distilbert.py:52
↓ 1 callers
Function
create_sinusoidal_embeddings
(n_pos, dim, out)
BERT_CRF/models/transformers/modeling_xlm.py:50
↓ 1 callers
Method
create_token_type_ids_from_sequences
(self, token_ids_0, token_ids_1=None)
BERT_CRF/models/transformers/tokenization_utils.py:922
↓ 1 callers
Function
create_tokenizer_from_hub_module
Get the vocab file and casing info from the Hub module.
BERT_BILSTM_CRF/bert/run_classifier_with_tfhub.py:146
↓ 1 callers
Function
create_training_instances
Create `TrainingInstance`s from raw text.
BERT_BILSTM_CRF/bert/create_pretraining_data.py:179
↓ 1 callers
Method
crf_layer
(self)
XLNET_BILSTM_CRF/main_xlnet_bilstm_crf.py:242
↓ 1 callers
Function
crf_train_eval
(train_data, test_data, remove_O=False)
CRF/evaluate.py:14
↓ 1 callers
Method
cut_long_sentence
(self, ntokens, target)
XLNET_BILSTM_CRF/xlnet_data_utils.py:65
↓ 1 callers
Method
decoding
使用维特比算法对给定观测序列求状态序列, 这里就是对字组成的序列,求其对应的标注。 维特比算法实际是用动态规划解隐马尔可夫模型预测问题,即用动态规划求概率最大路径(最优路径) 这时一条路径对应着一个状态序列
HMM/hmm.py:70
↓ 1 callers
Function
download_and_extract
(task, data_dir)
BERT_CRF/tools/download_clue_data.py:30
↓ 1 callers
Function
embedding_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_BILSTM_CRF/bert/modeling.py:380
↓ 1 callers
Function
embedding_lookup
TPU and GPU embedding_lookup function.
XLNET_BILSTM_CRF/modeling.py:25
↓ 1 callers
Function
embedding_postprocessor
Performs various post-processing on a word embedding tensor. Args: input_tensor: float Tensor of shape [batch_size, seq_length, embedding
BERT_BILSTM_CRF/bert/modeling.py:428
↓ 1 callers
Method
encode_plus
Returns a dictionary containing the encoded sequence or sequence pair and additional informations: the mask for sequence classificati
BERT_CRF/models/transformers/tokenization_utils.py:739
↓ 1 callers
Function
f1_score
(tar_path, pre_path, tag, tag_map)
XLNET_BILSTM_CRF/utils.py:40
↓ 1 callers
Method
flatten_recursive
Flattens (potentially nested) a tuple/dictionary/list to a list.
BERT_BILSTM_CRF/bert/modeling_test.py:257
↓ 1 callers
Function
format_tags
(path, tag_map)
XLNET_BILSTM_CRF/utils.py:78
↓ 1 callers
Method
forward
(self, sents_tensor, lengths)
BILSTM_CRF/bilstm_crf.py:190
↓ 1 callers
Method
forward
(self, sents_tensor, lengths)
BILSTM/bilstm.py:22
↓ 1 callers
Method
forward
(self, input_ids, attention_mask=None, token_type_ids=None, position_ids=None, head_mask=None)
BERT_CRF/models/transformers/modeling_roberta.py:171
↓ 1 callers
Method
from_dict
Constructs a `BertConfig` from a Python dictionary of parameters.
BERT_BILSTM_CRF/bert/modeling.py:83
↓ 1 callers
Method
from_dict
Constructs a `Config` from a Python dictionary of parameters.
BERT_CRF/models/transformers/configuration_utils.py:177
↓ 1 callers
Method
from_json_file
Constructs a `BertConfig` from a json file of parameters.
BERT_CRF/models/transformers/configuration_utils.py:185
↓ 1 callers
Function
gather_indexes
Gathers the vectors at the specific positions over a minibatch.
BERT_BILSTM_CRF/bert/run_pretraining.py:308
↓ 1 callers
Function
gelu
(x)
BERT_CRF/models/transformers/modeling_distilbert.py:49
↓ 1 callers
Function
gelu
GELU activation https://arxiv.org/abs/1606.08415 https://github.com/huggingface/pytorch-openai-transformer-lm/blob/master/model_pytorch.p
BERT_CRF/models/transformers/modeling_xlm.py:61
↓ 1 callers
Function
get_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_BILSTM_CRF/bert/modeling.py:280
↓ 1 callers
Function
get_assignment_map_from_checkpoint
Compute the union of the current variables and checkpoint variables.
XLNET_BILSTM_CRF/model_utils.py:266
↓ 1 callers
Method
get_batch
(self)
XLNET_BILSTM_CRF/xlnet_data_utils.py:147
↓ 1 callers
Method
get_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_BILSTM_CRF/bert/modeling.py:249
↓ 1 callers
Method
get_embedding_table
(self)
BERT_BILSTM_CRF/bert/modeling.py:260
↓ 1 callers
Function
get_entity_bio
Gets entities from sequence. note: BIO Args: seq (list): sequence of labels. Returns: list: list of (chunk_type, chun
BERT_CRF/processors/utils_ner.py:139
↓ 1 callers
Function
get_entity_bios
Gets entities from sequence. note: BIOS Args: seq (list): sequence of labels. Returns: list: list of (chunk_type, chu
BERT_CRF/processors/utils_ner.py:95
↓ 1 callers
Function
get_final_text
Project the tokenized prediction back to the original text.
BERT_BILSTM_CRF/bert/run_squad.py:927
↓ 1 callers
Method
get_fixlen_iter
(self, start=0)
BERT_CRF/models/transformers/tokenization_transfo_xl.py:310
↓ 1 callers
Function
get_from_cache
Given a URL, look for the corresponding dataset in the local cache. If it's not there, download it. Then return the path to the cached file.
BERT_CRF/models/transformers/file_utils.py:249
↓ 1 callers
Function
get_logger
(log_file)
BERT_BILSTM_CRF/utils.py:20
↓ 1 callers
Method
get_lr
(self)
BERT_CRF/callback/lr_finder.py:378
↓ 1 callers
Method
get_lr
(self)
BERT_CRF/callback/lr_scheduler.py:204
↓ 1 callers
Method
get_lr
(self, t_cur)
BERT_CRF/callback/lr_scheduler.py:455
↓ 1 callers
Method
get_lr
(self,step)
BERT_CRF/callback/lr_scheduler.py:524
↓ 1 callers
Function
get_masked_lm_output
Get loss and log probs for the masked LM.
BERT_BILSTM_CRF/bert/run_pretraining.py:240
↓ 1 callers
Function
get_masks
Generate hidden states mask, and optionally an attention mask.
BERT_CRF/models/transformers/modeling_xlm.py:72
↓ 1 callers
Function
get_next_sentence_output
Get loss and log probs for the next sentence prediction.
BERT_BILSTM_CRF/bert/run_pretraining.py:285
↓ 1 callers
Method
get_sent_stream
(self)
BERT_CRF/models/transformers/tokenization_transfo_xl.py:344
↓ 1 callers
Method
get_sent_stream
(self, path)
BERT_CRF/models/transformers/tokenization_transfo_xl.py:424
↓ 1 callers
Method
get_sequence_output
Returns: float32 Tensor in shape [len, bsz, d_model]. The last layer hidden representation of XLNet.
XLNET_BILSTM_CRF/xlnet.py:259
↓ 1 callers
Method
get_special_tokens_mask
Retrieves sequence ids from a token list that has no special tokens added. This method is called when adding special tokens using the
BERT_CRF/models/transformers/tokenization_utils.py:941
↓ 1 callers
Function
get_tasks
(task_names)
BERT_CRF/tools/download_clue_data.py:44
↓ 1 callers
Method
get_unreachable_ops
Finds all of the tensors in graph that are unreachable from outputs.
BERT_BILSTM_CRF/bert/modeling_test.py:194
↓ 1 callers
Function
hmm_train_eval
训练并评估hmm模型
HMM/evaluate.py:14
↓ 1 callers
Function
http_get
(url, temp_file, proxies=None)
BERT_CRF/models/transformers/file_utils.py:237
↓ 1 callers
Function
indexed
将targets中的数转化为在[T*T]大小序列中的索引,T是标注的种类
BILSTM_CRF/util.py:129
↓ 1 callers
Method
init_from_flags
(self, FLAGS)
XLNET_BILSTM_CRF/xlnet.py:58
↓ 1 callers
Method
init_from_json
(self, json_path)
XLNET_BILSTM_CRF/xlnet.py:62
↓ 1 callers
Function
input_fn_builder
Creates an `input_fn` closure to be passed to TPUEstimator.
BERT_BILSTM_CRF/bert/extract_features.py:100
↓ 1 callers
Function
iob2
Check that tags have a valid IOB format. Tags in IOB1 format are converted to IOB2.
BERT_BILSTM_CRF/data_utils.py:47
↓ 1 callers
Function
iob_iobes
IOB -> IOBES
BERT_BILSTM_CRF/data_utils.py:69
↓ 1 callers
Function
is_whitespace
(c)
BERT_BILSTM_CRF/bert/run_squad.py:232
↓ 1 callers
Method
iteration
(self)
XLNET_BILSTM_CRF/xlnet_data_utils.py:139
↓ 1 callers
Method
ja_tokenize
(self, text)
BERT_CRF/models/transformers/tokenization_xlm.py:596
↓ 1 callers
Function
layer_norm_and_dropout
Runs layer normalization followed by dropout.
BERT_BILSTM_CRF/bert/modeling.py:368
↓ 1 callers
Function
load_config
Load configuration of the model parameters are stored in json format
BERT_BILSTM_CRF/utils.py:137
↓ 1 callers
Method
load_data
(self)
XLNET_BILSTM_CRF/xlnet_data_utils.py:34
↓ 1 callers
Function
load_json
加载json文件 :param json_path: :param file_name: :return:
BERT_CRF/tools/common.py:188
↓ 1 callers
Function
load_tf_weights_in_albert
Load tf checkpoints in a pytorch model.
BERT_CRF/models/transformers/modeling_albert.py:21
↓ 1 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
BERT_BILSTM_CRF/bert/tokenization.py:121
↓ 1 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
BERT_CRF/models/transformers/tokenization_albert.py:69
↓ 1 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
BERT_CRF/models/transformers/tokenization_bert.py:89
↓ 1 callers
Method
log_prob
r""" Computes log probabilities for all :math:`n\_classes` From: https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/adaptive.py
BERT_CRF/models/transformers/modeling_transfo_xl_utilities.py:198
↓ 1 callers
Method
logits_layer
(self)
XLNET_BILSTM_CRF/main_xlnet_bilstm_crf.py:199
↓ 1 callers
Method
loss_layer
calculate crf loss :param project_logits: [1, num_steps, num_tags] :return: scalar loss
BERT_BILSTM_CRF/model.py:156
↓ 1 callers
Method
loss_layer
(self)
XLNET_BILSTM_CRF/main_xlnet_bilstm_crf.py:223
← previous
next →
301–400 of 1,299, ranked by callers