【问题标题】:What can I call out a portion of the result return from Rouge?我可以从 Rouge 调用结果返回的一部分吗?
【发布时间】:2020-03-26 03:49:44
【问题描述】:

这里是需要帮助的初学者!

试过谷歌搜索,但信息不多

如果我只想返回 rouge-l 中的一组数字,我该怎么办?

enter image description here

【问题讨论】:

  • Stack Overflow 不接受代码的链接和屏幕截图。请编辑您的问题并将代码和数据添加为 text!
  • 如果您展示您期望/试图获得的输出的示例,和/或您迄今为止尝试过的任何代码,这将有所帮助。

标签: python nlp rouge


【解决方案1】:

我不认为 rouge 包允许,但你可以格式化输出:

formatted_scores = [{key: {k: "{0:.2f}".format(v) for k, v in value.items()} for key, value in s.items()} for s in scores]
print(formatted_scores)

[{'rouge-1': {'f': '0.67', 'p': '0.67', 'r': '0.67'}, 'rouge-2': {'f': '0.50', 'p': '0.50', 'r': '0.50'}, 'rouge-l': {'f': '0.67', 'p': '0.67', 'r': '0.67'}}]

【讨论】:

    猜你喜欢
    • 2014-07-10
    • 2023-02-08
    • 2016-03-29
    • 1970-01-01
    • 2013-02-14
    • 2021-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多