Skip to main content

tango_core/entities/
transcript_document.rs

1use sea_orm::entity::prelude::*;
2use serde::{Deserialize, Serialize};
3
4/// The deduplicated body of one transcript, for whole-transcript search.
5///
6/// One row per (video, language, source). The body is the cue texts merged by
7/// `deduplicate_blocks`, which is what removes the rolling repetition that
8/// makes raw ASR prose hard to rank and fills results with near-duplicates.
9#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
10#[sea_orm(table_name = "video_transcript_documents")]
11pub struct Model {
12    #[sea_orm(primary_key, auto_increment = false)]
13    pub video_id: String,
14    #[sea_orm(primary_key, auto_increment = false)]
15    pub lang: String,
16    #[sea_orm(primary_key, auto_increment = false)]
17    pub source: String,
18    pub body: String,
19    /// Generated and therefore never inserted; see `transcript::Model::tsv`.
20    #[sea_orm(ignore)]
21    pub tsv: String,
22    pub updated_at: DateTimeWithTimeZone,
23}
24
25#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
26pub enum Relation {}
27
28impl ActiveModelBehavior for ActiveModel {}