-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changing audio video and image pipeline, so transcript is not saved s…
…eperatly.
- Loading branch information
Showing
11 changed files
with
248 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
21 changes: 21 additions & 0 deletions
21
backend/src/app/preprocessing/pipeline/steps/common/persist_sdoc_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from sqlalchemy.orm import Session | ||
|
||
from app.core.data.crud.source_document_data import crud_sdoc_data | ||
from app.core.data.dto.source_document_data import SourceDocumentDataCreate | ||
from app.core.data.orm.source_document import SourceDocumentORM | ||
from app.preprocessing.pipeline.model.text.preprotextdoc import PreProTextDoc | ||
|
||
|
||
def persist_sdoc_data( | ||
db: Session, sdoc_db_obj: SourceDocumentORM, pptd: PreProTextDoc | ||
) -> None: | ||
sdoc_data = SourceDocumentDataCreate( | ||
id=sdoc_db_obj.id, | ||
content=pptd.text, | ||
html=pptd.html, | ||
token_starts=[s for s, _ in pptd.token_character_offsets], | ||
token_ends=[e for _, e in pptd.token_character_offsets], | ||
sentence_starts=[s.start for s in pptd.sentences], | ||
sentence_ends=[s.end for s in pptd.sentences], | ||
) | ||
crud_sdoc_data.create(db=db, create_dto=sdoc_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.