Skip to content

Conversation

@ChenZiHong-Gavin
Copy link
Collaborator

No description provided.

@ChenZiHong-Gavin ChenZiHong-Gavin marked this pull request as draft August 13, 2025 09:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a Chain-of-Thought (CoT) data generation pipeline for community-based reasoning. The implementation provides templates and operators for generating structured reasoning paths from knowledge graph communities, enabling the creation of training data for chain-of-thought reasoning.

Key changes include:

  • Addition of CoT template design and generation prompts for both Chinese and English
  • Implementation of community detection and CoT generation operators
  • Code cleanup and standardization across existing template files

Reviewed Changes

Copilot reviewed 13 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
requirements-dev.txt Adds pytest dependency for development testing
graphgen/templates/community/cot_template_design.py Defines prompts for designing CoT reasoning path templates
graphgen/templates/community/cot_generation.py Defines prompts for generating CoT data from templates
graphgen/templates/community/init.py Exports CoT-related prompt constants
graphgen/operators/community/generate_cot.py Implements the main CoT generation pipeline using community detection
graphgen/models/community/community_detector.py Implements Leiden algorithm for community detection
graphgen/models/vis/community_visualizer.py Provides visualization capabilities for community graphs
graphgen/templates/coreference_resolution.py Renames template constant and removes pylint disable
graphgen/templates/answer_rephrasing.py Removes extra blank lines and fixes trailing commas
graphgen/templates/init.py Updates imports to reflect renamed constants
graphgen/operators/resolute_coreference.py Updates to use renamed constant and improves formatting
graphgen/models/init.py Exports new CommunityDetector class
README.md Updates acknowledgements section

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

)
reasoning_path = cot_template.split("Reasoning-Path Design:")[1].strip()
else:
raise ValueError("COT template format is incorrect.")
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message is not helpful for debugging. It should include information about what format was expected and what was actually received.

Suggested change
raise ValueError("COT template format is incorrect.")
raise ValueError(
f"COT template format is incorrect. Expected to find either '问题:' and '推理路径设计:' or 'Question:' and 'Reasoning-Path Design:' in the template. Received: {repr(cot_template)}"
)

Copilot uses AI. Check for mistakes.
ChenZiHong-Gavin and others added 5 commits August 13, 2025 17:44
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ChenZiHong-Gavin ChenZiHong-Gavin marked this pull request as ready for review August 14, 2025 08:50
@ChenZiHong-Gavin ChenZiHong-Gavin merged commit 7a27bad into main Aug 14, 2025
2 checks passed
@ChenZiHong-Gavin ChenZiHong-Gavin deleted the community branch August 14, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants