tf2_ndg_benckmarks.metrics package¶
Subpackages¶
Submodules¶
tf2_ndg_benckmarks.metrics.bleu module¶
tf2_ndg_benckmarks.metrics.embedding module¶
tf2_ndg_benckmarks.metrics.rouge module¶
- Copyright:
Copyright 2019 by Katsuya SHIMABUKURO.
- License:
MIT, see LICENSE for details.
-
class
tf2_ndg_benckmarks.metrics.rouge.
Rouge
¶ Bases:
object
ROUGE score calculator.
-
sentence_score
(reference: str, hypothesis: str, mode: str = 'N', n: int = 1) → float¶ Sentece ROUGE metrics.
- Parameters
reference (str) – reference sentence.
hypothesis – (str): hypothesis sentence.
mode (str) – rouge mode. ‘N’ or ‘L’ is supported.
n (int) – n-gram’s n.
- Returns
Sentence ROUGE score
- Return type
float
-
Module contents¶
metrics
Metrics module.
- Copyright:
Copyright 2019 by Katsuya SHIMABUKURO.
- License:
MIT, see LICENSE for details.