Пример #1
0
def main(gold_input, submit_input, skip_A, skip_B, verbose):
    gold = Collection()
    gold.load(gold_input)

    submit = Collection()
    submit.load(submit_input)

    data = OrderedDict()

    dataA = subtaskA(gold, submit, verbose)
    data.update(dataA)
    if not skip_A:
        report(dataA, verbose)

    if not skip_B:
        dataB = subtaskB(gold, submit, dataA, verbose)
        data.update(dataB)
        report(dataB, verbose)

    print("-" * 20)

    metrics = compute_metrics(data, skip_A, skip_B)

    for key, value in metrics.items():
        print("{0}: {1:0.4}".format(key, value))

    return data
def places(demo_db, request) -> Generator[Collection, None, None]:
    collection = Collection(demo_db, "places")
    param = getattr(request, "param", None)
    yield collection
    if param:
        for key in param:
            collection.delete_many("name", param["name"])
def fulltext_search(
    demo_db, request: FixtureRequest
) -> Generator[Collection, None, None]:
    collection = Collection(demo_db, "fulltext_search")
    yield collection
    param = getattr(request, "param", None)
    for key in param:
        collection.delete_many("app_text", key)
Пример #4
0
def users(demo_db) -> Generator[Collection, None, None]:
    collection = Collection(demo_db, "users")
    yield collection
    collection.drop()
Пример #5
0
def baesian(demo_db) -> Generator[Collection, None, None]:
    collection = Collection(demo_db, "baesian")
    yield collection
    collection.drop()
Пример #6
0
def random_numbers(demo_db) -> Generator[Collection, None, None]:
    collection = Collection(demo_db, "random_numbers")
    yield collection
    collection.drop()
Пример #7
0
def book_collection(
        demo_db, request: FixtureRequest) -> Generator[Collection, None, None]:
    collection = Collection(demo_db, "bookcollection")
    yield collection
    collection.delete_many()
Пример #8
0
def borrow_collection(demo_db) -> Generator[Collection, None, None]:
    collection = Collection(demo_db, "borrowcollection")
    yield collection
    collection.drop()