Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions API_DESIGN_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,20 @@ and add installation instructions for the specific symbol:
try:
import rouge_score
except ImportError:
pass
rouge_score = None

class RougeL(keras.metrics.Metric):
class Rouge(keras.metrics.Metric):
def __init__(self):
if rouge_score is None:
raise ImportError(
'RougeL metrics requires the rouge_score package. '
'`pip install rouge-score`.')
"ROUGE metric requires the `rouge_score` package."
"Please install it with `pip install rouge_score`."
)
```

Additionally, to ensure that unit tests don't fail, please add the corresponding
library to the `extras_require["tests"]` list in `setup.py`.

## Keep computation inside TensorFlow graph

Our layers, metrics, and tokenizers should be fast and efficient, which means
Expand Down