1 Star 0 Fork 2

dongjiaceo/知识图谱推理

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
get_result.py 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
young-rich 提交于 2022-07-27 16:27 . 添加了多分类的模型代码
import pandas as pd
df_result1 = pd.read_pickle(
'/home/yx/project/P_prediction/ccks_1_sbert/data/result_hfl-chinese-electra-180g-base-discriminator.pkl')
df_result2 = pd.read_pickle(
'/home/yx/project/P_prediction/ccks_1_sbert/data/result_hfl-chinese-macbert-base.pkl')
# df_result3 = pd.read_pickle('/home/yx/project/P_prediction/ccks_1_sbert/data/result_peterchou-nezha-chinese-base.pkl')
df_result4 = pd.read_pickle(
'/home/yx/project/P_prediction/ccks_1_sbert/data/result_hfl-chinese-roberta-wwm-ext.pkl')
df_result5 = pd.read_pickle(
'/home/yx/project/P_prediction/ccks_1_sbert/data/result_hfl-chinese-bert-wwm-ext.pkl')
df_result = df_result1.salience.values + df_result2.salience.values + \
df_result4.salience.values + df_result5.salience.values
ids = []
label = []
for id, result, in zip(df_result1.triple_id.values, df_result):
if result > 2:
label.append(1)
else:
label.append(0)
ids.append(id)
pd.DataFrame({'salience': label, 'triple_id': ids}).to_json(
'/home/yx/project/P_prediction/ccks_1_sbert/data/result_4_2.jsonl', orient='records', lines=True)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ecpbid/knowledge-map-reasoning.git
git@gitee.com:ecpbid/knowledge-map-reasoning.git
ecpbid
knowledge-map-reasoning
知识图谱推理
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385