本文整理汇总了Python中formatter.Formatter.percent方法的典型用法代码示例。如果您正苦于以下问题:Python Formatter.percent方法的具体用法?Python Formatter.percent怎么用?Python Formatter.percent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类formatter.Formatter
的用法示例。
在下文中一共展示了Formatter.percent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print_progress
# 需要导入模块: from formatter import Formatter [as 别名]
# 或者: from formatter.Formatter import percent [as 别名]
def print_progress(self):
print("Average tfidf: " + str(1 - self.sum_tfidf / self.queries_asked))
print("Average ngram-perplexity: " + str(self.sum_ngp / self.sentences_asked))
print("Average edit-distance: " + str(self.sum_edit / self.queries_asked))
print("Accept percent by tfidf extractor: " + Formatter.percent(self.accepted_by_tfidf / self.sentences_asked))
print("Accept percent by ngram-perplexity extractor: " + Formatter.percent(self.accepted_by_ngp / self.sentences_asked))
print("Accept percent by edit-distance extractor: " + Formatter.percent(self.accepted_by_edit_distance / self.sentences_asked))
示例2: print_progress_summary
# 需要导入模块: from formatter import Formatter [as 别名]
# 或者: from formatter.Formatter import percent [as 别名]
def print_progress_summary(self):
useful_lines = self.assigned_lines - self.unusable_lines
print("(General corpora): Total lines scanned : " + str(self.scanned_lines))
print("(General corpora): Lines assigned to worker: " + str(self.assigned_lines))
print("(General corpora): Lines containing words: " + str(useful_lines))
print("(General corpora): Extracted lines: " + str(self.extracted_lines))
print("(General corpora): Sentence accept rate: " + Formatter.percent(self.extracted_lines / useful_lines))