MCPcopy Create free account
hub / github.com/Enfoirer/Text2GraphRAG / Entity

Class Entity

nano_graphrag/entity_extraction/module.py:65–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63
64
65class Entity(BaseModel):
66 entity_name: str = Field(..., description="The name of the entity.")
67 entity_type: str = Field(..., description="The type of the entity.")
68 description: str = Field(
69 ..., description="The description of the entity, in details and comprehensive."
70 )
71 importance_score: float = Field(
72 ...,
73 ge=0,
74 le=1,
75 description="Importance score of the entity. Should be between 0 and 1 with 1 being the most important.",
76 )
77
78 def to_dict(self):
79 return {
80 "entity_name": clean_str(self.entity_name.upper()),
81 "entity_type": clean_str(self.entity_type.upper()),
82 "description": clean_str(self.description),
83 "importance_score": float(self.importance_score),
84 }
85
86
87class Relationship(BaseModel):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected