本文整理匯總了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)