Bird
0
0

You wrote code to compute ROUGE-L score but get an error: AttributeError: module 'rouge' has no attribute 'Rouge'. What is the likely cause?

medium📝 Debug Q14 of 15
NLP - Text Generation
You wrote code to compute ROUGE-L score but get an error: AttributeError: module 'rouge' has no attribute 'Rouge'. What is the likely cause?
AThe input texts are empty strings
BROUGE-L score cannot be computed in Python
CThe 'rouge' package is not installed or imported incorrectly
DYou must use BLEU instead of ROUGE-L
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the error message

    The error says the module 'rouge' has no attribute 'Rouge', indicating the package or import is missing or incorrect.
  2. Step 2: Understand correct usage

    You need to install the correct 'rouge' package and import Rouge class properly to use ROUGE-L.
  3. Final Answer:

    The 'rouge' package is not installed or imported incorrectly -> Option C
  4. Quick Check:

    AttributeError usually means missing or wrong import [OK]
Quick Trick: Check package installation and import statements first [OK]
Common Mistakes:
MISTAKES
  • Assuming ROUGE-L can't be computed in Python
  • Ignoring installation errors
  • Using wrong package names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NLP Quizzes