Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ShomyLiu/pytorch-relation-extraction
/ functions
Functions
64 in github.com/ShomyLiu/pytorch-relation-extraction
⨍
Functions
64
◇
Types & classes
8
↓ 15 callers
Method
save
保存模型,默认使用“模型名字+时间”作为文件名
models/BasicModule.py:22
↓ 6 callers
Method
load
可加载指定路径的模型
models/BasicModule.py:16
↓ 6 callers
Function
now
()
utils.py:7
↓ 2 callers
Method
get_batch_feature
Using Attention to get all bags embedding in a batch
models/PCNN_ATT.py:177
↓ 2 callers
Method
parse_sen
parse the records in data
dataset/nyt.py:100
↓ 2 callers
Method
parse_sen
parse the records in data
dataset/filternyt.py:106
↓ 2 callers
Function
save_pr
(out_dir, name, epoch, pre, rec, fp_res=None, opt=None)
utils.py:11
↓ 1 callers
Function
eval_metric
calculate the precision and recall for p-r curve reglect the NA relation
utils.py:29
↓ 1 callers
Function
eval_metric_var
Apply the evalation method in Lin 2016
main_att.py:118
↓ 1 callers
Method
fit
train process
models/PCNN_ATT.py:145
↓ 1 callers
Method
get_bags_feature
get all bags embedding in one batch before Attention
models/PCNN_ATT.py:193
↓ 1 callers
Method
get_ins_emb
x: all instance in a Bag
models/PCNN_ATT.py:209
↓ 1 callers
Method
get_pad_sen
padding the sentences
dataset/filternyt.py:172
↓ 1 callers
Method
get_pad_sen_pos
refer: github.com/SharmisthaJat/RE-DS-Word-Attention-Models
dataset/nyt.py:192
↓ 1 callers
Method
get_pos_feature
clip the postion range: : -limit ~ limit => 0 ~ limit * 2+2 : -51 => 1 : -50 => 1 : 50 => 101 : >50:
dataset/filternyt.py:184
↓ 1 callers
Method
get_sentence_feature
: word embedding : postion embedding return: sen list pos_left pos_right
dataset/nyt.py:164
↓ 1 callers
Method
get_sentence_feature
: word embedding : postion embedding return: sen list pos_left pos_right
dataset/filternyt.py:147
↓ 1 callers
Function
init
dataset/extract.cpp:74
↓ 1 callers
Method
init_model_weight
use xavier to init
models/PCNN_ATT.py:56
↓ 1 callers
Method
init_model_weight
use xavier to init
models/PCNN_ONE.py:47
↓ 1 callers
Method
init_word_emb
(self)
models/PCNN_ATT.py:66
↓ 1 callers
Method
init_word_emb
(self)
models/PCNN_ONE.py:58
↓ 1 callers
Method
load_p2v
(self)
dataset/nyt.py:67
↓ 1 callers
Method
load_p2v
(self)
dataset/filternyt.py:68
↓ 1 callers
Method
load_w2v
reading from vec.bin add two extra tokens: : UNK for unkown tokens
dataset/nyt.py:74
↓ 1 callers
Method
load_w2v
reading from vec.bin add two extra tokens: : UNK for unkown tokens : BLANK for the max len sentence
dataset/filternyt.py:76
↓ 1 callers
Method
mask_piece_pooling
refer: https://github.com/thunlp/OpenNRE A fast piecewise pooling using mask
models/PCNN_ATT.py:97
↓ 1 callers
Method
mask_piece_pooling
refer: https://github.com/thunlp/OpenNRE A fast piecewise pooling using mask
models/PCNN_ONE.py:80
↓ 1 callers
Function
predict
(model, test_data_loader)
main_mil.py:159
↓ 1 callers
Function
predict_var
Apply the prediction method in Lin 2016
main_att.py:88
↓ 1 callers
Function
select_instance
(model, batch_data, labels)
main_mil.py:107
↓ 1 callers
Function
setup_seed
(seed)
main_mil.py:24
↓ 1 callers
Method
test
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
Function
collate_fn
custom for DataLoader
main_att.py:12
Function
collate_fn
(batch)
main_mil.py:15
Method
forward
(self, x, label=None)
models/PCNN_ATT.py:131
Method
forward
(self, x, train=False)
models/PCNN_ONE.py:112
Method
get_pad_sen
padding the sentences
dataset/nyt.py:275
Method
get_pos_feature
clip the postion range: : -limit ~ limit => 0 ~ limit * 2+2 : -51 => 1 : -50 => 1 : 50 => 101 : >50:
dataset/nyt.py:287
Method
init_int_constant
a util function for generating a LongTensor Variable
models/PCNN_ATT.py:88
Function
main
dataset/extract.cpp:416
Method
p_2norm
(path)
models/PCNN_ATT.py:68
Method
p_2norm
(path)
models/PCNN_ONE.py:60
Method
padding
(x)
dataset/nyt.py:297
Method
padding
(x)
dataset/filternyt.py:194
Function
parse
user can update the default hyperparamter
config.py:70
Method
piece_max_pooling
piecewise pool into 3 segements x: the batch data insPool: the batch Pool
models/PCNN_ATT.py:108
Method
piece_max_pooling
old version piecewise
models/PCNN_ONE.py:92
Function
predict
Apply the prediction method in Zeng 2015
main_att.py:144
Function
test
(**kwargs)
main_att.py:20
Function
test
(**kwargs)
main_mil.py:20
Function
train
(**kwargs)
main_att.py:24
Function
train
(**kwargs)
main_mil.py:31