MCPcopy Create free account
hub / github.com/Tencent/embedx / parse_args

Function parse_args

demo/data/scripts/process_dataset.py:29–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28
29def parse_args():
30
31 def existing_path(path):
32 if not os.path.exists(path):
33 raise argparse.ArgumentTypeError(f'file {path} does not exist.')
34 return path
35
36 parser = argparse.ArgumentParser(
37 description=
38 "This program transforms graph data of specific dataset to get graph "
39 "data that meets the embedx format.",
40 formatter_class=argparse.RawDescriptionHelpFormatter)
41 parser.add_argument("--input_path",
42 type=existing_path,
43 required=True,
44 help="Input dataset file or directory.")
45 parser.add_argument("--output_path",
46 type=str,
47 required=True,
48 help="Output embedx graph directory.")
49 parser.add_argument("--dataset",
50 choices=["blogcatalog", "cora", "ppi"],
51 required=True,
52 help="Dataset.")
53 parser.add_argument(
54 "--train_ratio",
55 type=float,
56 default=0.5,
57 help="The ratio of nodes that needs to be set as training type, "
58 "necessary when dataset is 'blogcatalog' or 'cora'.")
59 return parser.parse_args()
60
61
62def generate_embedx_graph(dataset, embedx_graph_dir):

Callers 1

process_dataset.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected