pke_zh
pke_zh copied to clipboard
node array from the pickle has an incompatible dtype
本地安装安装后读取默认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
测试了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)
测试了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() 会出现以上的问题
我也遇到同样的问题
我也遇到同样的问题
pip install scikit-learn==1.0.2 ,已解决