fmt: applied some formatting changes
This commit is contained in:
+3
-3
@@ -71,9 +71,9 @@ pub struct ExtractedRelationship {
|
|||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct KnowledgeGraph {
|
pub struct KnowledgeGraph {
|
||||||
pub graph: StableGraph<Entity, Relationship>,
|
pub graph: StableGraph<Entity, Relationship>,
|
||||||
/// Lowercased entity name → raw node index
|
/// Lowercased entity name -> raw node index
|
||||||
pub entity_index: IndexMap<String, u32>,
|
pub entity_index: IndexMap<String, u32>,
|
||||||
/// DocumentId inner value → raw node indices for entities in that chunk
|
/// DocumentId inner value -> raw node indices for entities in that chunk
|
||||||
pub document_entities: IndexMap<usize, Vec<u32>>,
|
pub document_entities: IndexMap<usize, Vec<u32>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,6 +176,7 @@ impl KnowledgeGraph {
|
|||||||
map.entry(node_raw).or_default().push(doc_id);
|
map.entry(node_raw).or_default().push(doc_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
map
|
map
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +237,6 @@ pub async fn extract_entities(
|
|||||||
.context("Entity extraction LLM call failed")?;
|
.context("Entity extraction LLM call failed")?;
|
||||||
|
|
||||||
let text = output.text.trim();
|
let text = output.text.trim();
|
||||||
// Strip markdown code fences if the model wraps in ```json ... ```
|
|
||||||
let json: String = if text.starts_with("```") {
|
let json: String = if text.starts_with("```") {
|
||||||
text.lines()
|
text.lines()
|
||||||
.skip(1)
|
.skip(1)
|
||||||
|
|||||||
@@ -930,6 +930,7 @@ impl Rag {
|
|||||||
if kg.entity_index.is_empty() {
|
if kg.entity_index.is_empty() {
|
||||||
return vec![];
|
return vec![];
|
||||||
}
|
}
|
||||||
|
|
||||||
let query_lower = query.to_lowercase();
|
let query_lower = query.to_lowercase();
|
||||||
|
|
||||||
let mut seed_nodes: Vec<u32> = kg
|
let mut seed_nodes: Vec<u32> = kg
|
||||||
|
|||||||
Reference in New Issue
Block a user