sparse_caption.coco_caption.pycocoevalcap.bleu package
Submodules
sparse_caption.coco_caption.pycocoevalcap.bleu.bleu module
sparse_caption.coco_caption.pycocoevalcap.bleu.bleu_scorer module
Provides: cook_refs(refs, n=4): Transform a list of reference sentences as strings into a form usable by cook_test(). cook_test(test, refs, n=4): Transform a test sentence as a string (together with the cooked reference sentences) into a form usable by score_cooked().
- class sparse_caption.coco_caption.pycocoevalcap.bleu.bleu_scorer.BleuScorer(test=None, refs=None, n=4, special_reflen=None)
Bases:
objectBleu scorer.
- compatible(other)
- compute_score(option=None, verbose=0)
- cook_append(test, refs)
called by constructor and __iadd__ to avoid creating new instances.
- copy()
copy the refs.
- crefs
- ctest
- n
- ratio(option=None)
- recompute_score(option=None, verbose=0)
- reflen(option=None)
- rescore(new_test)
replace test(s) with new test(s), and returns the new score.
- retest(new_test)
- score_ratio(option=None)
return (bleu, len_ratio) pair
- score_ratio_str(option=None)
- single_reflen(option='average')
- size()
- special_reflen
- testlen(option=None)
- sparse_caption.coco_caption.pycocoevalcap.bleu.bleu_scorer.cook_refs(refs, eff=None, n=4)
Takes a list of reference sentences for a single segment and returns an object that encapsulates everything that BLEU needs to know about them.
- sparse_caption.coco_caption.pycocoevalcap.bleu.bleu_scorer.cook_test(test, refs, eff=None, n=4)
Takes a test sentence and returns an object that encapsulates everything that BLEU needs to know about it.
- sparse_caption.coco_caption.pycocoevalcap.bleu.bleu_scorer.precook(s, n=4, out=False)
Takes a string as input and returns an object that can be given to either cook_refs or cook_test. This is optional: cook_refs and cook_test can take string arguments as well.
Module contents
Created on 09 Jul 2020 23:36:50 @author: jiahuei