Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/autoliuweijie/K-BERT
/ functions
Functions
198 in github.com/autoliuweijie/K-BERT
⨍
Functions
198
◇
Types & classes
52
↓ 27 callers
Method
get
(self, w)
uer/utils/vocab.py:49
↓ 20 callers
Method
load
(self, vocab_path, is_quiet=False)
uer/utils/vocab.py:26
↓ 14 callers
Method
tokenize
(self, text)
uer/utils/tokenizer.py:14
↓ 11 callers
Function
set_seed
(seed=7)
uer/utils/seed.py:6
↓ 9 callers
Function
save_model
(model, model_path)
uer/model_saver.py:6
↓ 9 callers
Method
step
Performs a single optimization step. Arguments: closure (callable, optional): A closure that reevaluates the model
uer/utils/optimizers.py:85
↓ 7 callers
Function
merge_dataset
(dataset_path, workers_num, instances_buffer_size)
uer/utils/data.py:40
↓ 4 callers
Method
add_knowledge_with_vm
input: sent_batch - list of sentences, e.g., ["abcd", "efgh"] return: know_sent_batch - list of sentences with entites embedding
brain/knowgraph.py:44
↓ 3 callers
Function
batch_loader
(batch_size, input_ids, label_ids, mask_ids, pos_ids, vms)
run_kbert_cls.py:276
↓ 3 callers
Function
build_model
Build universial encoder representations models. The combinations of different embedding, encoder, and target layers yield pretrained mo
uer/model_builder.py:24
↓ 3 callers
Function
evaluate
(args, is_test)
run_kbert_ner.py:251
↓ 3 callers
Function
evaluate
(args, is_test, metrics='Acc')
run_kbert_cls.py:330
↓ 3 callers
Function
gelu
(x)
uer/utils/act_fun.py:5
↓ 3 callers
Function
read_dataset
(path)
run_kbert_ner.py:216
↓ 3 callers
Function
read_dataset
(path, workers_num=1)
run_kbert_cls.py:301
↓ 3 callers
Function
whitespace_tokenize
Runs basic whitespace cleaning and splitting on a piece of text.
uer/utils/tokenizer.py:39
↓ 2 callers
Method
__init__
(self, args)
uer/utils/tokenizer.py:11
↓ 2 callers
Function
batch_loader
(batch_size, input_ids, label_ids, mask_ids, pos_ids, vm_ids, tag_ids)
run_kbert_ner.py:196
↓ 2 callers
Method
build_instances
(self, all_documents)
uer/utils/data.py:156
↓ 2 callers
Function
flip
(x, dim)
uer/utils/misc.py:6
↓ 2 callers
Method
init_hidden
(self, batch_size, device)
uer/encoders/birnn_encoder.py:44
↓ 2 callers
Function
load_hyperparam
(args)
uer/utils/config.py:5
↓ 2 callers
Function
mask_seq
Mask input sequence for MLM task. args: src: a list of token ids.
uer/utils/data.py:12
↓ 2 callers
Method
save
(self, save_path)
uer/utils/vocab.py:42
↓ 2 callers
Function
worker
Args: gpu_id: The id of GPU for single GPU mode; The id of process (and GPU) for multiprocessing distributed mode. gp
uer/trainer.py:53
↓ 1 callers
Method
__init__
(self, args)
uer/encoders/rnn_encoder.py:44
↓ 1 callers
Method
__init__
(self, args)
uer/encoders/mixed_encoder.py:7
↓ 1 callers
Method
__init__
(self, args)
uer/encoders/cnn_encoder.py:7
↓ 1 callers
Method
_clean_text
Performs invalid character removal and whitespace cleanup on text.
uer/utils/tokenizer.py:210
↓ 1 callers
Method
_create_lookup_table
(self)
brain/knowgraph.py:24
↓ 1 callers
Method
_empty
(self)
uer/utils/data.py:301
↓ 1 callers
Method
_empty
(self)
uer/utils/data.py:450
↓ 1 callers
Method
_empty
(self)
uer/utils/data.py:599
↓ 1 callers
Method
_empty
(self)
uer/utils/data.py:771
↓ 1 callers
Method
_empty
(self)
uer/utils/data.py:912
↓ 1 callers
Method
_empty
(self)
uer/utils/data.py:1148
↓ 1 callers
Method
_empty
(self)
uer/utils/data.py:1293
↓ 1 callers
Method
_fill_buf
(self)
uer/utils/data.py:284
↓ 1 callers
Method
_fill_buf
(self)
uer/utils/data.py:433
↓ 1 callers
Method
_fill_buf
(self)
uer/utils/data.py:582
↓ 1 callers
Method
_fill_buf
(self)
uer/utils/data.py:754
↓ 1 callers
Method
_fill_buf
(self)
uer/utils/data.py:895
↓ 1 callers
Method
_fill_buf
(self)
uer/utils/data.py:1131
↓ 1 callers
Method
_fill_buf
(self)
uer/utils/data.py:1276
↓ 1 callers
Method
_is_chinese_char
Checks whether CP is the codepoint of a CJK character.
uer/utils/tokenizer.py:188
↓ 1 callers
Function
_is_control
Checks whether `chars` is a control character.
uer/utils/tokenizer.py:292
↓ 1 callers
Function
_is_punctuation
Checks whether `chars` is a punctuation character.
uer/utils/tokenizer.py:304
↓ 1 callers
Function
_is_whitespace
Checks whether `chars` is a whitespace character.
uer/utils/tokenizer.py:280
↓ 1 callers
Method
_run_split_on_punc
Splits punctuation on a piece of text.
uer/utils/tokenizer.py:153
↓ 1 callers
Method
_run_strip_accents
Strips accents from a piece of text.
uer/utils/tokenizer.py:142
↓ 1 callers
Method
_tokenize_chinese_chars
Adds whitespace around any CJK character.
uer/utils/tokenizer.py:175
↓ 1 callers
Function
add_knowledge_worker
(params)
run_kbert_cls.py:67
↓ 1 callers
Method
build_instances
(self, all_documents)
uer/utils/data.py:1009
↓ 1 callers
Function
count_line
(corpus_path)
uer/utils/vocab.py:8
↓ 1 callers
Function
count_lines
(file_path)
uer/utils/data.py:60
↓ 1 callers
Method
create_ins_from_doc
(self, all_documents, document_index)
uer/utils/data.py:163
↓ 1 callers
Method
create_ins_from_doc
(self, all_documents, document_index)
uer/utils/data.py:1015
↓ 1 callers
Method
init_hidden
(self, batch_size, device)
uer/encoders/rnn_encoder.py:34
↓ 1 callers
Method
init_hidden
(self, batch_size, device)
uer/encoders/rnn_encoder.py:71
↓ 1 callers
Method
init_hidden
(self, batch_size, device)
uer/encoders/mixed_encoder.py:48
↓ 1 callers
Method
init_hidden
(self, batch_size, device)
uer/encoders/mixed_encoder.py:93
↓ 1 callers
Function
main
()
run_kbert_ner.py:74
↓ 1 callers
Function
main
()
run_kbert_cls.py:146
↓ 1 callers
Method
mlm
(self, memory_bank, tgt_mlm)
uer/targets/bert_target.py:31
↓ 1 callers
Method
mlm
(self, memory_bank, tgt_mlm)
uer/targets/mlm_target.py:27
↓ 1 callers
Method
truncate_seq_pair
truncate sequence pair to specific length
uer/utils/data.py:252
↓ 1 callers
Method
truncate_seq_pair
truncate sequence pair to specific length
uer/utils/data.py:1100
↓ 1 callers
Method
union
Union vocab in all workers.
uer/utils/vocab.py:87
↓ 1 callers
Function
word2sub
word_ids: batch_size, seq_length
uer/utils/subword.py:7
↓ 1 callers
Method
worker
(self, proc_id, start, end)
uer/utils/data.py:110
↓ 1 callers
Method
worker
(self, proc_id, start, end)
uer/utils/data.py:372
↓ 1 callers
Method
worker
(self, proc_id, start, end)
uer/utils/data.py:519
↓ 1 callers
Method
worker
(self, proc_id, start, end)
uer/utils/data.py:671
↓ 1 callers
Method
worker
(self, proc_id, start, end)
uer/utils/data.py:841
↓ 1 callers
Method
worker
(self, proc_id, start, end)
uer/utils/data.py:978
↓ 1 callers
Method
worker
(self, proc_id, start, end)
uer/utils/data.py:1216
Method
__del__
(self)
uer/utils/data.py:304
Method
__del__
(self)
uer/utils/data.py:453
Method
__del__
(self)
uer/utils/data.py:602
Method
__del__
(self)
uer/utils/data.py:774
Method
__del__
(self)
uer/utils/data.py:915
Method
__del__
(self)
uer/utils/data.py:1151
Method
__del__
(self)
uer/utils/data.py:1296
Method
__init__
(self, args, model)
run_kbert_ner.py:23
Method
__init__
(self, args, model)
run_kbert_cls.py:26
Method
__init__
(self, spo_files, predicate=False)
brain/knowgraph.py:16
Method
__init__
(self, args)
uer/utils/tokenizer.py:20
Method
__init__
(self, args)
uer/utils/tokenizer.py:29
Method
__init__
Constructs a BertTokenizer. Args: vocab_file: Path to a one-wordpiece-per-line vocabulary file do_lower_case: Whether to l
uer/utils/tokenizer.py:51
Method
__init__
Constructs a BasicTokenizer. Args: do_lower_case: Whether to lower case the input.
uer/utils/tokenizer.py:111
Method
__init__
(self, vocab, unk_token="[UNK]", max_input_chars_per_word=100)
uer/utils/tokenizer.py:227
Method
__init__
(self)
uer/utils/vocab.py:19
Method
__init__
(self, args, vocab, tokenizer)
uer/utils/data.py:75
Method
__init__
(self, args, dataset_path, batch_size, proc_id, proc_num, shuffle=False)
uer/utils/data.py:271
Method
__init__
(self, args, vocab, tokenizer)
uer/utils/data.py:341
Method
__init__
(self, args, dataset_path, batch_size, proc_id, proc_num, shuffle=False)
uer/utils/data.py:421
Method
__init__
(self, args, vocab, tokenizer)
uer/utils/data.py:488
Method
__init__
(self, args, dataset_path, batch_size, proc_id, proc_num, shuffle=False)
uer/utils/data.py:570
Method
__init__
(self, args, vocab, tokenizer)
uer/utils/data.py:640
Method
__init__
(self, args, dataset_path, batch_size, proc_id, proc_num, shuffle=False)
uer/utils/data.py:742
next →
1–100 of 198, ranked by callers