models.py
- Pfad:
/var/www/scripts/pipeline/semantic_chunk/models.py - Namespace: pipeline
- Zeilen: 37 | Größe: 652 Bytes
- Geändert: 2025-12-25 14:04:58 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 100
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Dependencies 1
- use dataclasses.dataclass
Klassen 3
-
ChunkSemanticsclass Zeile 9 -
Entityclass Zeile 21 -
Relationclass Zeile 30
Code
"""
Data models for semantic chunk analysis.
"""
from dataclasses import dataclass
@dataclass
class ChunkSemantics:
"""Semantische Analyse eines Chunks."""
chunk_id: int
summary: str
keywords: list[str]
sentiment: str # positive, neutral, negative, mixed
topics: list[str]
language: str
@dataclass
class Entity:
"""Extrahierte Entität."""
name: str
entity_type: str # PERSON, ORGANIZATION, CONCEPT, LOCATION, OTHER
description: str | None = None
@dataclass
class Relation:
"""Beziehung zwischen Entitäten."""
source: str
relation_type: str
target: str
strength: float = 0.5