chore: initial sync
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
"""RelationCandidate — candidato de relacion extraido por el LLM."""
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class RelationCandidate:
|
||||
"""Candidato de relacion entre dos entidades extraido por el LLM.
|
||||
|
||||
`from_name` y `to_name` contienen los nombres crudos del texto. `from_id`
|
||||
y `to_id` se llenan durante la fase de deduplicacion cuando se resuelven
|
||||
contra los EntityCandidate finales.
|
||||
"""
|
||||
|
||||
from_name: str
|
||||
to_name: str
|
||||
from_id: str = ""
|
||||
to_id: str = ""
|
||||
relation_type: str = ""
|
||||
description: str = ""
|
||||
confidence: float = 0.0
|
||||
source_chunk_index: int = -1
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
"""Serializa el candidato a un diccionario."""
|
||||
return {
|
||||
"from_name": self.from_name,
|
||||
"to_name": self.to_name,
|
||||
"from_id": self.from_id,
|
||||
"to_id": self.to_id,
|
||||
"relation_type": self.relation_type,
|
||||
"description": self.description,
|
||||
"confidence": self.confidence,
|
||||
"source_chunk_index": self.source_chunk_index,
|
||||
}
|
||||
Reference in New Issue
Block a user