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


Python A.run方法代码示例

本文整理汇总了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)
开发者ID:suttonbm,项目名称:umich_NLP,代码行数:19,代码来源:main.py

示例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)
开发者ID:vshetty2410,项目名称:COMS4705,代码行数:32,代码来源:main.py

示例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)
开发者ID:sakhar,项目名称:dbproject2,代码行数:32,代码来源:main.py

示例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)
开发者ID:suttonbm,项目名称:umich_NLP,代码行数:7,代码来源:eval_A.py


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