Community report context building re-renders and re-tokenizes the whole context after every edge

Đang mở
#2,606 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data, performance

Hướng nghiên cứu

Read summarize_communities/graph_context/sort_context.py and trace how build_mixed_context calls sort_context without a token limit. Use the tests/verbs/data fixture to compare build_local_context runtime and output; done means avoiding the repeated per-edge work while preserving byte-identical output. The issue author says a PR is ready, so check with them before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

sort_context in the graph context builder for community reports (summarize_communities/graph_context/sort_context.py) adds edges one at a time and, after each edge, rebuilds the entity, claim and relationship DataFrames, renders them with to_csv and tokenizes the whole context again. That's quadratic in the number of edges per community, and it also runs when no token limit is passed (how build_mixed_context calls it), where the per-edge work is thrown away.

On the tests/verbs/data fixture build_local_context takes 0.91 s, and on a synthetic 10k-entity graph 12.5 s. Recording the prefix sizes once and searching for the first edge that exceeds the limit gives 0.14 s and 2.85 s with byte-identical output. I have a PR ready if that's welcome.

Ngôn ngữ chính
Python
Star
36.6k
Fork
3.9k
Merge trung bình
4 ngày 11 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/graphrag

Tất cả issue của microsoft/graphrag

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.