总结一下:主要有2种提取方法

1. 关键词匹配

在一个已有的关键词库中匹配几个词语作为这篇文档的关键词。可用AC自动机算法等。

2. 关键词提取

通过算法分析,提取文档中一些词语作为关键词。可用tf-idf算法,textrank 算法等

【python 走进NLP】关键词提取的几个方法

【python 走进NLP】关键词提取的几个方法

一个简单的demo:

# -*- encoding=utf-8 -*-


from pyhanlp import *

sentence="关键词提取的几个方法"
result = HanLP.extractKeyword(sentence, 20)
print(result)

运行结果:

[关键词, 提取, 方法]

Process finished with exit code 0

相关文章:

  • 2021-11-16
  • 2021-12-22
  • 2021-04-15
  • 2021-10-30
  • 2021-12-22
  • 2022-12-23
  • 2023-03-28
猜你喜欢
  • 2021-09-18
  • 2021-08-29
  • 2022-12-23
  • 2021-12-30
  • 2021-12-22
  • 2021-10-07
相关资源
相似解决方案