Skip to content

Commit d0543d1

Browse files
Move extractors (microsoft#1516)
* Consolidate graph embedding and umap * Consolidate claim extraction * Consolidate graph extractor * Move graph utils * Move summarizers * Semver --------- Co-authored-by: Alonso Guevara <[email protected]>
1 parent d59b397 commit d0543d1

File tree

59 files changed

+292
-519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+292
-519
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "patch",
3+
"description": "Move extractor code to co-locate with operations."
4+
}

graphrag/config/models/claim_extraction_config.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ class ClaimExtractionConfig(LLMConfig):
3737

3838
def resolved_strategy(self, root_dir: str, encoding_model: str | None) -> dict:
3939
"""Get the resolved claim extraction strategy."""
40-
from graphrag.index.operations.extract_covariates import (
41-
ExtractClaimsStrategyType,
42-
)
43-
4440
return self.strategy or {
45-
"type": ExtractClaimsStrategyType.graph_intelligence,
4641
"llm": self.llm.model_dump(),
4742
**self.parallelization.model_dump(),
4843
"extraction_prompt": (Path(root_dir) / self.prompt)

graphrag/config/models/embed_graph_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class EmbedGraphConfig(BaseModel):
3636

3737
def resolved_strategy(self) -> dict:
3838
"""Get the resolved node2vec strategy."""
39-
from graphrag.index.operations.embed_graph import (
39+
from graphrag.index.operations.embed_graph.typing import (
4040
EmbedGraphStrategyType,
4141
)
4242

graphrag/index/flows/create_final_community_reports.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
)
1313

1414
from graphrag.cache.pipeline_cache import PipelineCache
15-
from graphrag.index.graph.extractors.community_reports.schemas import (
15+
from graphrag.index.operations.summarize_communities import (
16+
prepare_community_reports,
17+
restore_community_hierarchy,
18+
summarize_communities,
19+
)
20+
from graphrag.index.operations.summarize_communities.community_reports_extractor.schemas import (
1621
CLAIM_DESCRIPTION,
1722
CLAIM_DETAILS,
1823
CLAIM_ID,
@@ -32,11 +37,6 @@
3237
NODE_ID,
3338
NODE_NAME,
3439
)
35-
from graphrag.index.operations.summarize_communities import (
36-
prepare_community_reports,
37-
restore_community_hierarchy,
38-
summarize_communities,
39-
)
4040

4141

4242
async def create_final_community_reports(

graphrag/index/flows/create_final_covariates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
)
1414

1515
from graphrag.cache.pipeline_cache import PipelineCache
16-
from graphrag.index.operations.extract_covariates import (
16+
from graphrag.index.operations.extract_covariates.extract_covariates import (
1717
extract_covariates,
1818
)
1919

graphrag/index/flows/create_final_nodes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
)
1212

1313
from graphrag.index.operations.create_graph import create_graph
14-
from graphrag.index.operations.embed_graph import embed_graph
15-
from graphrag.index.operations.layout_graph import layout_graph
14+
from graphrag.index.operations.embed_graph.embed_graph import embed_graph
15+
from graphrag.index.operations.layout_graph.layout_graph import layout_graph
1616

1717

1818
def create_final_nodes(

graphrag/index/graph/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

graphrag/index/graph/embedding/__init__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

graphrag/index/graph/extractors/__init__.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

graphrag/index/graph/extractors/claims/__init__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)