本文整理汇总了Python中A.run方法的典型用法代码示例。如果您正苦于以下问题:Python A.run方法的具体用法?Python A.run怎么用?Python A.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类A
的用法示例。
在下文中一共展示了A.run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import A [as 别名]
# 或者: from A import run [as 别名]
def main():
if len(sys.argv) != 7:
print 'Usage: python main.py <input_training file> <input test file> <output KNN file> <output SVM file> <output best file> <language>'
sys.exit(0)
train_file = sys.argv[1]
test_file = sys.argv[2]
knn_answer = sys.argv[3]
svm_answer = sys.argv[4]
best_answer = sys.argv[5]
language = sys.argv[6]
train_set = parse_data(train_file)
test_set = parse_data(test_file)
A.run(train_set, test_set, language, knn_answer, svm_answer)
B.run(train_set, test_set, language, best_answer)
示例2: replace_accented
# 需要导入模块: import A [as 别名]
# 或者: from A import run [as 别名]
senseid = ''
# if train then parse sense, if test then senseid = ''
try:
senseid = inst.getElementsByTagName('answer')[0].getAttribute('senseid')
senseid = replace_accented(senseid).encode('ascii')
except:
senseid = ''
data[lexelt].append((instance_id, left, head, right, senseid))
return data
if __name__ == '__main__':
if len(sys.argv) != 7:
print 'Usage: python main.py <input_training file> <input test file> <output KNN file> <output SVM file> <output best file> <language>'
sys.exit(0)
train_file = sys.argv[1]
test_file = sys.argv[2]
knn_answer = sys.argv[3]
svm_answer = sys.argv[4]
best_answer = sys.argv[5]
language = sys.argv[6]
train_set = parse_data(train_file)
test_set = parse_data(test_file)
A.run(train_set, test_set, language, knn_answer, svm_answer)
B.run(train_set, test_set, language, best_answer)
示例3: Document
# 需要导入模块: import A [as 别名]
# 或者: from A import run [as 别名]
class Document():
def __init__(self, id, title, des, disp, url):
self.id = id
self.title = title
self.des = des
self.disp = disp
self.url = url
if __name__ == "__main__":
try:
t_es = float(sys.argv[1])
t_ec = int(sys.argv[2])
host = sys.argv[3]
if t_es > 1 or t_es < 0:
raise Exception()
if t_ec < 1:
raise Exception()
except:
print 'Usage: python main.py <t_es> <t_ec> <host>'
print '<t_es> should be a real number between 0-1 and <t_ec> an integer > 1'
print 'example: python main.py 0.6 100 health.com'
sys.exit()
print 'Part A:\n'
root, query_history, classes = A.run(host, t_es, t_ec)
print '\nPart B:\n'
B.run(query_history, classes, host)
示例4: runPart
# 需要导入模块: import A [as 别名]
# 或者: from A import run [as 别名]
def runPart(train_file, test_file, knn_answer, svm_answer, language):
train_set = parse_data(train_file)
test_set = parse_data(test_file)
A.run(train_set, test_set, language, knn_answer, svm_answer)