0

Beginner here that needs help!

Tried googling but not much info

What should i do if I only want to return only the set of digits in rouge-l?

enter image description here

user7378789
  • 99
  • 1
  • 5
  • 2
    Links to and screenshots of code are not accepted on Stack Overflow. Please edit your question and add the code and the data it as **text**! – Klaus D. Mar 26 '20 at 03:52
  • It would help if you show an example of what output you are expecting / trying to get, and/or any code that you have tried so far. – Hymns For Disco Mar 26 '20 at 03:59

1 Answers1

0

I don't think rouge package allows it but you can just format the output:

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'}}]