dataflow-kg 0.9.0__tar.gz

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 (257) hide show
  1. dataflow_kg-0.9.0/LICENSE +201 -0
  2. dataflow_kg-0.9.0/MANIFEST.in +21 -0
  3. dataflow_kg-0.9.0/PKG-INFO +313 -0
  4. dataflow_kg-0.9.0/README.md +201 -0
  5. dataflow_kg-0.9.0/dataflow/__init__.py +15 -0
  6. dataflow_kg-0.9.0/dataflow/cli.py +547 -0
  7. dataflow_kg-0.9.0/dataflow/cli_funcs/__init__.py +8 -0
  8. dataflow_kg-0.9.0/dataflow/cli_funcs/cli_env.py +86 -0
  9. dataflow_kg-0.9.0/dataflow/cli_funcs/cli_eval.py +467 -0
  10. dataflow_kg-0.9.0/dataflow/cli_funcs/cli_init.py +54 -0
  11. dataflow_kg-0.9.0/dataflow/cli_funcs/cli_pdf.py +526 -0
  12. dataflow_kg-0.9.0/dataflow/cli_funcs/cli_text.py +671 -0
  13. dataflow_kg-0.9.0/dataflow/cli_funcs/copy_funcs.py +98 -0
  14. dataflow_kg-0.9.0/dataflow/cli_funcs/eval_pipeline/eval_api.py +243 -0
  15. dataflow_kg-0.9.0/dataflow/cli_funcs/eval_pipeline/eval_local.py +245 -0
  16. dataflow_kg-0.9.0/dataflow/cli_funcs/paths.py +46 -0
  17. dataflow_kg-0.9.0/dataflow/cli_funcs/pdf2model_pipeline/llama_factory_trainer.py +369 -0
  18. dataflow_kg-0.9.0/dataflow/cli_funcs/pdf2model_pipeline/path_to_jsonl_script.py +237 -0
  19. dataflow_kg-0.9.0/dataflow/cli_funcs/pdf2model_pipeline/pdf_to_qa_pipeline.py +118 -0
  20. dataflow_kg-0.9.0/dataflow/cli_funcs/text2model_pipeline/llama_factory_trainer.py +369 -0
  21. dataflow_kg-0.9.0/dataflow/cli_funcs/text2model_pipeline/merge_filter_qa_pairs.py +300 -0
  22. dataflow_kg-0.9.0/dataflow/cli_funcs/text2model_pipeline/text_to_qa_pipeline.py +110 -0
  23. dataflow_kg-0.9.0/dataflow/core/__init__.py +18 -0
  24. dataflow_kg-0.9.0/dataflow/core/llm_serving.py +35 -0
  25. dataflow_kg-0.9.0/dataflow/core/operator.py +28 -0
  26. dataflow_kg-0.9.0/dataflow/core/prompt.py +107 -0
  27. dataflow_kg-0.9.0/dataflow/core/wrapper.py +14 -0
  28. dataflow_kg-0.9.0/dataflow/example/FinKGRiskPipeline/input.json +6 -0
  29. dataflow_kg-0.9.0/dataflow/example/GeoKGSpatiotemporalEventPipeline/input.json +5 -0
  30. dataflow_kg-0.9.0/dataflow/example/GraphRAGPipeline/input.json +14 -0
  31. dataflow_kg-0.9.0/dataflow/example/GraphReasoningPipeline/input.json +15 -0
  32. dataflow_kg-0.9.0/dataflow/example/HyperRelationKGPipeline/input.json +11 -0
  33. dataflow_kg-0.9.0/dataflow/example/KG2QAPipeline/input.json +11 -0
  34. dataflow_kg-0.9.0/dataflow/example/KGEvaluationPipeline/input.json +29 -0
  35. dataflow_kg-0.9.0/dataflow/example/KGExtractionPipeline/input.json +10 -0
  36. dataflow_kg-0.9.0/dataflow/example/LegalKGPipeline/input.json +10 -0
  37. dataflow_kg-0.9.0/dataflow/example/MedicalKGPipeline/input.json +12 -0
  38. dataflow_kg-0.9.0/dataflow/example/MultimodalKGPipeline/input.json +6 -0
  39. dataflow_kg-0.9.0/dataflow/example/ScholarKGPipeline/input.json +12 -0
  40. dataflow_kg-0.9.0/dataflow/example/TemporalKGPipeline/input.json +8 -0
  41. dataflow_kg-0.9.0/dataflow/logger.py +128 -0
  42. dataflow_kg-0.9.0/dataflow/operators/__init__.py +4 -0
  43. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/__init__.py +27 -0
  44. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/eval/cskg_triple_adaptability_eval.py +136 -0
  45. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/eval/cskg_triple_rationale_eval.py +139 -0
  46. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/filter/cskg_rel_triple_set_sampling.py +350 -0
  47. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/filter/cskg_triple_adaptability_filtering.py +89 -0
  48. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/filter/cskg_triple_rationale_filtering.py +87 -0
  49. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/generate/cskg_rel_triple_qa_generator.py +140 -0
  50. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/generate/cskg_triple_extractor.py +259 -0
  51. dataflow_kg-0.9.0/dataflow/operators/commonsense_kg/refine/cskg_triple_concept_generalization.py +187 -0
  52. dataflow_kg-0.9.0/dataflow/operators/domain_kg/financial_kg/__init__.py +21 -0
  53. dataflow_kg-0.9.0/dataflow/operators/domain_kg/financial_kg/filter/finkg_4tuple_ontology_filtering.py +142 -0
  54. dataflow_kg-0.9.0/dataflow/operators/domain_kg/financial_kg/generate/finkg_4tuple_extractor.py +220 -0
  55. dataflow_kg-0.9.0/dataflow/operators/domain_kg/financial_kg/generate/finkg_entity_risk_assessment.py +573 -0
  56. dataflow_kg-0.9.0/dataflow/operators/domain_kg/financial_kg/generate/finkg_event_impact_tracing.py +760 -0
  57. dataflow_kg-0.9.0/dataflow/operators/domain_kg/financial_kg/generate/finkg_investment_analysis.py +487 -0
  58. dataflow_kg-0.9.0/dataflow/operators/domain_kg/financial_kg/generate/finkg_marketaux_news_retriever.py +399 -0
  59. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/__init__.py +34 -0
  60. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/eval/geokg_event_consistence_eval.py +130 -0
  61. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/eval/geokg_event_rationale_eval.py +130 -0
  62. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/eval/geokg_event_summary.py +116 -0
  63. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/filter/geokg_event_consistence_filtering.py +88 -0
  64. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/filter/geokg_event_location_filtering.py +92 -0
  65. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/filter/geokg_event_rationale_filtering.py +88 -0
  66. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/filter/geokg_event_time_filtering.py +177 -0
  67. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/generate/geokg_4tuple_extractor.py +292 -0
  68. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/generate/geokg_event_extractor.py +184 -0
  69. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/refine/geokg_entity_link2database.py +320 -0
  70. dataflow_kg-0.9.0/dataflow/operators/domain_kg/geospatial_kg/refine/geokg_rel_4tuple_inference.py +157 -0
  71. dataflow_kg-0.9.0/dataflow/operators/domain_kg/legal_kg/__init__.py +21 -0
  72. dataflow_kg-0.9.0/dataflow/operators/domain_kg/legal_kg/eval/legalkg_case_similarity_eval.py +106 -0
  73. dataflow_kg-0.9.0/dataflow/operators/domain_kg/legal_kg/filter/legalkg_case_similarity_filtering.py +75 -0
  74. dataflow_kg-0.9.0/dataflow/operators/domain_kg/legal_kg/generate/legalkg_case_judgement_generator.py +135 -0
  75. dataflow_kg-0.9.0/dataflow/operators/domain_kg/legal_kg/generate/legalkg_triple_extractor.py +309 -0
  76. dataflow_kg-0.9.0/dataflow/operators/domain_kg/medical_kg/__init__.py +19 -0
  77. dataflow_kg-0.9.0/dataflow/operators/domain_kg/medical_kg/filter/medkg_triple_metapath_sampling.py +288 -0
  78. dataflow_kg-0.9.0/dataflow/operators/domain_kg/medical_kg/generate/medkg_triple_drug_action_mechanism_discovery.py +350 -0
  79. dataflow_kg-0.9.0/dataflow/operators/domain_kg/medical_kg/generate/medkg_triple_drug_repositioning_discovery.py +319 -0
  80. dataflow_kg-0.9.0/dataflow/operators/domain_kg/medical_kg/generate/medkg_triple_extractor.py +344 -0
  81. dataflow_kg-0.9.0/dataflow/operators/domain_kg/scholar_kg/__init__.py +16 -0
  82. dataflow_kg-0.9.0/dataflow/operators/domain_kg/scholar_kg/generate/schokg_query_reasoning.py +348 -0
  83. dataflow_kg-0.9.0/dataflow/operators/domain_kg/scholar_kg/generate/schokg_recommend.py +347 -0
  84. dataflow_kg-0.9.0/dataflow/operators/domain_kg/scholar_kg/generate/schokg_triple_extractor.py +353 -0
  85. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/__init__.py +22 -0
  86. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/domain_kg_tuple_ontology_filtering.py +168 -0
  87. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/finkg_get_ontology.py +317 -0
  88. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/geokg_get_ontology.py +198 -0
  89. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/legalkg_get_ontology.py +140 -0
  90. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/medkg_get_anatomy_biology_ontology.py +190 -0
  91. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/medkg_get_disease_diagnosis_ontology.py +188 -0
  92. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/medkg_get_drug_therapy_ontology.py +189 -0
  93. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/medkg_get_microbe_pathogen_ontology.py +131 -0
  94. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/medkg_get_test_measurement_ontology.py +171 -0
  95. dataflow_kg-0.9.0/dataflow/operators/domain_kg/utils/schokg_get_ontology.py +95 -0
  96. dataflow_kg-0.9.0/dataflow/operators/general_kg/__init__.py +58 -0
  97. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_qa_concise_eval.py +149 -0
  98. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_qa_correlation_eval.py +148 -0
  99. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_qa_natural_eval.py +148 -0
  100. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_rel_triple_consistency_eval.py +380 -0
  101. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_rel_triple_nx_visual.py +184 -0
  102. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_rel_triple_strength_eval.py +238 -0
  103. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_rel_triple_topology_eval.py +233 -0
  104. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_subgraph_connectivity_eval.py +155 -0
  105. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_subgraph_consistence_eval.py +140 -0
  106. dataflow_kg-0.9.0/dataflow/operators/general_kg/eval/kg_subgraph_scale_eval.py +133 -0
  107. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_attri_tuple_sampling.py +201 -0
  108. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_entity_validation.py +143 -0
  109. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_qa_concise_filtering.py +89 -0
  110. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_qa_correlation_filtering.py +88 -0
  111. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_qa_natural_filtering.py +88 -0
  112. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_rel_triple_strength_filtering.py +88 -0
  113. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_rel_tuple_path_sampling.py +235 -0
  114. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_rel_tuple_subgraph_sampling.py +330 -0
  115. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_subgraph_connectivity_filtering.py +75 -0
  116. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_subgraph_consistence_filtering.py +75 -0
  117. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_subgraph_scale_filtering.py +75 -0
  118. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_tuple_remove_repeated.py +118 -0
  119. dataflow_kg-0.9.0/dataflow/operators/general_kg/filter/kg_tuple_validation.py +156 -0
  120. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_attri_triple_qa_generator.py +146 -0
  121. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_entity_extractor.py +186 -0
  122. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_rel_triple_conversation_generator.py +130 -0
  123. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_rel_triple_inference.py +166 -0
  124. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_rel_triple_path_qa_generator.py +172 -0
  125. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_rel_triple_subgraph_qa_generator.py +160 -0
  126. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_triple_extractor.py +269 -0
  127. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_triple_merge.py +206 -0
  128. dataflow_kg-0.9.0/dataflow/operators/general_kg/generate/kg_tuple2text.py +102 -0
  129. dataflow_kg-0.9.0/dataflow/operators/general_kg/refinement/kg_entity_alignment.py +130 -0
  130. dataflow_kg-0.9.0/dataflow/operators/general_kg/refinement/kg_entity_classification.py +151 -0
  131. dataflow_kg-0.9.0/dataflow/operators/general_kg/refinement/kg_entity_disambiguation.py +198 -0
  132. dataflow_kg-0.9.0/dataflow/operators/general_kg/refinement/kg_entity_link2database.py +180 -0
  133. dataflow_kg-0.9.0/dataflow/operators/general_kg/refinement/kg_entity_normalization.py +150 -0
  134. dataflow_kg-0.9.0/dataflow/operators/general_kg/refinement/kg_triple_disambiguation.py +185 -0
  135. dataflow_kg-0.9.0/dataflow/operators/general_kg/refinement/kg_tuple_normalization.py +174 -0
  136. dataflow_kg-0.9.0/dataflow/operators/graph_rag/__init__.py +26 -0
  137. dataflow_kg-0.9.0/dataflow/operators/graph_rag/eval/graphrag_answer_plausibility_eval.py +162 -0
  138. dataflow_kg-0.9.0/dataflow/operators/graph_rag/eval/graphrag_answer_token_eval.py +109 -0
  139. dataflow_kg-0.9.0/dataflow/operators/graph_rag/eval/graphrag_question_difficulty_eval.py +157 -0
  140. dataflow_kg-0.9.0/dataflow/operators/graph_rag/eval/graphrag_truth_eval.py +141 -0
  141. dataflow_kg-0.9.0/dataflow/operators/graph_rag/filter/graphrag_answer_plausibility_filtering.py +86 -0
  142. dataflow_kg-0.9.0/dataflow/operators/graph_rag/filter/graphrag_answer_token_filtering.py +86 -0
  143. dataflow_kg-0.9.0/dataflow/operators/graph_rag/generate/graphrag_get_answer.py +129 -0
  144. dataflow_kg-0.9.0/dataflow/operators/graph_rag/generate/graphrag_prompt_generator.py +255 -0
  145. dataflow_kg-0.9.0/dataflow/operators/graph_rag/generate/graphrag_query_extractor.py +158 -0
  146. dataflow_kg-0.9.0/dataflow/operators/graph_reasoning/__init__.py +24 -0
  147. dataflow_kg-0.9.0/dataflow/operators/graph_reasoning/eval/reasoning_path_length_eval.py +88 -0
  148. dataflow_kg-0.9.0/dataflow/operators/graph_reasoning/eval/reasoning_path_redundancy_eval.py +143 -0
  149. dataflow_kg-0.9.0/dataflow/operators/graph_reasoning/filter/reasoning_path_length_filtering.py +103 -0
  150. dataflow_kg-0.9.0/dataflow/operators/graph_reasoning/filter/reasoning_path_redundancy_filtering.py +89 -0
  151. dataflow_kg-0.9.0/dataflow/operators/graph_reasoning/generate/reasoning_constrained_path_search.py +169 -0
  152. dataflow_kg-0.9.0/dataflow/operators/graph_reasoning/generate/reasoning_path_search.py +192 -0
  153. dataflow_kg-0.9.0/dataflow/operators/graph_reasoning/generate/reasoning_rel_generator.py +154 -0
  154. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/__init__.py +26 -0
  155. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/eval/hrkg_rel_triple_attri_summary.py +108 -0
  156. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/eval/hrkg_rel_triple_completeness_eval.py +126 -0
  157. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/eval/hrkg_rel_triple_consistency_eval.py +126 -0
  158. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/filter/hrkg_rel_triple_attri_filtering.py +97 -0
  159. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/filter/hrkg_rel_triple_completeness_filtering.py +81 -0
  160. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/filter/hrkg_rel_triple_consistency_filtering.py +81 -0
  161. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/generate/hrkg_rel_triple_extractor.py +216 -0
  162. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/generate/hrkg_rel_triple_path_qa_generator.py +173 -0
  163. dataflow_kg-0.9.0/dataflow/operators/hyper_relation_kg/generate/hrkg_rel_triple_subgraph_qa_generator.py +173 -0
  164. dataflow_kg-0.9.0/dataflow/operators/multi_model_kg/__init__.py +24 -0
  165. dataflow_kg-0.9.0/dataflow/operators/multi_model_kg/filter/mmkg_visual_triple_path_sampling.py +285 -0
  166. dataflow_kg-0.9.0/dataflow/operators/multi_model_kg/filter/mmkg_visual_triple_subgraph_sampling.py +321 -0
  167. dataflow_kg-0.9.0/dataflow/operators/multi_model_kg/generate/mmkg_visual_triple_extractor.py +178 -0
  168. dataflow_kg-0.9.0/dataflow/operators/multi_model_kg/generate/mmkg_visual_triple_path_qa_generator.py +145 -0
  169. dataflow_kg-0.9.0/dataflow/operators/multi_model_kg/generate/mmkg_visual_triple_subgraph_qa_generator.py +140 -0
  170. dataflow_kg-0.9.0/dataflow/operators/multi_model_kg/refine/mmkg_entity_link2database.py +96 -0
  171. dataflow_kg-0.9.0/dataflow/operators/multi_model_kg/refine/mmkg_entity_link2img.py +288 -0
  172. dataflow_kg-0.9.0/dataflow/operators/pdf2text/__init__.py +21 -0
  173. dataflow_kg-0.9.0/dataflow/operators/pdf2text/generate/kbc_chunk_generator.py +155 -0
  174. dataflow_kg-0.9.0/dataflow/operators/pdf2text/generate/kbc_chunk_generator_batch.py +175 -0
  175. dataflow_kg-0.9.0/dataflow/operators/pdf2text/generate/kbc_text_cleaner.py +137 -0
  176. dataflow_kg-0.9.0/dataflow/operators/pdf2text/generate/kbc_text_cleaner_batch.py +148 -0
  177. dataflow_kg-0.9.0/dataflow/operators/pdf2text/generate/mineru_operators.py +626 -0
  178. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/__init__.py +28 -0
  179. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/eval/tkg_4tuple_time_summary.py +160 -0
  180. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/filter/tkg_4tuple_time_sampling.py +212 -0
  181. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/generate/tkg_4tuple_extractor.py +229 -0
  182. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/generate/tkg_4tuple_merge.py +177 -0
  183. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/generate/tkg_attri_4tuple_qa_generator.py +140 -0
  184. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/generate/tkg_rel_4tuple_conversation_generator.py +119 -0
  185. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/generate/tkg_rel_4tuple_path_qa_generator.py +150 -0
  186. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/generate/tkg_rel_4tuple_subgraph_qa_generator.py +140 -0
  187. dataflow_kg-0.9.0/dataflow/operators/temporal_kg/refinement/tkg_4tuple_disambiguation.py +164 -0
  188. dataflow_kg-0.9.0/dataflow/pipeline/Pipeline.py +532 -0
  189. dataflow_kg-0.9.0/dataflow/pipeline/__init__.py +5 -0
  190. dataflow_kg-0.9.0/dataflow/pipeline/nodes.py +94 -0
  191. dataflow_kg-0.9.0/dataflow/prompts/application_kg/graph_rag.py +359 -0
  192. dataflow_kg-0.9.0/dataflow/prompts/application_kg/graph_reasoning.py +222 -0
  193. dataflow_kg-0.9.0/dataflow/prompts/core_kg/attri_triple.py +1040 -0
  194. dataflow_kg-0.9.0/dataflow/prompts/core_kg/rel_triple_eval.py +816 -0
  195. dataflow_kg-0.9.0/dataflow/prompts/core_kg/rel_triple_filter.py +306 -0
  196. dataflow_kg-0.9.0/dataflow/prompts/core_kg/rel_triple_generate.py +1238 -0
  197. dataflow_kg-0.9.0/dataflow/prompts/core_kg/rel_triple_refinement.py +538 -0
  198. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/cskg.py +1077 -0
  199. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/finkg.py +1374 -0
  200. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/geokg.py +1140 -0
  201. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/hrkg.py +745 -0
  202. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/legalkg.py +612 -0
  203. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/medkg.py +366 -0
  204. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/mmkg.py +577 -0
  205. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/schokg.py +365 -0
  206. dataflow_kg-0.9.0/dataflow/prompts/diverse_kg/tkg.py +1431 -0
  207. dataflow_kg-0.9.0/dataflow/serving/LocalSentenceLLMServing.py +184 -0
  208. dataflow_kg-0.9.0/dataflow/serving/__init__.py +28 -0
  209. dataflow_kg-0.9.0/dataflow/serving/api_google_vertexai_serving.py +992 -0
  210. dataflow_kg-0.9.0/dataflow/serving/api_llm_serving_request.py +225 -0
  211. dataflow_kg-0.9.0/dataflow/serving/api_vlm_serving_openai.py +376 -0
  212. dataflow_kg-0.9.0/dataflow/serving/google_api_serving.py +53 -0
  213. dataflow_kg-0.9.0/dataflow/serving/light_rag_serving.py +146 -0
  214. dataflow_kg-0.9.0/dataflow/serving/lite_llm_serving.py +437 -0
  215. dataflow_kg-0.9.0/dataflow/serving/local_model_llm_serving.py +437 -0
  216. dataflow_kg-0.9.0/dataflow/serving/local_model_vlm_serving.py +361 -0
  217. dataflow_kg-0.9.0/dataflow/serving/localhost_llm_api_serving.py +242 -0
  218. dataflow_kg-0.9.0/dataflow/serving/localmodel_lalm_serving.py +256 -0
  219. dataflow_kg-0.9.0/dataflow/statics/pipelines/__init__.py +0 -0
  220. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/finkg_risk_pipeline.py +93 -0
  221. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/geokg_spatiotemporal_event_pipeline.py +134 -0
  222. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/graph_rag_pipeline.py +108 -0
  223. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/graph_reasoning_pipeline.py +90 -0
  224. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/hyper_kg_qa_pipeline.py +79 -0
  225. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/kg_evaluation_visualization_pipeline.py +164 -0
  226. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/kg_extraction_pipeline.py +93 -0
  227. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/kg_qa_pipeline.py +131 -0
  228. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/legalkg_application_pipeline.py +100 -0
  229. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/medkg_application_pipeline.py +72 -0
  230. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/multimodal_kg_pipeline.py +126 -0
  231. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/schokg_application_pipeline.py +73 -0
  232. dataflow_kg-0.9.0/dataflow/statics/pipelines/api_pipelines/tkg_qa_pipeline.py +96 -0
  233. dataflow_kg-0.9.0/dataflow/statics/pipelines/gpu_pipelines/graph_rag_pipeline.py +135 -0
  234. dataflow_kg-0.9.0/dataflow/statics/pipelines/gpu_pipelines/graph_reasoning_pipeline.py +109 -0
  235. dataflow_kg-0.9.0/dataflow/statics/pipelines/gpu_pipelines/hyper_kg_qa_pipeline.py +98 -0
  236. dataflow_kg-0.9.0/dataflow/statics/pipelines/gpu_pipelines/kg_extraction_pipeline.py +110 -0
  237. dataflow_kg-0.9.0/dataflow/statics/pipelines/gpu_pipelines/kg_qa_pipeline.py +144 -0
  238. dataflow_kg-0.9.0/dataflow/statics/pipelines/gpu_pipelines/tkg_qa_pipeline.py +112 -0
  239. dataflow_kg-0.9.0/dataflow/utils/__init__.py +5 -0
  240. dataflow_kg-0.9.0/dataflow/utils/core_kg/embedding_serving.py +426 -0
  241. dataflow_kg-0.9.0/dataflow/utils/diverse_kg/wikidata_client.py +241 -0
  242. dataflow_kg-0.9.0/dataflow/utils/registry.py +364 -0
  243. dataflow_kg-0.9.0/dataflow/utils/storage.py +875 -0
  244. dataflow_kg-0.9.0/dataflow/utils/utils.py +28 -0
  245. dataflow_kg-0.9.0/dataflow/version.py +23 -0
  246. dataflow_kg-0.9.0/dataflow/wrapper/__init__.py +6 -0
  247. dataflow_kg-0.9.0/dataflow/wrapper/auto_op.py +105 -0
  248. dataflow_kg-0.9.0/dataflow/wrapper/batch_wrapper.py +98 -0
  249. dataflow_kg-0.9.0/dataflow_kg.egg-info/PKG-INFO +313 -0
  250. dataflow_kg-0.9.0/dataflow_kg.egg-info/SOURCES.txt +255 -0
  251. dataflow_kg-0.9.0/dataflow_kg.egg-info/dependency_links.txt +1 -0
  252. dataflow_kg-0.9.0/dataflow_kg.egg-info/entry_points.txt +2 -0
  253. dataflow_kg-0.9.0/dataflow_kg.egg-info/requires.txt +99 -0
  254. dataflow_kg-0.9.0/dataflow_kg.egg-info/top_level.txt +1 -0
  255. dataflow_kg-0.9.0/pyproject.toml +74 -0
  256. dataflow_kg-0.9.0/requirements.txt +46 -0
  257. dataflow_kg-0.9.0/setup.cfg +4 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,21 @@
1
+ # 明确指定源码文件
2
+ recursive-include dataflow *.py
3
+ recursive-include dataflow *.json
4
+ recursive-include dataflow *.yaml
5
+ recursive-include dataflow *.sh
6
+ recursive-include dataflow *.txt
7
+
8
+ # 包含样例文件夹下所有类型的文件
9
+ # 样例文件夹路径为dataflow/exaple
10
+ recursive-include dataflow/example */
11
+
12
+ # 包含顶层文档文件
13
+ include README.md
14
+ include requirements.txt
15
+ include LICENSE
16
+
17
+ # 排除无用缓存文件
18
+ global-exclude *.py[cod]
19
+ global-exclude __pycache__/
20
+ global-exclude *.so
21
+ global-exclude *.egg-info/
@@ -0,0 +1,313 @@
1
+ Metadata-Version: 2.4
2
+ Name: dataflow-kg
3
+ Version: 0.9.0
4
+ Summary: Modern Data Centric AI system for Large Language Models
5
+ Author-email: Zhengpin Li <zpli@pku.edu.cn>
6
+ License: Apache-2.0
7
+ Project-URL: Github, https://github.com/Open-DataFlow/DataFlow-KG
8
+ Project-URL: Documentation, https://open-dataflow.github.io/DataFlow-Doc/
9
+ Project-URL: Bug Reports, https://github.com/Open-DataFlow/DataFlow-KG/issues
10
+ Keywords: Artificial Intelligence,Knowledge Graph
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Classifier: License :: Free For Educational Use
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.7
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3 :: Only
22
+ Requires-Python: <4,>=3.7
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: numpy<2.0.0
26
+ Requires-Dist: datasets
27
+ Requires-Dist: scipy
28
+ Requires-Dist: torch
29
+ Requires-Dist: torchvision
30
+ Requires-Dist: torchaudio
31
+ Requires-Dist: tqdm
32
+ Requires-Dist: transformers<4.54.0
33
+ Requires-Dist: accelerate
34
+ Requires-Dist: rapidfuzz
35
+ Requires-Dist: colorlog
36
+ Requires-Dist: appdirs
37
+ Requires-Dist: datasketch
38
+ Requires-Dist: httpx[socks]
39
+ Requires-Dist: modelscope
40
+ Requires-Dist: addict
41
+ Requires-Dist: pytest
42
+ Requires-Dist: rich
43
+ Requires-Dist: pydantic
44
+ Requires-Dist: nltk
45
+ Requires-Dist: colorama
46
+ Requires-Dist: json5
47
+ Requires-Dist: tiktoken
48
+ Requires-Dist: sqlglot
49
+ Requires-Dist: gradio>5
50
+ Requires-Dist: fasttext-wheel
51
+ Requires-Dist: openai
52
+ Requires-Dist: sentencepiece
53
+ Requires-Dist: datasketch
54
+ Requires-Dist: presidio_analyzer[transformers]
55
+ Requires-Dist: vendi-score==0.0.3
56
+ Requires-Dist: google-api-core
57
+ Requires-Dist: google-api-python-client
58
+ Requires-Dist: contractions
59
+ Requires-Dist: cookiecutter
60
+ Requires-Dist: trafilatura
61
+ Requires-Dist: lxml_html_clean
62
+ Requires-Dist: pymupdf
63
+ Requires-Dist: cloudpickle
64
+ Requires-Dist: pandas
65
+ Requires-Dist: google-cloud-aiplatform>=1.55
66
+ Requires-Dist: google-cloud-bigquery
67
+ Requires-Dist: google-genai
68
+ Requires-Dist: gcsfs
69
+ Requires-Dist: networkx
70
+ Requires-Dist: pyvis
71
+ Provides-Extra: vllm
72
+ Requires-Dist: vllm<=0.9.2,>=0.7.0; extra == "vllm"
73
+ Requires-Dist: numpy<2.0.0; extra == "vllm"
74
+ Provides-Extra: vllm07
75
+ Requires-Dist: vllm<0.8; extra == "vllm07"
76
+ Requires-Dist: numpy<2.0.0; extra == "vllm07"
77
+ Provides-Extra: vllm08
78
+ Requires-Dist: vllm<0.9; extra == "vllm08"
79
+ Provides-Extra: kbc
80
+ Requires-Dist: vllm==0.6.3; extra == "kbc"
81
+ Requires-Dist: mineru[pipeline]==2.0.6; extra == "kbc"
82
+ Provides-Extra: mineru
83
+ Requires-Dist: mineru[all]; extra == "mineru"
84
+ Requires-Dist: numpy<2.0.0,>=1.24; extra == "mineru"
85
+ Requires-Dist: sglang[all]>=0.4.8; extra == "mineru"
86
+ Requires-Dist: pypdf; extra == "mineru"
87
+ Requires-Dist: reportlab; extra == "mineru"
88
+ Provides-Extra: myscale
89
+ Requires-Dist: clickhouse-driver; extra == "myscale"
90
+ Provides-Extra: sglang
91
+ Requires-Dist: sglang[all]; extra == "sglang"
92
+ Provides-Extra: litellm
93
+ Requires-Dist: litellm<2.0.0,>=1.70.0; extra == "litellm"
94
+ Provides-Extra: audio
95
+ Requires-Dist: librosa; extra == "audio"
96
+ Provides-Extra: vectorsql
97
+ Requires-Dist: sqlite-vec; extra == "vectorsql"
98
+ Requires-Dist: sqlite-lembed; extra == "vectorsql"
99
+ Requires-Dist: sentence_transformers; extra == "vectorsql"
100
+ Provides-Extra: pdf2model
101
+ Requires-Dist: llamafactory[metrics,torch]>=0.9.0; extra == "pdf2model"
102
+ Requires-Dist: vllm<0.9.2,>=0.7.0; extra == "pdf2model"
103
+ Requires-Dist: numpy<2.0.0,>=1.24; extra == "pdf2model"
104
+ Requires-Dist: mineru[pipeline]; extra == "pdf2model"
105
+ Requires-Dist: mineru-vl-utils; extra == "pdf2model"
106
+ Provides-Extra: eval
107
+ Requires-Dist: vllm<0.9.2,>=0.7.0; extra == "eval"
108
+ Provides-Extra: rag
109
+ Requires-Dist: lightrag-hku; extra == "rag"
110
+ Requires-Dist: asyncio; extra == "rag"
111
+ Dynamic: license-file
112
+
113
+ # DataFlow Knowledge Graph
114
+ *Knowledge graph data preparation with DataFlow style operators and pipelines*
115
+
116
+ <p align="center">
117
+ <img src="static/dataflow-KG%20framework.png" alt="DataFlow-KG framework" width="100%">
118
+ </p>
119
+
120
+ <p align="center">
121
+ <b>DataFlow Knowledge Graph</b>: An LLM-Driven Knowledge Graph Processing Library
122
+ </p>
123
+
124
+ <p align="center">
125
+ Build, enrich, reason over, and operationalize knowledge graphs with composable operators.
126
+ </p>
127
+
128
+ <p align="center">
129
+ <a href="https://github.com/OpenDCAI/DataFlow-KG">GitHub</a> |
130
+ <a href="https://zhp-li197.github.io/DataFlow-KG-Doc/zh/">Documentation</a> |
131
+ <a href="README.zh.md">中文 README</a>
132
+ </p>
133
+
134
+ ---
135
+
136
+ ## 0. News
137
+
138
+ ## 1. 🤖 Overview
139
+
140
+ **DataFlow-KG** (short for DataFlow Knowledge Graph) is an LLM-driven knowledge graph processing library built on top of the [DataFlow](https://github.com/OpenDCAI/DataFlow) ecosystem. It is designed to provide reusable, extensible, and modular operators for knowledge graph construction, reasoning, retrieval, querying, and domain-specific applications. The original [DataFlow](https://github.com/OpenDCAI/DataFlow) project provides a clean, elegant, and highly extensible foundation for building practical data-centric LLM workflows.
141
+
142
+ Rather than treating KG workflows as isolated scripts, DataFlow-KG organizes graph capabilities into operator packages by graph type and application scenario. These operators can be composed into larger pipelines, including but not limited to:
143
+
144
+ - knowledge graph construction
145
+ - graph reasoning
146
+ - graph retrieval
147
+ - domain-specific knowledge graph applications
148
+
149
+ DataFlow-KG aims to serve as a unified infrastructure layer for research and development on graph-centric LLM applications.
150
+
151
+
152
+ ## 2. ✨ Key Features
153
+
154
+ ### 2.1. Modular Operator Library for KG Workflows
155
+ DataFlow-KG provides reusable operators that can be flexibly composed into pipelines for graph construction, graph enrichment, reasoning, retrieval, and task-specific graph processing. Operators are not standalone utilities. They are designed to be assembled into end-to-end workflows, enabling scalable and reproducible graph data engineering.
156
+
157
+ ### 2.2 Unified Support for Multiple KG Paradigms
158
+ The library supports a broad range of graph settings in one framework, including general KG, commonsense KG, temporal KG, multimodal KG, hyper-relational KG, Graph RAG, and domain-specific KGs. As an extension of DataFlow, DataFlow-KG follows the same design philosophy of composable operators and pipeline-based processing, making it easy to integrate with broader data preparation workflows.
159
+
160
+ ### 2.3. Research-to-Application Coverage
161
+ The framework is designed for both research scenarios and practical vertical applications, supporting graph processing tasks from foundational KG construction to specialized domain deployment.
162
+
163
+
164
+ ## 3. 🔍 Installation
165
+
166
+ ### 3.1. Create and activate a Python environment
167
+
168
+ ```bash
169
+ conda create -n dfkg python=3.10
170
+ conda activate dfkg
171
+ ````
172
+
173
+ ### 3.2. Install DataFlow-KG
174
+
175
+ ```bash
176
+ pip install uv
177
+ uv pip install dataflow-kg
178
+ ```
179
+
180
+ If you want to enable **local GPU inference**, use:
181
+
182
+ ```bash
183
+ conda create -n dfkg python=3.10
184
+ conda activate dfkg
185
+
186
+ pip install uv
187
+ uv pip install dataflow-kg[vllm]
188
+ ```
189
+
190
+ > DataFlow-KG supports Python >= 3.10.
191
+
192
+ ### 3.3. Verify the installation
193
+
194
+ You can check whether the installation is successful with:
195
+
196
+ ```bash
197
+ dfkg -v
198
+ ```
199
+
200
+ If the installation is correct and DataFlow-KG is the latest release, you will see something like:
201
+
202
+ ```log
203
+ open-dataflow-kg codebase version: 0.9.0
204
+ Checking for updates...
205
+ Local version: 0.9.0
206
+ PyPI newest version: 0.9.0
207
+ You are using the latest version: 0.9.0.
208
+ ```
209
+
210
+ In addition, the `dfkg env` command can be used to inspect the current hardware and software environment, which is useful for bug reporting:
211
+
212
+ ```bash
213
+ dfkg env
214
+ ```
215
+
216
+
217
+ ## 4. 🚀 Quickstart
218
+
219
+ DataFlow-KG follows a **code generation + custom modification + script execution** workflow. In practice, you initialize a project with the CLI, customize the generated pipeline script if needed, and then run the Python file to execute your workflow.
220
+
221
+ You can get started in **three steps**.
222
+
223
+ ### 4.1. Initialize a project
224
+
225
+ Run the following command in an empty directory:
226
+
227
+ ```bash
228
+ dfkg init
229
+ ````
230
+
231
+ ### 4.2. Choose a pipeline type
232
+
233
+ Pipelines with the same name across different folders are usually incremental variants with different dependency requirements:
234
+
235
+ | Directory | Required Resources |
236
+ | --------------- | --------------------- |
237
+ | `api_pipelines` | CPU + LLM API |
238
+ | `gpu_pipelines` | CPU + API + local GPU |
239
+
240
+ > **Tip:** If you are new to DataFlow-KG, start with `api_pipelines`.
241
+ > Later, if you have a local GPU, you can replace `LLMServing` with a local model backend.
242
+
243
+
244
+ ### 4.3. Run your first pipeline
245
+
246
+ Go into any pipeline directory, for example:
247
+
248
+ ```bash
249
+ cd api_pipelines
250
+ ```
251
+
252
+ Open one of the generated Python pipeline files. In most cases, you only need to check two configurations:
253
+
254
+ #### 4.3.1 Input data path
255
+
256
+ ```python
257
+ self.storage = FileStorage(
258
+ first_entry_file_name="<path_to_dataset>"
259
+ )
260
+ ```
261
+
262
+ By default, this points to the provided example dataset, so you can run it directly.
263
+ You can also replace it with your own dataset path.
264
+
265
+ #### 4.3.2 LLM serving configuration
266
+
267
+ If you are using an API-based serving backend, set the API key first.
268
+
269
+ **Linux / macOS**
270
+
271
+ ```bash
272
+ export DF_API_KEY=sk-xxxxx
273
+ ```
274
+
275
+ **Windows CMD**
276
+
277
+ ```bat
278
+ set DF_API_KEY=sk-xxxxx
279
+ ```
280
+
281
+ **PowerShell**
282
+
283
+ ```powershell
284
+ $env:DF_API_KEY="sk-xxxxx"
285
+ ```
286
+
287
+ Then run the pipeline script:
288
+
289
+ ```bash
290
+ python xxx_pipeline.py
291
+ ```
292
+
293
+ ---
294
+
295
+
296
+
297
+ ## 5. 📚 Licence
298
+
299
+ DataFlow-KG is released under the **Apache License 2.0**.
300
+
301
+
302
+
303
+ ## 6. 🎓 Citation
304
+ If you use DataFlow-KG in your research, please cite:
305
+
306
+ ```bibtex
307
+ @misc{dataflowkg2026,
308
+ title={DataFlow-KG: LLM-Driven Knowledge Graph Processing Library},
309
+ author={DataFlow-KG Team},
310
+ year={2026},
311
+ howpublished={\url{https://github.com/OpenDCAI/DataFlow-KG}}
312
+ }
313
+ ```