lightKG/examples/test_re.py

16 lines
686 B
Python
Raw Permalink Normal View History

from lightkg.ere import RE
re = RE()
train_path = '/home/lightsmile/Projects/NLP/ChineseNRE/data/people-relation/train.sample.txt'
dev_path = '/home/lightsmile/Projects/NLP/ChineseNRE/data/people-relation/test.sample.txt'
vec_path = '/home/lightsmile/NLP/embedding/word/sgns.zhihu.bigram-char'
# re.train(train_path, dev_path=train_path, vectors_path=vec_path, save_path='./re_saves')
re.load('./re_saves')
# re.test(train_path)
# 钱钟书 辛笛 同门 与辛笛京沪唱和聽钱钟书与钱钟书是清华校友,钱钟书高辛笛两班。
print(re.predict('钱钟书', '辛笛', '与辛笛京沪唱和聽钱钟书与钱钟书是清华校友,钱钟书高辛笛两班。'))