1 Star 0 Fork 0

万洪江/EXTRACTOR

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.py 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
kia 提交于 2021-02-25 10:23 . from pycharm
from preprocessings import *
from role_generator import *
from graph_generator import *
from lists_patterns import load_lists, fpath
parser = argparse.ArgumentParser()
parser.add_argument('--asterisk', type=str, default='true', help='asterisk task (true, false)')
parser.add_argument('--crf', type=str, default='true', help='crf task (true, false)')
parser.add_argument('--rmdup', type=str, default='true', help='remove duplicate task (true, false)')
parser.add_argument('--elip', type=str, default='false', help='ellipsis resolution (true, false)')
parser.add_argument('--gname', type=str, default='graph', help='graph name')
parser.add_argument('--input_file', type=str, help='input file')
args = parser.parse_args()
print(args)
if __name__=="__main__":
txt = modification_()
txt = txt.strip()
txt = colon_seprator_multiplication(txt)
txt = re.sub(' +', ' ', txt)
sentences_ = sent_tokenize(txt)
lst = roles(sentences_)
lst = fix_srl_spacing(lst)
all_nodes = negation_clauses(lst)
if args.asterisk == 'true':
all_nodes = astriks(all_nodes)
all_nodes = triplet_builder(all_nodes)
else:
all_nodes = triplet_builder(all_nodes)
all_nodes = remove_no_sub(all_nodes)
lst = remove_c_colon_toprevent_graphvizbug(all_nodes)
for i in lst:
if "\\'" in i:
i.replace("\\'", "'")
if args.rmdup == "true":
lst = rm_duplictes(lst)
graph_builder(lst)
else:
graph_builder(lst)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wanhjkeyouth/EXTRACTOR.git
git@gitee.com:wanhjkeyouth/EXTRACTOR.git
wanhjkeyouth
EXTRACTOR
EXTRACTOR
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385