Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mo-81 opened this issue May 22, 2023 · 1 comment
Open

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

mo-81 opened this issue May 22, 2023 · 1 comment

Comments

@mo-81
Copy link

mo-81 commented May 22, 2023

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
[]

@Fanhr
Copy link

Fanhr commented Jul 11, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants