当前位置:   article > 正文

三种rouge测评方法_rouge chinese

rouge chinese

1. 坑爹的rouge安装

2. rouge4chinese(不用安装,拿来直接用,中文)

https://github.com/hpzhao/nlp-metrics/tree/master/ROUGE4Chinese

3. sumeval(安装很简单,安完直接用,英文)

https://github.com/chakki-works/sumeval

我的使用过程:

1)安装:pip install sumeval

2)代码使用:

  1. from sumeval.metrics.rouge import RougeCalculator
  2. rouge = RougeCalculator(stopwords=True, lang="en")
  3. rouge_1 = rouge.rouge_n(
  4. summary="I went to the Mars from my living town.",
  5. references="I went to Mars",
  6. n=1)
  7. rouge_2 = rouge.rouge_n(
  8. summary="I went to the Mars from my living town.",
  9. references=["I went to Mars", "It's my living town"],
  10. n=2)
  11. rouge_l = rouge.rouge_l(
  12. summary="I went to the Mars from my living town.",
  13. references=["I went to Mars", "It's my living town"])
 
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/701763
推荐阅读
相关标签
  

闽ICP备14008679号