Coverage for src / lilbee / retrieval / concepts / __init__.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-05-15 20:55 +0000

1"""Concept graph for LazyGraphRAG-style index-time knowledge extraction. 

2 

3Extracts noun-phrase concepts from chunks via spaCy, builds a PPMI-weighted 

4co-occurrence graph (Church & Hanks 1990), and clusters with Leiden 

5(Traag et al. 2019, graspologic-native). Used to boost search results by 

6concept overlap and expand queries via graph traversal. 

7 

8Requires optional ``graph`` extra: ``pip install lilbee[graph]``. 

9When dependencies are missing, all public functions degrade gracefully. 

10""" 

11 

12from __future__ import annotations 

13 

14from lilbee.retrieval.concepts.clusterer import ConceptGraphClusterer 

15from lilbee.retrieval.concepts.community import Community 

16from lilbee.retrieval.concepts.graph import ConceptGraph 

17from lilbee.retrieval.concepts.nlp import concepts_available, load_spacy_pipeline 

18 

19__all__ = [ 

20 "Community", 

21 "ConceptGraph", 

22 "ConceptGraphClusterer", 

23 "concepts_available", 

24 "load_spacy_pipeline", 

25]