Пример #1
0
def add_data_generator_arguments(parser):
    from preprocess import add_preprocess_arguments
    from cocoa.core.scenario_db import add_scenario_arguments
    from cocoa.core.mutualfriends.lexicon import add_lexicon_arguments
    from cocoa.core.dataset import add_dataset_arguments

    add_scenario_arguments(parser)
    add_lexicon_arguments(parser)
    add_preprocess_arguments(parser)
    add_dataset_arguments(parser)
Пример #2
0
def add_data_generator_arguments(parser):
    from preprocess import add_preprocess_arguments
    from cocoa.core.scenario_db import add_scenario_arguments
    from cocoa.core.dataset import add_dataset_arguments
    from core.price_tracker import add_price_tracker_arguments
    from core.slot_detector import add_slot_detector_arguments
    from retriever import add_retriever_arguments

    add_scenario_arguments(parser)
    add_preprocess_arguments(parser)
    add_dataset_arguments(parser)
    add_retriever_arguments(parser)
    add_price_tracker_arguments(parser)
    add_slot_detector_arguments(parser)
Пример #3
0
        '--schema-path',
        help='Input path that describes the schema of the domain',
        required=True)
    parser.add_argument(
        '--retriever-output',
        help=
        'Output path of json file containing retrieved candidates of test examples'
    )
    parser.add_argument('--verbose',
                        action='store_true',
                        help='Print retrieved candidates')
    parser.add_argument('--seed',
                        default=0,
                        type=int,
                        help='Random seed for generating exid')
    add_dataset_arguments(parser)
    add_retriever_arguments(parser)
    add_price_tracker_arguments(parser)
    add_slot_detector_arguments(parser)
    args = parser.parse_args()

    random.seed(args.seed)

    dataset = read_dataset(args, Scenario)
    lexicon = PriceTracker(args.price_tracker_model)
    if args.slot_scores is not None:
        slot_detector = SlotDetector(slot_scores_path=args.slot_scores)
    else:
        slot_detector = None
    schema = Schema(args.schema_path)