|
20 | 20 | import tensorflow
|
21 | 21 |
|
22 | 22 | from fedlearner.common import data_join_service_pb2 as dj_pb
|
| 23 | +from fedlearner.common.argparse_util import str_as_bool |
23 | 24 | from fedlearner.data_join.common import get_kvstore_config
|
24 | 25 | from fedlearner.data_join.data_join_worker import DataJoinWorkerService
|
| 26 | +from fedlearner.data_join.common import interval_to_timestamp |
25 | 27 | tensorflow.compat.v1.enable_eager_execution()
|
26 | 28 |
|
27 | 29 | if __name__ == "__main__":
|
|
76 | 78 | parser.add_argument('--data_block_compressed_type', type=str, default='',
|
77 | 79 | choices=['', 'ZLIB', 'GZIP'],
|
78 | 80 | help='the compressed type for data block')
|
| 81 | + parser.add_argument('--max_conversion_delay', type=str, default="7D", |
| 82 | + help='the max delay of an impression occurred '\ |
| 83 | + 'before a conversion as an attribution pair, unit: '\ |
| 84 | + '{Y|M|D|H|N|S}, i.e. 1N20S equals 80 seconds') |
| 85 | + parser.add_argument('--enable_negative_example_generator', type=str_as_bool, |
| 86 | + default=False, const=True, nargs='?', |
| 87 | + help="enable the negative example auto-generator, "\ |
| 88 | + "filled with label: 0") |
79 | 89 | args = parser.parse_args()
|
80 | 90 | worker_options = dj_pb.DataJoinWorkerOptions(
|
81 | 91 | use_mock_etcd=(args.kvstore_type == 'mock'),
|
|
91 | 101 | max_matching_window=args.max_matching_window,
|
92 | 102 | data_block_dump_interval=args.data_block_dump_interval,
|
93 | 103 | data_block_dump_threshold=args.data_block_dump_threshold,
|
| 104 | + max_conversion_delay=interval_to_timestamp(\ |
| 105 | + args.max_conversion_delay), |
| 106 | + enable_negative_example_generator=\ |
| 107 | + args.enable_negative_example_generator, |
94 | 108 | ),
|
95 | 109 | example_id_dump_options=dj_pb.ExampleIdDumpOptions(
|
96 | 110 | example_id_dump_interval=args.example_id_dump_interval,
|
|
0 commit comments