MCPcopy Create free account

hub / github.com/XingyanLee/Chinese-NER / functions

Functions86 in github.com/XingyanLee/Chinese-NER

↓ 5 callersFunctionextract
(sentence,tags)
src/utils.py:143
↓ 4 callersMethodrun_step
:param sess: session to run the batch :param is_train: a flag indicate if it is a train batch :param batch: a dict containing
src/model.py:462
↓ 3 callersMethodcreate_mapping
Create a mapping (item to ID / ID to item) from a dictionary. Items are ordered by decreasing frequency.
src/Helper.py:48
↓ 3 callersFunctionevaluate
(iterable, options=None)
src/conlleval.py:62
↓ 3 callersMethodload_sentences
Load sentences. A line must contain at least a word and its tag. Sentences are separated by empty lines.
src/Helper.py:305
↓ 3 callersMethodprepare_dataset
Prepare the dataset. Return a list of lists of dictionaries containing: - word indexes - word char indexes
src/Helper.py:389
↓ 3 callersMethodupdate_tag_scheme
Check and update sentences tagging scheme to IOB2. Only IOB1 and IOB2 schemes are accepted.
src/Helper.py:339
↓ 2 callersFunctioncalculate_metrics
(correct, guessed, total)
src/conlleval.py:150
↓ 2 callersMethodchar_mapping
Create a dictionary and a mapping of words, sorted by frequency.
src/Helper.py:363
↓ 2 callersMethodcreate_dico
Create a dictionary of items from a list of list of items.
src/Helper.py:33
↓ 2 callersMethodcreate_model
(self)
src/SeqLabeling.py:55
↓ 2 callersMethoddecode
:param logits: [batch_size, num_steps, num_tags]float32, logits :param lengths: [batch_size]int32, real length of each sequence
src/model.py:484
↓ 2 callersFunctionend_of_chunk
(prev_tag, tag, prev_type, type_)
src/conlleval.py:231
↓ 2 callersMethodevaluate
(self, name)
src/SeqLabeling.py:102
↓ 2 callersMethodevaluate_line
(self,sentence,rettype='NER')
src/SeqLabeling.py:136
↓ 2 callersMethodget_seg_features
Segment text with jieba features are represented in bies format s donates single word
src/Helper.py:147
↓ 2 callersMethodiobes_iob
IOBES -> IOB
src/Helper.py:113
↓ 2 callersMethoditer_batch
(self, shuffle=False)
src/Helper.py:500
↓ 2 callersMethodload_config
Load configuration of the model parameters are stored in json format
src/Arguments.py:116
↓ 2 callersFunctionmetrics
(counts)
src/conlleval.py:158
↓ 2 callersFunctionparse_args
(argv)
src/conlleval.py:40
↓ 2 callersFunctionparse_tag
(t)
src/conlleval.py:57
↓ 2 callersFunctionstart_of_chunk
(prev_tag, tag, prev_type, type_)
src/conlleval.py:256
↓ 1 callersMethodIDCNN_layer
:param idcnn_inputs: [batch_size, num_steps, emb_size] :return: [batch_size, num_steps, cnn_output_width]
src/model.py:234
↓ 1 callersMethodaugment_with_pretrained
Augment the dictionary with words that have a pretrained embedding. If `words` is None, we add every word that has a pretrained embed
src/Helper.py:416
↓ 1 callersMethodbiLSTM_layer
:param lstm_inputs: [batch_size, num_steps, emb_size] :return: [batch_size, num_steps, 2*lstm_dim]
src/model.py:204
↓ 1 callersFunctionclean
Clean current folder remove saved model and training log
src/utils.py:85
↓ 1 callersMethodconfig_model
(self,char_to_id,tag_to_id)
src/Arguments.py:76
↓ 1 callersMethodcreate_batch
(self,batch_size)
src/Helper.py:566
↓ 1 callersMethodcreate_feed_dict
:param is_train: Flag, True for train batch :param batch: list train/evaluate data :return: structured data to feed
src/model.py:443
↓ 1 callersMethodcreate_helper
(self,helper=None)
src/SeqLabeling.py:20
↓ 1 callersMethodcreate_maps
(self,map_file=None,lower=False)
src/Helper.py:530
↓ 1 callersMethodembedding_layer
:param char_inputs: one-hot encoding of sentence :param seg_inputs: segmentation feature :param config: wither use segmentati
src/model.py:179
↓ 1 callersMethodfull_to_half
Convert full-width character to half-width one
src/Helper.py:228
↓ 1 callersFunctionget_logger
(log_file)
src/utils.py:15
↓ 1 callersMethodinput_from_line
Take sentence data and return an input for the training or the evaluation function.
src/Helper.py:286
↓ 1 callersMethodiob2
Check that tags have a valid IOB format. Tags in IOB1 format are converted to IOB2.
src/Helper.py:66
↓ 1 callersMethodiob_iobes
IOB -> IOBES
src/Helper.py:88
↓ 1 callersMethodload_dev
(self, dev_file, lower, zeros)
src/Helper.py:511
↓ 1 callersMethodload_pretrained_emb
(self,emb_file)
src/Helper.py:527
↓ 1 callersMethodload_test
(self, test_file, lower, zeros)
src/Helper.py:514
↓ 1 callersMethodload_train
(self, train_file, lower, zeros)
src/Helper.py:508
↓ 1 callersMethodload_word2vec
Load word embedding from pre-trained file embedding size must match
src/Helper.py:178
↓ 1 callersMethodloss_layer
calculate crf loss :param project_logits: [1, num_steps, num_tags] :return: scalar loss
src/model.py:345
↓ 1 callersMethodlstm_decode_layer
calculate lstm decode loss :param project_logits: :param lengths: :param name: :return: loss
src/model.py:373
↓ 1 callersMethodlstm_decode_loss_layer
(self, lstm_outputs,bias,name=None)
src/model.py:426
↓ 1 callersFunctionmain
(argv)
src/conlleval.py:287
↓ 1 callersFunctionmake_path
Make folders for training and evaluation
src/utils.py:71
↓ 1 callersMethodnormalize
(self,inputs, epsilon = 1e-8,scope="ln",reuse=None)
src/model.py:141
↓ 1 callersMethodpad_data
(data)
src/Helper.py:485
↓ 1 callersMethodprint_config
Print configuration of the model
src/Arguments.py:100
↓ 1 callersMethodproject_layer_bilstm
hidden layer between lstm layer and logits :param lstm_outputs: [batch_size, num_steps, emb_size] :return: [batch_size, num_
src/model.py:297
↓ 1 callersMethodproject_layer_idcnn
:param lstm_outputs: [batch_size, num_steps, emb_size] :return: [batch_size, num_steps, num_tags]
src/model.py:327
↓ 1 callersMethodreplace_html
(s)
src/Helper.py:273
↓ 1 callersFunctionreport
(counts, out=None)
src/conlleval.py:171
↓ 1 callersFunctionreport_notprint
(counts, out=None)
src/conlleval.py:197
↓ 1 callersMethodrestore_model
(self)
src/SeqLabeling.py:126
↓ 1 callersFunctionreturn_report
(input_file)
src/conlleval.py:281
↓ 1 callersMethodsave_config
Save configuration of the model parameters are stored in json format
src/Arguments.py:107
↓ 1 callersMethodsave_model
(self)
src/SeqLabeling.py:51
↓ 1 callersMethodsort_and_pad
(self, data, batch_size)
src/Helper.py:476
↓ 1 callersMethodtag_mapping
Create a dictionary and a mapping of tags, sorted by frequency.
src/Helper.py:378
↓ 1 callersFunctiontest_ner
Run perl script to evaluate model
src/utils.py:53
↓ 1 callersMethodtf_apps
(self,FLAGS)
src/Arguments.py:51
↓ 1 callersMethodtrain
(self)
src/SeqLabeling.py:71
↓ 1 callersFunctionuniq
(iterable)
src/conlleval.py:145
↓ 1 callersMethodzero_digits
Replace every digit in a string by a zero.
src/Helper.py:59
Method__init__
(self)
src/Arguments.py:15
Method__init__
(self)
src/conlleval.py:27
Method__init__
(self,args)
src/SeqLabeling.py:13
Method__init__
(self, data, batch_size)
src/Helper.py:472
Method__init__
(self, config ,graph)
src/model.py:14
Methodbody
(i,state,outputs)
src/model.py:392
Functionconvert_to_text
Convert conll data to text
src/utils.py:120
Methodcreate_input
Take sentence data and return an input for the training or the evaluation function.
src/Helper.py:166
Methodcut_to_sentence
Cut text to sentences
src/Helper.py:244
Methoddicts
(self,dicts)
src/Arguments.py:63
Methodevaluate
:param sess: session to run the model :param data: list of data :param id_to_tag: index to tag name :return: evalua
src/model.py:505
Methodevaluate_line
(self, sess, inputs, id_to_tag)
src/model.py:539
Methodf
(x)
src/Helper.py:398
Methodinsert_singletons
Replace singletons by the unknown word with a probability p.
src/Helper.py:134
Methodload_maps
Load mappings from the file
src/Helper.py:462
Functionmain
(_)
src/main.py:83
Methodsave_maps
Save mappings and invert mappings
src/Helper.py:453
Methodselect_tag_schema
tags classes can switch (IOB / IOBES) :param tags: :return:
src/Helper.py:517
Methodself_attention
(self,keys, scope='multihead_attention', reuse=None)
src/model.py:152