当前位置: 首页>>代码示例>>Python>>正文


Python Formatter.percent方法代码示例

本文整理汇总了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))
开发者ID:EdwardBetts,项目名称:Text-Corpora-Adaptation-Tool,代码行数:9,代码来源:domainsimilarity.py

示例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))
开发者ID:EdwardBetts,项目名称:Text-Corpora-Adaptation-Tool,代码行数:9,代码来源:domainextractor.py


注:本文中的formatter.Formatter.percent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。