1.将HanLP的data(包含词典和模型)放到hdfs上,然后在项目配置文件hanlp.properties中配置root的路径,比如:
root=hdfs://localhost:9000/tmp/

2.实现com.hankcs.hanlp.corpus.io.IIOAdapter接口:
Spark中使用HanLP分词
3.设置IoAdapter,创建分词器:
Spark中使用HanLP分词
然后,就可以在Spark的操作中使用segment进行分词了。

文章来源于云聪的博客

相关文章:

  • 2021-08-01
  • 2022-02-11
  • 2021-11-10
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
猜你喜欢
  • 2021-11-02
  • 2021-06-27
  • 2021-10-16
  • 2021-08-14
  • 2021-10-07
  • 2021-04-08
  • 2022-12-23
相关资源
相似解决方案