@hupan56/wlkj 2.7.11 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/bin/cli.js +375 -78
  2. package/package.json +29 -29
  3. package/templates/.qoder/.runtime/ctx-cache-5660152f1d6dd819.md +23 -0
  4. package/templates/.qoder/.runtime/ctx-cache-afdce0dac06b25b0.md +23 -0
  5. package/templates/.qoder/.runtime/search-cache-eae7644e7b122f35.txt +1 -0
  6. package/templates/.qoder/learning/eval-history.jsonl +28 -0
  7. package/templates/data/index/wiki-index.json +8 -0
  8. package/templates/qoder/agents/insight-planning.md +1 -1
  9. package/templates/qoder/agents/insight-research.md +28 -15
  10. package/templates/qoder/commands/optional/wl-insight.md +159 -161
  11. package/templates/qoder/commands/optional/wl-report.md +4 -4
  12. package/templates/qoder/commands/optional/wl-status.md +2 -2
  13. package/templates/qoder/commands/wl-code.md +2 -2
  14. package/templates/qoder/commands/wl-design.md +2 -2
  15. package/templates/qoder/commands/wl-init.md +3 -3
  16. package/templates/qoder/commands/wl-prd.md +2 -2
  17. package/templates/qoder/commands/wl-req.md +43 -0
  18. package/templates/qoder/commands/wl-search.md +8 -8
  19. package/templates/qoder/commands/wl-task.md +17 -17
  20. package/templates/qoder/commands/wl-test.md +41 -15
  21. package/templates/qoder/config.yaml +17 -1
  22. package/templates/qoder/hooks/session-start.py +12 -22
  23. package/templates/qoder/nul +4 -0
  24. package/templates/qoder/rules/wl-pipeline.md +22 -48
  25. package/templates/qoder/scripts/README.md +139 -0
  26. package/templates/qoder/scripts/common/autotest_auth.py +109 -0
  27. package/templates/qoder/scripts/common/bootstrap.py +145 -0
  28. package/templates/qoder/scripts/common/check_publish.py +98 -0
  29. package/templates/qoder/scripts/common/cmd_registry.py +112 -0
  30. package/templates/qoder/scripts/common/config.py +187 -0
  31. package/templates/qoder/scripts/common/contract.py +317 -0
  32. package/templates/qoder/scripts/common/developer.py +2 -1
  33. package/templates/qoder/scripts/common/feishu.py +10 -9
  34. package/templates/qoder/scripts/common/guard.py +159 -0
  35. package/templates/qoder/scripts/common/identity.py +121 -2
  36. package/templates/qoder/scripts/common/kg_capabilities.py +182 -0
  37. package/templates/qoder/scripts/common/mcp_base.py +268 -0
  38. package/templates/qoder/scripts/common/paths.py +187 -1
  39. package/templates/qoder/scripts/common/result.py +223 -0
  40. package/templates/qoder/scripts/common/roles.py +60 -0
  41. package/templates/qoder/scripts/common/task_utils.py +21 -9
  42. package/templates/qoder/scripts/common/test_extract.py +115 -0
  43. package/templates/qoder/scripts/kg/__init__.py +11 -0
  44. package/templates/qoder/scripts/kg/build_entity_registry.py +196 -0
  45. package/templates/qoder/scripts/kg/build_relations.py +127 -0
  46. package/templates/qoder/scripts/{build_style_index.py → kg/build_style_index.py} +39 -10
  47. package/templates/qoder/scripts/kg/build_workflows.py +144 -0
  48. package/templates/qoder/scripts/{context_pack.py → kg/context_pack.py} +18 -11
  49. package/templates/qoder/scripts/{enrich_prompt.py → kg/enrich_prompt.py} +232 -226
  50. package/templates/qoder/scripts/{extract_api_params.py → kg/extract.py} +398 -246
  51. package/templates/qoder/scripts/{kg.py → kg/kg.py} +638 -708
  52. package/templates/qoder/scripts/{kg_build.py → kg/kg_build.py} +618 -612
  53. package/templates/qoder/scripts/{kg_build_db.py → kg/kg_build_db.py} +333 -327
  54. package/templates/qoder/scripts/{kg_duckdb.py → kg/kg_duckdb.py} +38 -37
  55. package/templates/qoder/scripts/{kg_incremental.py → kg/kg_incremental.py} +420 -393
  56. package/templates/qoder/scripts/{kg_link_db.py → kg/kg_link_db.py} +230 -224
  57. package/templates/qoder/scripts/{kg_semantic.py → kg/kg_semantic.py} +156 -150
  58. package/templates/qoder/scripts/kg/prefetch.py +359 -0
  59. package/templates/qoder/scripts/{search_index.py → kg/search_index.py} +70 -14
  60. package/templates/qoder/scripts/mcp/__init__.py +11 -0
  61. package/templates/qoder/scripts/{kg_mcp_server.py → mcp/kg_mcp_server.py} +77 -272
  62. package/templates/qoder/scripts/{lanhu_stdio_wrapper.py → mcp/lanhu_stdio_wrapper.py} +125 -119
  63. package/templates/qoder/scripts/{check_mcp.py → mcp/mcp_doctor.py} +515 -298
  64. package/templates/qoder/scripts/{mcp_launcher.py → mcp/mcp_launcher.py} +442 -414
  65. package/templates/qoder/scripts/{mysql_mcp_server.py → mcp/mysql_mcp_server.py} +347 -396
  66. package/templates/qoder/scripts/{zentao_mcp_server.py → mcp/zentao_mcp_server.py} +384 -424
  67. package/templates/qoder/scripts/report/__init__.py +11 -0
  68. package/templates/qoder/scripts/{add_session.py → report/add_session.py} +250 -244
  69. package/templates/qoder/scripts/{archive_prd.py → report/archive_prd.py} +383 -377
  70. package/templates/qoder/scripts/{eval_prd.py → report/eval_prd.py} +73 -11
  71. package/templates/qoder/scripts/{export.py → report/export.py} +63 -0
  72. package/templates/qoder/scripts/{fill_prototype.py → report/fill_prototype.py} +6 -0
  73. package/templates/qoder/scripts/{gen_design_doc.py → report/gen_design_doc.py} +400 -394
  74. package/templates/qoder/scripts/{learn.py → report/learn.py} +152 -146
  75. package/templates/qoder/scripts/{learn_aggregate.py → report/learn_aggregate.py} +207 -201
  76. package/templates/qoder/scripts/{report.py → report/report.py} +287 -281
  77. package/templates/qoder/scripts/report/req.py +222 -0
  78. package/templates/qoder/scripts/report/role.py +33 -0
  79. package/templates/qoder/scripts/{status.py → report/status.py} +634 -628
  80. package/templates/qoder/scripts/setup/__init__.py +11 -0
  81. package/templates/qoder/scripts/setup/carriers.py +662 -0
  82. package/templates/qoder/scripts/{init_doctor.py → setup/init_doctor.py} +63 -26
  83. package/templates/qoder/scripts/{install_qoderwork.py → setup/install_qoderwork.py} +36 -26
  84. package/templates/qoder/scripts/{platform_doctor.py → setup/platform_doctor.py} +265 -259
  85. package/templates/qoder/scripts/{repo_root.py → setup/repo_root.py} +112 -106
  86. package/templates/qoder/scripts/{setup.py → setup/setup.py} +147 -0
  87. package/templates/qoder/scripts/{setup_lanhu.py → setup/setup_lanhu.py} +973 -963
  88. package/templates/qoder/scripts/task/__init__.py +11 -0
  89. package/templates/qoder/scripts/{git_sync.py → task/git_sync.py} +52 -31
  90. package/templates/qoder/scripts/{syncgate.py → task/syncgate.py} +6 -0
  91. package/templates/qoder/scripts/task/task.py +221 -0
  92. package/templates/qoder/scripts/task/task_lifecycle.py +596 -0
  93. package/templates/qoder/scripts/task/task_query.py +161 -0
  94. package/templates/qoder/scripts/task/task_relations.py +424 -0
  95. package/templates/qoder/scripts/{team_sync.py → task/team_sync.py} +93 -20
  96. package/templates/qoder/scripts/test/__init__.py +11 -0
  97. package/templates/qoder/scripts/{autotest.py → test/autotest.py} +1174 -1751
  98. package/templates/qoder/scripts/{autotest_batch.py → test/autotest_batch.py} +242 -224
  99. package/templates/qoder/scripts/test/autotest_data.py +675 -0
  100. package/templates/qoder/scripts/{autotest_run.py → test/autotest_run.py} +309 -297
  101. package/templates/qoder/scripts/{benchmark.py → test/benchmark.py} +6 -0
  102. package/templates/qoder/scripts/{kg_auto_login.py → test/kg_auto_login.py} +202 -196
  103. package/templates/qoder/scripts/{kg_test_runner.py → test/kg_test_runner.py} +7 -1
  104. package/templates/qoder/scripts/{page_probe.py → test/page_probe.py} +465 -459
  105. package/templates/qoder/scripts/wlkj.py +116 -0
  106. package/templates/qoder/settings.json +1 -10
  107. package/templates/qoder/skills/design-import/SKILL.md +226 -226
  108. package/templates/qoder/skills/design-review/SKILL.md +82 -82
  109. package/templates/qoder/skills/prd-generator/SKILL.md +26 -16
  110. package/templates/qoder/skills/prd-review/SKILL.md +5 -5
  111. package/templates/qoder/skills/prototype-generator/SKILL.md +256 -256
  112. package/templates/qoder/skills/spec-coder/SKILL.md +4 -4
  113. package/templates/qoder/skills/spec-generator/SKILL.md +4 -4
  114. package/templates/qoder/skills/test-generator/SKILL.md +5 -5
  115. package/templates/qoder/skills/wl-code/SKILL.md +4 -4
  116. package/templates/qoder/skills/wl-commit/SKILL.md +4 -4
  117. package/templates/qoder/skills/wl-design/SKILL.md +3 -3
  118. package/templates/qoder/skills/wl-init/SKILL.md +8 -8
  119. package/templates/qoder/skills/wl-insight/SKILL.md +5 -5
  120. package/templates/qoder/skills/wl-prd-full/SKILL.md +6 -6
  121. package/templates/qoder/skills/wl-prd-quick/SKILL.md +6 -6
  122. package/templates/qoder/skills/wl-prd-review/SKILL.md +4 -4
  123. package/templates/qoder/skills/wl-report/SKILL.md +7 -7
  124. package/templates/qoder/skills/wl-search/SKILL.md +13 -13
  125. package/templates/qoder/skills/wl-spec/SKILL.md +5 -5
  126. package/templates/qoder/skills/wl-status/SKILL.md +5 -5
  127. package/templates/qoder/skills/wl-task/SKILL.md +6 -6
  128. package/templates/qoder/skills/wl-test/SKILL.md +102 -39
  129. package/templates/root/AGENTS.md +39 -40
  130. package/templates/qoder/hooks/inject-workflow-state.py +0 -169
  131. package/templates/qoder/scripts/__pycache__/check_mcp_launch.cpython-39.pyc +0 -0
  132. package/templates/qoder/scripts/__pycache__/install_qoderwork.cpython-39.pyc +0 -0
  133. package/templates/qoder/scripts/__pycache__/mcp_launcher.cpython-39.pyc +0 -0
  134. package/templates/qoder/scripts/__pycache__/platform_doctor.cpython-39.pyc +0 -0
  135. package/templates/qoder/scripts/check_carriers.py +0 -238
  136. package/templates/qoder/scripts/check_mcp_launch.py +0 -183
  137. package/templates/qoder/scripts/check_qoderwork_consistency.py +0 -166
  138. package/templates/qoder/scripts/collect_prds.py +0 -31
  139. package/templates/qoder/scripts/common/mentions.py +0 -134
  140. package/templates/qoder/scripts/common/utf8.py +0 -38
  141. package/templates/qoder/scripts/extract_routes.py +0 -54
  142. package/templates/qoder/scripts/extract_routes_tree.py +0 -78
  143. package/templates/qoder/scripts/handoff.py +0 -22
  144. package/templates/qoder/scripts/init_developer.py +0 -76
  145. package/templates/qoder/scripts/parse_prds.py +0 -33
  146. package/templates/qoder/scripts/role.py +0 -51
  147. package/templates/qoder/scripts/sync_carriers.py +0 -259
  148. package/templates/qoder/scripts/task.py +0 -1261
  149. package/templates/qoder/scripts/workspace_init.py +0 -102
  150. package/templates/qoder/skills/prompt-enrich/SKILL.md +0 -90
  151. package/templates/qoder/skills/prototype-generator/SKILL.md.zcode-79180-2af4721f-f9a6-412c-88db-c0af680d211b.tmp +0 -0
  152. /package/templates/qoder/scripts/{secure-ls.js → test/secure-ls.js} +0 -0
@@ -1,150 +1,156 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- LLM semantic labeling layer for the knowledge graph.
4
-
5
- After kg_build.py extracts structural data (AST-level), this module:
6
- 1. Finds entities that lack semantic labels (cn == dir, no business_domain)
7
- 2. Outputs a labeling prompt for the AI (QoderWork) to fill in
8
- 3. Provides a write-back function to store labels in DuckDB
9
-
10
- The AI (QoderWork's LLM) sees the prompt during session-start or when
11
- kg_build reports new modules, and labels them — zero human trigger.
12
-
13
- Usage (called by AI automatically):
14
- python kg_semantic.py --check # check what needs labeling
15
- python kg_semantic.py --label '{"assets": {"cn": "资产管理", "domain": "固定资产"}}'
16
- """
17
- import json
18
- import os
19
- import sys
20
-
21
- SCRIPTS = os.path.dirname(os.path.abspath(__file__))
22
- sys.path.insert(0, SCRIPTS)
23
- from common.paths import DATA_INDEX_DIR
24
- from kg_duckdb import get_db
25
-
26
- DB_PATH = str(DATA_INDEX_DIR / 'kg.duckdb')
27
-
28
-
29
- def check_unlabeled():
30
- """Find modules that need semantic labeling (cn == dir or cn is empty)."""
31
- con = get_db()
32
- # Find FEATURE entities where cn == dir (unlabeled) or cn is empty
33
- rows = con.execute("""
34
- SELECT id, canonical, cn FROM entities
35
- WHERE type = 'FEATURE'
36
- AND (cn = canonical OR cn = '' OR cn IS NULL)
37
- ORDER BY canonical
38
- """).fetchall()
39
-
40
- if not rows:
41
- return None
42
-
43
- # Build labeling prompt
44
- modules = []
45
- for eid, dirname, cn in rows:
46
- # Gather context: what endpoints/pages does this module have?
47
- ep_count = con.execute(
48
- "SELECT COUNT(*) FROM edges WHERE from_id = ? AND edge_type = 'has_endpoint'",
49
- [eid]
50
- ).fetchone()[0]
51
- btn_count = con.execute(
52
- "SELECT COUNT(*) FROM edges WHERE from_id = ? AND edge_type = 'has_button'",
53
- [eid]
54
- ).fetchone()[0]
55
- # Sample endpoints for context
56
- sample_eps = con.execute("""
57
- SELECT e.to_id FROM edges e
58
- WHERE e.from_id = ? AND e.edge_type = 'has_endpoint' LIMIT 5
59
- """, [eid]).fetchall()
60
-
61
- modules.append({
62
- 'dir': dirname,
63
- 'endpoints': ep_count,
64
- 'buttons': btn_count,
65
- 'sample_apis': [r[0].replace('E:', '') for r in sample_eps],
66
- })
67
-
68
- con.close()
69
-
70
- prompt = {
71
- 'action': 'semantic_labeling_needed',
72
- 'description': '以下模块需要语义标注(中文名+业务领域)。请根据目录名和API端点推断。',
73
- 'modules': modules,
74
- 'instructions': (
75
- '对每个模块返回: {"目录名": {"cn": "中文名", "domain": "业务领域"}}\n'
76
- '示例: {"assets": {"cn": "资产管理", "domain": "固定资产管理"}}\n'
77
- '然后用 kg_semantic.py --label 写回'
78
- ),
79
- }
80
- return prompt
81
-
82
-
83
- def apply_labels(labels_json):
84
- """Write semantic labels back to DuckDB.
85
-
86
- labels_json: {"assets": {"cn": "资产管理", "domain": "固定资产"}, ...}
87
- """
88
- labels = json.loads(labels_json) if isinstance(labels_json, str) else labels_json
89
- con = get_db()
90
- updated = 0
91
-
92
- for dirname, info in labels.items():
93
- cn = info.get('cn', dirname)
94
- domain = info.get('domain', '')
95
-
96
- # Find the FEATURE entity by canonical name (dir)
97
- rows = con.execute(
98
- "SELECT id FROM entities WHERE type='FEATURE' AND canonical = ?",
99
- [dirname]
100
- ).fetchall()
101
-
102
- for row in rows:
103
- eid = row[0]
104
- # Update cn
105
- con.execute(
106
- "UPDATE entities SET cn = ? WHERE id = ?",
107
- [cn, eid]
108
- )
109
- # Update props with domain
110
- props_row = con.execute(
111
- "SELECT props FROM entities WHERE id = ?", [eid]
112
- ).fetchone()
113
- if props_row:
114
- try:
115
- props = json.loads(props_row[0]) if props_row[0] else {}
116
- except:
117
- props = {}
118
- props['business_domain'] = domain
119
- props['labeled'] = True
120
- con.execute(
121
- "UPDATE entities SET props = ? WHERE id = ?",
122
- [json.dumps(props, ensure_ascii=False), eid]
123
- )
124
- # Update alias
125
- con.execute(
126
- "INSERT OR REPLACE INTO aliases VALUES (?, ?)",
127
- [cn.lower(), eid]
128
- )
129
- updated += 1
130
-
131
- con.close()
132
- return updated
133
-
134
-
135
- if __name__ == '__main__':
136
- if len(sys.argv) > 1 and sys.argv[1] == '--check':
137
- result = check_unlabeled()
138
- if result:
139
- print(json.dumps(result, ensure_ascii=False, indent=2))
140
- else:
141
- print('{"status": "all_labeled", "message": "所有模块已有语义标注"}')
142
-
143
- elif len(sys.argv) > 2 and sys.argv[1] == '--label':
144
- count = apply_labels(sys.argv[2])
145
- print('Updated %d entities with semantic labels' % count)
146
-
147
- else:
148
- print('Usage:')
149
- print(' python kg_semantic.py --check # 查看待标注模块')
150
- print(' python kg_semantic.py --label \'{"assets":{"cn":"资产管理","domain":"固定资产"}}\'')
1
+ # -*- coding: utf-8 -*-
2
+ # v3.0 路径自举: 引导到 common/bootstrap, 统一 sys.path 逻辑
3
+ import os as _o, sys as _s
4
+ _cp = _o.path.join(_o.path.dirname(_o.path.dirname(_o.path.abspath(__file__))), 'common')
5
+ if _cp not in _s.path: _s.path.insert(0, _cp)
6
+ from bootstrap import setup; setup()
7
+
8
+ """
9
+ LLM semantic labeling layer for the knowledge graph.
10
+
11
+ After kg_build.py extracts structural data (AST-level), this module:
12
+ 1. Finds entities that lack semantic labels (cn == dir, no business_domain)
13
+ 2. Outputs a labeling prompt for the AI (QoderWork) to fill in
14
+ 3. Provides a write-back function to store labels in DuckDB
15
+
16
+ The AI (QoderWork's LLM) sees the prompt during session-start or when
17
+ kg_build reports new modules, and labels them — zero human trigger.
18
+
19
+ Usage (called by AI automatically):
20
+ python kg_semantic.py --check # check what needs labeling
21
+ python kg_semantic.py --label '{"assets": {"cn": "资产管理", "domain": "固定资产"}}'
22
+ """
23
+ import json
24
+ import os
25
+ import sys
26
+
27
+ SCRIPTS = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # 子包→scripts/根
28
+ sys.path.insert(0, SCRIPTS)
29
+ from common.paths import DATA_INDEX_DIR
30
+ from kg_duckdb import get_db
31
+
32
+ DB_PATH = str(DATA_INDEX_DIR / 'kg.duckdb')
33
+
34
+
35
+ def check_unlabeled():
36
+ """Find modules that need semantic labeling (cn == dir or cn is empty)."""
37
+ con = get_db()
38
+ # Find FEATURE entities where cn == dir (unlabeled) or cn is empty
39
+ rows = con.execute("""
40
+ SELECT id, canonical, cn FROM entities
41
+ WHERE type = 'FEATURE'
42
+ AND (cn = canonical OR cn = '' OR cn IS NULL)
43
+ ORDER BY canonical
44
+ """).fetchall()
45
+
46
+ if not rows:
47
+ return None
48
+
49
+ # Build labeling prompt
50
+ modules = []
51
+ for eid, dirname, cn in rows:
52
+ # Gather context: what endpoints/pages does this module have?
53
+ ep_count = con.execute(
54
+ "SELECT COUNT(*) FROM edges WHERE from_id = ? AND edge_type = 'has_endpoint'",
55
+ [eid]
56
+ ).fetchone()[0]
57
+ btn_count = con.execute(
58
+ "SELECT COUNT(*) FROM edges WHERE from_id = ? AND edge_type = 'has_button'",
59
+ [eid]
60
+ ).fetchone()[0]
61
+ # Sample endpoints for context
62
+ sample_eps = con.execute("""
63
+ SELECT e.to_id FROM edges e
64
+ WHERE e.from_id = ? AND e.edge_type = 'has_endpoint' LIMIT 5
65
+ """, [eid]).fetchall()
66
+
67
+ modules.append({
68
+ 'dir': dirname,
69
+ 'endpoints': ep_count,
70
+ 'buttons': btn_count,
71
+ 'sample_apis': [r[0].replace('E:', '') for r in sample_eps],
72
+ })
73
+
74
+ con.close()
75
+
76
+ prompt = {
77
+ 'action': 'semantic_labeling_needed',
78
+ 'description': '以下模块需要语义标注(中文名+业务领域)。请根据目录名和API端点推断。',
79
+ 'modules': modules,
80
+ 'instructions': (
81
+ '对每个模块返回: {"目录名": {"cn": "中文名", "domain": "业务领域"}}\n'
82
+ '示例: {"assets": {"cn": "资产管理", "domain": "固定资产管理"}}\n'
83
+ '然后用 kg_semantic.py --label 写回'
84
+ ),
85
+ }
86
+ return prompt
87
+
88
+
89
+ def apply_labels(labels_json):
90
+ """Write semantic labels back to DuckDB.
91
+
92
+ labels_json: {"assets": {"cn": "资产管理", "domain": "固定资产"}, ...}
93
+ """
94
+ labels = json.loads(labels_json) if isinstance(labels_json, str) else labels_json
95
+ con = get_db()
96
+ updated = 0
97
+
98
+ for dirname, info in labels.items():
99
+ cn = info.get('cn', dirname)
100
+ domain = info.get('domain', '')
101
+
102
+ # Find the FEATURE entity by canonical name (dir)
103
+ rows = con.execute(
104
+ "SELECT id FROM entities WHERE type='FEATURE' AND canonical = ?",
105
+ [dirname]
106
+ ).fetchall()
107
+
108
+ for row in rows:
109
+ eid = row[0]
110
+ # Update cn
111
+ con.execute(
112
+ "UPDATE entities SET cn = ? WHERE id = ?",
113
+ [cn, eid]
114
+ )
115
+ # Update props with domain
116
+ props_row = con.execute(
117
+ "SELECT props FROM entities WHERE id = ?", [eid]
118
+ ).fetchone()
119
+ if props_row:
120
+ try:
121
+ props = json.loads(props_row[0]) if props_row[0] else {}
122
+ except Exception:
123
+ props = {}
124
+ props['business_domain'] = domain
125
+ props['labeled'] = True
126
+ con.execute(
127
+ "UPDATE entities SET props = ? WHERE id = ?",
128
+ [json.dumps(props, ensure_ascii=False), eid]
129
+ )
130
+ # Update alias
131
+ con.execute(
132
+ "INSERT OR REPLACE INTO aliases VALUES (?, ?)",
133
+ [cn.lower(), eid]
134
+ )
135
+ updated += 1
136
+
137
+ con.close()
138
+ return updated
139
+
140
+
141
+ if __name__ == '__main__':
142
+ if len(sys.argv) > 1 and sys.argv[1] == '--check':
143
+ result = check_unlabeled()
144
+ if result:
145
+ print(json.dumps(result, ensure_ascii=False, indent=2))
146
+ else:
147
+ print('{"status": "all_labeled", "message": "所有模块已有语义标注"}')
148
+
149
+ elif len(sys.argv) > 2 and sys.argv[1] == '--label':
150
+ count = apply_labels(sys.argv[2])
151
+ print('Updated %d entities with semantic labels' % count)
152
+
153
+ else:
154
+ print('Usage:')
155
+ print(' python kg_semantic.py --check # 查看待标注模块')
156
+ print(' python kg_semantic.py --label \'{"assets":{"cn":"资产管理","domain":"固定资产"}}\'')