Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Marilynmontu/ChineseNER-pytorch
/ functions
Functions
27 in github.com/Marilynmontu/ChineseNER-pytorch
⨍
Functions
27
◇
Types & classes
5
↓ 3 callers
Function
load_data
(file_path, max_length, label_dic, vocab)
utils.py:45
↓ 2 callers
Method
_viterbi_decode
Args: feats: size=(batch_size, seq_len, self.target_size+2) mask: size=(batch_size, seq_len) Returns:
model/crf.py:89
↓ 2 callers
Function
get_ner_BMES
(label_list)
utils.py:143
↓ 2 callers
Method
get_output_score
(self, sentence, attention_mask=None)
model/bert_lstm_crf.py:39
↓ 2 callers
Function
load_vocab
Loads a vocabulary file into a dictionary.
utils.py:13
↓ 2 callers
Function
log_sum_exp
Args: vec: size=(batch_size, vanishing_dim, hidden_dim) m_size: hidden_dim Returns: size=(batch_size, hidden_dim)
model/crf.py:8
↓ 2 callers
Function
recover_label
(pred_var, gold_var, l2i_dic, i2l_dic)
utils.py:73
↓ 1 callers
Method
__init__
(self, input_size, filters, kernel_size=3, num_block=4)
model/cnn.py:35
↓ 1 callers
Method
_forward_alg
Do the forward algorithm to compute the partition function (batched). Args: feats: size=(batch_size, seq_len, self.targe
model/crf.py:43
↓ 1 callers
Method
_score_sentence
Args: scores: size=(seq_len, batch_size, tag_size, tag_size) mask: size=(batch_size, seq_len) tags: size=
model/crf.py:173
↓ 1 callers
Function
evaluate
(medel, dev_loader)
train.py:46
↓ 1 callers
Function
get_ner_fmeasure
(golden_lists, predict_lists, label_type="BMES")
utils.py:92
↓ 1 callers
Function
load_file
(file_path)
utils.py:27
↓ 1 callers
Method
neg_log_likelihood_loss
Args: feats: size=(batch_size, seq_len, tag_size) mask: size=(batch_size, seq_len) tags: size=(batch_size
model/crf.py:212
↓ 1 callers
Method
rand_init_hidden
(self, batch_size)
model/bert_lstm_crf.py:29
↓ 1 callers
Function
reverse_style
(input_string)
utils.py:137
Method
__init__
(self, text, label, input_id, label_id, input_mask)
utils.py:6
Method
__init__
(self, features, eps=1e-6)
model/cnn.py:72
Method
__init__
Args: target_size: int, target size use_cuda: bool, 是否使用gpu, default is True average_batch: bool, loss是否作
model/crf.py:25
Method
__init__
(self, bert_config, tagset_size, embedding_dim, hidden_dim, rnn_layers, dropout_ratio, dropout1, use_cuda)
model/bert_lstm_crf.py:11
Method
forward
(self, embeddings, length)
model/cnn.py:64
Method
forward
(self, x)
model/cnn.py:78
Method
forward
(self, feats, mask=None)
model/crf.py:169
Method
forward
(self, sentence, masks)
model/bert_lstm_crf.py:56
Function
load_model
(path, model)
utils.py:193
Method
neg_log_likelihood_loss
(self, sentence, mask, tags)
model/bert_lstm_crf.py:61
Function
save_model
(path, model, epoch)
utils.py:190