now.app.base.preprocess module#

now.app.base.preprocess.preprocess_text(d)[source]#

Splits the text by sentences and puts each sentence into the chunk chunk level.

Generates sentence chunks: Before Document(chunks=[Document(text=’s1. s2. s3’)])

After Document(chunks=[Document(text=None, chunks=[Document(‘s1’), Document(‘s2’)..])])

Return type

Document

now.app.base.preprocess.preprocess_image(d)[source]#

loads document into memory and creates thumbnail.

now.app.base.preprocess.preprocess_video(d)[source]#
now.app.base.preprocess.ndarray_to_jpeg_bytes(arr)[source]#
Return type

bytes

now.app.base.preprocess.to_thumbnail_jpg(doc)[source]#