MCPcopy Create free account

hub / github.com/ShomyLiu/pytorch-relation-extraction / functions

Functions64 in github.com/ShomyLiu/pytorch-relation-extraction

↓ 15 callersMethodsave
保存模型,默认使用“模型名字+时间”作为文件名
models/BasicModule.py:22
↓ 6 callersMethodload
可加载指定路径的模型
models/BasicModule.py:16
↓ 6 callersFunctionnow
()
utils.py:7
↓ 2 callersMethodget_batch_feature
Using Attention to get all bags embedding in a batch
models/PCNN_ATT.py:177
↓ 2 callersMethodparse_sen
parse the records in data
dataset/nyt.py:100
↓ 2 callersMethodparse_sen
parse the records in data
dataset/filternyt.py:106
↓ 2 callersFunctionsave_pr
(out_dir, name, epoch, pre, rec, fp_res=None, opt=None)
utils.py:11
↓ 1 callersFunctioneval_metric
calculate the precision and recall for p-r curve reglect the NA relation
utils.py:29
↓ 1 callersFunctioneval_metric_var
Apply the evalation method in Lin 2016
main_att.py:118
↓ 1 callersMethodfit
train process
models/PCNN_ATT.py:145
↓ 1 callersMethodget_bags_feature
get all bags embedding in one batch before Attention
models/PCNN_ATT.py:193
↓ 1 callersMethodget_ins_emb
x: all instance in a Bag
models/PCNN_ATT.py:209
↓ 1 callersMethodget_pad_sen
padding the sentences
dataset/filternyt.py:172
↓ 1 callersMethodget_pad_sen_pos
refer: github.com/SharmisthaJat/RE-DS-Word-Attention-Models
dataset/nyt.py:192
↓ 1 callersMethodget_pos_feature
clip the postion range: : -limit ~ limit => 0 ~ limit * 2+2 : -51 => 1 : -50 => 1 : 50 => 101 : >50:
dataset/filternyt.py:184
↓ 1 callersMethodget_sentence_feature
: word embedding : postion embedding return: sen list pos_left pos_right
dataset/nyt.py:164
↓ 1 callersMethodget_sentence_feature
: word embedding : postion embedding return: sen list pos_left pos_right
dataset/filternyt.py:147
↓ 1 callersFunctioninit
dataset/extract.cpp:74
↓ 1 callersMethodinit_model_weight
use xavier to init
models/PCNN_ATT.py:56
↓ 1 callersMethodinit_model_weight
use xavier to init
models/PCNN_ONE.py:47
↓ 1 callersMethodinit_word_emb
(self)
models/PCNN_ATT.py:66
↓ 1 callersMethodinit_word_emb
(self)
models/PCNN_ONE.py:58
↓ 1 callersMethodload_p2v
(self)
dataset/nyt.py:67
↓ 1 callersMethodload_p2v
(self)
dataset/filternyt.py:68
↓ 1 callersMethodload_w2v
reading from vec.bin add two extra tokens: : UNK for unkown tokens
dataset/nyt.py:74
↓ 1 callersMethodload_w2v
reading from vec.bin add two extra tokens: : UNK for unkown tokens : BLANK for the max len sentence
dataset/filternyt.py:76
↓ 1 callersMethodmask_piece_pooling
refer: https://github.com/thunlp/OpenNRE A fast piecewise pooling using mask
models/PCNN_ATT.py:97
↓ 1 callersMethodmask_piece_pooling
refer: https://github.com/thunlp/OpenNRE A fast piecewise pooling using mask
models/PCNN_ONE.py:80
↓ 1 callersFunctionpredict
(model, test_data_loader)
main_mil.py:159
↓ 1 callersFunctionpredict_var
Apply the prediction method in Lin 2016
main_att.py:88
↓ 1 callersFunctionselect_instance
(model, batch_data, labels)
main_mil.py:107
↓ 1 callersFunctionsetup_seed
(seed)
main_mil.py:24
↓ 1 callersMethodtest
test process
models/PCNN_ATT.py:160
Method__getitem__
(self, idx)
dataset/nyt.py:24
Method__getitem__
(self, idx)
dataset/filternyt.py:24
Method__init__
(self, root_path, train=True)
dataset/nyt.py:10
Method__init__
(self, root_path, max_len=80, limit=50, pos_dim=5, pad=1)
dataset/nyt.py:36
Method__init__
(self, root_path, train=True)
dataset/filternyt.py:10
Method__init__
(self, root_path, max_len=80, limit=50, pos_dim=5, pad=1)
dataset/filternyt.py:36
Method__init__
(self)
models/BasicModule.py:12
Method__init__
(self, opt)
models/PCNN_ATT.py:15
Method__init__
(self, opt)
models/PCNN_ONE.py:14
Method__len__
(self)
dataset/nyt.py:28
Method__len__
(self)
dataset/filternyt.py:28
Functioncollate_fn
custom for DataLoader
main_att.py:12
Functioncollate_fn
(batch)
main_mil.py:15
Methodforward
(self, x, label=None)
models/PCNN_ATT.py:131
Methodforward
(self, x, train=False)
models/PCNN_ONE.py:112
Methodget_pad_sen
padding the sentences
dataset/nyt.py:275
Methodget_pos_feature
clip the postion range: : -limit ~ limit => 0 ~ limit * 2+2 : -51 => 1 : -50 => 1 : 50 => 101 : >50:
dataset/nyt.py:287
Methodinit_int_constant
a util function for generating a LongTensor Variable
models/PCNN_ATT.py:88
Functionmain
dataset/extract.cpp:416
Methodp_2norm
(path)
models/PCNN_ATT.py:68
Methodp_2norm
(path)
models/PCNN_ONE.py:60
Methodpadding
(x)
dataset/nyt.py:297
Methodpadding
(x)
dataset/filternyt.py:194
Functionparse
user can update the default hyperparamter
config.py:70
Methodpiece_max_pooling
piecewise pool into 3 segements x: the batch data insPool: the batch Pool
models/PCNN_ATT.py:108
Methodpiece_max_pooling
old version piecewise
models/PCNN_ONE.py:92
Functionpredict
Apply the prediction method in Zeng 2015
main_att.py:144
Functiontest
(**kwargs)
main_att.py:20
Functiontest
(**kwargs)
main_mil.py:20
Functiontrain
(**kwargs)
main_att.py:24
Functiontrain
(**kwargs)
main_mil.py:31