class BaseCharacter: | |
def __init__(self, key, name, type, media, label: list): | |
self.key = key | |
self.name = name | |
self.type = type | |
self.media = media | |
self.label = label | |
self.embedding = None | |
def parse(self): | |
labels = ",".join(self.label) | |
res = f"{self.name}: {labels}" | |
return res | |
def get_label(self): | |
return " ".join(self.label) | |
def to_dict(self): | |
return { | |
"key": self.key, | |
"name": self.name, | |
"type": self.type, | |
"media": self.media, | |
"label": self.label, | |
"embedding": self.embedding | |
} |