pke_zh icon indicating copy to clipboard operation
pke_zh copied to clipboard

node array from the pickle has an incompatible dtype

Open ChaoZhou2023 opened this issue 10 months ago • 2 comments

本地安装安装后读取默认pkl遇到

  • expected: {'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', 'n_node_samples', 'weighted_n_node_samples', 'missing_go_to_left'], 'formats': ['<i8', '<i8', '<i8', '<f8', '<f8', '<i8', '<f8', 'u1'], 'offsets': [0, 8, 16, 24, 32, 40, 48, 56], 'itemsize': 64}
  • got : [('left_child', '<i8'), ('right_child', '<i8'), ('feature', '<i8'), ('threshold', '<f8'), ('impurity', '<f8'), ('n_node_samples', '<i8'), ('weighted_n_node_samples', '<f8')] 应该是版本问题,希望更新一下requirements

ChaoZhou2023 avatar Mar 26 '24 06:03 ChaoZhou2023

测试了python3.8,python3.9, python3.10的都可以运行执行。

from pke_zh import TextRank
sents = [
        "哪里下载电视剧周恩来?",]
TextRank_m = TextRank()
    for q in sents:
        print(q)
        r = TextRank_m.extract(q)
        print('TextRank:', r)

shibing624 avatar Mar 26 '24 11:03 shibing624

测试了python3.8,python3.9, python3.10的都可以运行执行。

from pke_zh import TextRank
sents = [
        "哪里下载电视剧周恩来?",]
TextRank_m = TextRank()
    for q in sents:
        print(q)
        r = TextRank_m.extract(q)
        print('TextRank:', r)

TextRank()不会读取pkl。 from pke_zh import WordRank m = WordRank() 会出现以上的问题

ChaoZhou2023 avatar Mar 27 '24 03:03 ChaoZhou2023

我也遇到同样的问题

ningshixian avatar May 24 '24 11:05 ningshixian

我也遇到同样的问题

pip install scikit-learn==1.0.2 ,已解决

ningshixian avatar May 24 '24 11:05 ningshixian