Models¶
aana.storage.models
¶
BaseEntity
¶
Bases: DeclarativeBase
, InheritanceReuseMixin
Base for all ORM classes.
from_parent
¶
Create a new instance of the child class, reusing attributes from the parent instance.
PARAMETER | DESCRIPTION |
---|---|
parent_instance |
An instance of the parent class
TYPE:
|
kwargs |
Additional keyword arguments to set on the new instance
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
T
|
A new instance of the child class
TYPE:
|
Source code in aana/storage/models/base.py
CaptionEntity
¶
Bases: BaseEntity
, TimeStampEntity
ORM model for video captions.
ATTRIBUTE | DESCRIPTION |
---|---|
id |
Unique identifier for the caption.
TYPE:
|
model |
Name of the model used to generate the caption.
TYPE:
|
frame_id |
The 0-based frame id of video for caption.
TYPE:
|
caption |
Frame caption.
TYPE:
|
timestamp |
Frame timestamp in seconds.
TYPE:
|
caption_type |
The type of caption (populated automatically by ORM based on
TYPE:
|
from_parent
¶
Create a new instance of the child class, reusing attributes from the parent instance.
PARAMETER | DESCRIPTION |
---|---|
parent_instance |
An instance of the parent class
TYPE:
|
kwargs |
Additional keyword arguments to set on the new instance
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
T
|
A new instance of the child class
TYPE:
|
Source code in aana/storage/models/base.py
from_caption_output
¶
Converts a Caption pydantic model to a CaptionEntity.
PARAMETER | DESCRIPTION |
---|---|
model_name |
Name of the model used to generate the caption.
TYPE:
|
caption |
Caption pydantic model.
TYPE:
|
frame_id |
The 0-based frame id of video for caption.
TYPE:
|
timestamp |
Frame timestamp in seconds.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
CaptionEntity
|
ORM model for video captions.
TYPE:
|
Source code in aana/storage/models/caption.py
MediaEntity
¶
Bases: BaseEntity
, TimeStampEntity
Base ORM class for media (e.g. videos, images, etc.).
This class is meant to be subclassed by other media types.
ATTRIBUTE | DESCRIPTION |
---|---|
id |
Unique identifier for the media.
TYPE:
|
media_type |
The type of media (populated automatically by ORM based on
TYPE:
|
from_parent
¶
Create a new instance of the child class, reusing attributes from the parent instance.
PARAMETER | DESCRIPTION |
---|---|
parent_instance |
An instance of the parent class
TYPE:
|
kwargs |
Additional keyword arguments to set on the new instance
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
T
|
A new instance of the child class
TYPE:
|
Source code in aana/storage/models/base.py
TranscriptEntity
¶
Bases: BaseEntity
, TimeStampEntity
ORM class for media transcripts generated by a model.
ATTRIBUTE | DESCRIPTION |
---|---|
id |
Unique identifier for the transcript.
TYPE:
|
model |
Name of the model used to generate the transcript.
TYPE:
|
transcript |
Full text transcript of the media.
TYPE:
|
segments |
Segments of the transcript.
TYPE:
|
language |
Language of the transcript as predicted by the model.
TYPE:
|
language_confidence |
Confidence score of language prediction.
TYPE:
|
transcript_type |
The type of transcript (populated automatically by ORM based on
TYPE:
|
from_parent
¶
Create a new instance of the child class, reusing attributes from the parent instance.
PARAMETER | DESCRIPTION |
---|---|
parent_instance |
An instance of the parent class
TYPE:
|
kwargs |
Additional keyword arguments to set on the new instance
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
T
|
A new instance of the child class
TYPE:
|
Source code in aana/storage/models/base.py
from_asr_output
¶
Converts an AsrTranscriptionInfo and AsrTranscription to a single Transcript entity.
PARAMETER | DESCRIPTION |
---|---|
model_name |
Name of the model used to generate the transcript.
TYPE:
|
info |
Information about the transcription.
TYPE:
|
transcription |
The full transcription.
TYPE:
|
segments |
Segments of the transcription.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
TranscriptEntity
|
A new instance of the TranscriptEntity class.
TYPE:
|
Source code in aana/storage/models/transcript.py
VideoEntity
¶
Bases: MediaEntity
Base ORM class for videos.
ATTRIBUTE | DESCRIPTION |
---|---|
id |
Unique identifier for the video.
TYPE:
|
path |
Path to the video file.
TYPE:
|
url |
URL to the video file.
TYPE:
|
title |
Title of the video.
TYPE:
|
description |
Description of the video.
TYPE:
|
from_parent
¶
Create a new instance of the child class, reusing attributes from the parent instance.
PARAMETER | DESCRIPTION |
---|---|
parent_instance |
An instance of the parent class
TYPE:
|
kwargs |
Additional keyword arguments to set on the new instance
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
T
|
A new instance of the child class
TYPE:
|