本文整理汇总了Python中plot.plot方法的典型用法代码示例。如果您正苦于以下问题:Python plot.plot方法的具体用法?Python plot.plot怎么用?Python plot.plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plot
的用法示例。
在下文中一共展示了plot.plot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import plot [as 别名]
# 或者: from plot import plot [as 别名]
def main():
spell_checker = SpellChecker()
args = parse_args()
if args.mode == 's': # command line mode
try:
assert args.multiargs is not None
assert not args.train
logging.basicConfig(level=logging.INFO)
repeat_non_test(args.multiargs, spell_checker, CONFIGS["general_configs"]["round"])
except AssertionError:
print("Sentences to be spell checked cannot be none.")
elif args.mode == 'f': # file mode
try:
assert args.file is not None
sentences = []
for sentence in open(args.file, 'r', encoding='utf-8'):
sentences.append(sentence.strip())
repeat_non_test(sentences, spell_checker, CONFIGS["general_configs"]["round"])
except AssertionError:
print("Path to a txt file cannot be none.")
elif args.mode == 'e': # experiment mode
if args.train:
repeat_test(CONFIGS["exp_configs"]["training_set"], spell_checker, CONFIGS["general_configs"]["round"],
args.train, train_on_difference=args.difference)
# assert not CONFIGS["exp_configs"]["union_of_sims"] # union of sims is a strategy used only in testing
name = f'difference_{int(args.difference)}-rank_{CONFIGS["general_configs"]["rank"]}-results_0'
plot.plot(f'{name}.json',
f'{name}.txt',
store_plots=CONFIGS["exp_configs"]["store_plots"],
plots_to_latex=CONFIGS["exp_configs"]["store_latex"])
else:
repeat_test(CONFIGS["exp_configs"]["testing_set"], spell_checker, CONFIGS["general_configs"]["round"],
args.train, train_on_difference=args.difference)