cntext icon indicating copy to clipboard operation
cntext copied to clipboard

DUTIR字典”怒“对应的列表为空

Open mo-81 opened this issue 1 year ago • 1 comments

print(ct.__version__)
diction = ct.load_pkl_dict("DUTIR.pkl")
for key in diction['DUTIR'].keys():
    print(key, len(diction['DUTIR'][key]))
print(diction['DUTIR']['怒'])

1.8.4 乐 1967 好 11107 怒 0 哀 2314 惧 1179 恶 10282 惊 228 []

mo-81 avatar May 22 '23 12:05 mo-81

我复现了大邓构建pkl词典的过程,发现问题可能是由于“怒”的编码为“NA”导致pd.read_excel()函数将所有愤怒词的分类理解为空,可以在其中添加参数keep_default_na = True。

Fanhr avatar Jul 11 '23 01:07 Fanhr