MCPcopy Create free account

hub / github.com/alberto-solano/open-source-LLM-translation-tool / functions

Functions49 in github.com/alberto-solano/open-source-LLM-translation-tool

↓ 6 callersMethodExecute
(self, paragraph)
src/translate_docx.py:108
↓ 4 callersFunctionconvert_text
Function to generate a list of strings with a limited number of tokens given the max_tokens parameter. The sentence is splited by ". " as a se
src/utils.py:34
↓ 4 callersFunctionlanguage_detection
Function to automatically detect a langauge using the lid218e model. Parameters ---------- text : list Text list with the paragra
src/utils.py:90
↓ 3 callersFunctionbasic_preprocessing
(_string)
src/utils.py:26
↓ 2 callersMethodbrowse_slide
All PowerPoint slides are composed of shapes. We are going inside each shape in order to translate the text on them PARAMETERS:
src/translate_pptx.py:117
↓ 2 callersMethodchange_text_frame_text
Operate text modifications to a shape which contains/is a text_frame. PARAMETERS: shape : pptx.shapes.shapetree.SlideShapes
src/translate_pptx.py:89
↓ 1 callersMethodbody_content
(self, document)
src/translate_docx.py:71
↓ 1 callersMethodbody_tables
(self, document)
src/translate_docx.py:76
↓ 1 callersMethodbrowse_shape
PowerPoint Shapes might be of different kind. Each kind of shape has its own way to deal with text. This functions aims to roo
src/translate_pptx.py:63
↓ 1 callersMethodchange_table_text
Operate text translation to a shape which contains/is a table. PARAMETERS: shape : pptx.shapes.shapetree.SlideShapes Orig
src/translate_pptx.py:132
↓ 1 callersFunctionconvert_pdf2image
Function to convert a PDF into a set of images. Parameters ---------- doc_filepath : str String with complete path to the documen
src/preprocess_pdf.py:9
↓ 1 callersFunctiondetect_language_from_images
Function to infer the language of a group of images using the google Tesseract OCR engine + lid218e model. Parameters ---------- img_
src/utils.py:124
↓ 1 callersMethodfooters
(self, document)
src/translate_docx.py:96
↓ 1 callersFunctionget_y_and_heights
Gets the vertical size of a given text: https://stackoverflow.com/questions/43060479/
src/save_document.py:223
↓ 1 callersFunctionhandle_non_ascii
Convert all non-ASCII characters to their closest ASCII equivalent automatically.
src/utils.py:9
↓ 1 callersFunctionhandle_utf8
(_string)
src/utils.py:16
↓ 1 callersFunctionhandle_whitespaces
(_string)
src/utils.py:21
↓ 1 callersMethodheaders
(self, document)
src/translate_docx.py:84
↓ 1 callersFunctioninpaint_algorithm
Function to interpolate the background of a text box with a rectangular mask
src/save_document.py:116
↓ 1 callersFunctionload_model
Function to load the desired nllb model. Parameters ---------- model_path : str Path in whic the model is stored Returns
src/utils.py:161
↓ 1 callersFunctionmain
Run administrative tasks.
manage.py:7
↓ 1 callersMethodmake_text_modification
(self, text)
src/translate_pptx.py:177
↓ 1 callersFunctionoveralapping_correction
corrects the overlapping of bboxes by readjusting their ypos
src/save_document.py:265
↓ 1 callersFunctionoverwrite_text_on_images
Function needed for replacing the translated pdf text chunks over the images extracted from the input pdf Parameters ---------- docum
src/save_document.py:42
↓ 1 callersFunctionpreprocess_text
Function to preprocess text from a .pptx file. Parameters ---------- doc_filepath : str String with complete path to the document
src/preprocess_pptx.py:5
↓ 1 callersMethodreplace_paragraph_text_retaining_initial_formatting
Given a paragraph PARAMETERS: paragraph : pptx.text.text._Paragraph Read paragraph with its original value and font param
src/translate_pptx.py:154
↓ 1 callersFunctionsave_translated_doc
Function to save translated and untranslated documents in a certain location. Parameters ---------- document : File containing all th
src/save_document.py:8
↓ 1 callersFunctiontext_wrap
(text, font, max_width)
src/save_document.py:235
↓ 1 callersFunctiontranslate
Auxiliary translation function encapsulated in a lambda
src/translate_pdf.py:39
↓ 1 callersFunctiontranslate_document
( document, model_name, models_path, max_tokens, lang_origin_code, lang_dest_code,
src/translate_pptx.py:7
↓ 1 callersFunctiontranslate_document
(filename, dst_lang, loaded_model=None)
src/translation_app.py:76
↓ 1 callersMethodtranslate_document
(self, document)
src/translate_pptx.py:58
↓ 1 callersMethodtranslate_document
(self, document)
src/translate_docx.py:61
↓ 1 callersFunctiontranslate_text
Function to generate a list of strings with a limited number of tokens. Each string will be processed with the NLLB model so it should not exceed
src/translation_app.py:6
↓ 1 callersFunctionwrite_text_on_rectangle
coords: (left=w, top=x, right=y, bottom=z)
src/save_document.py:181
Method__init__
( self, model_name, models_path, max_tokens, lang_origin_code,
src/translate_pptx.py:36
Method__init__
( self, model_name, models_path, max_tokens, lang_origin_code,
src/translate_docx.py:39
Method__str__
(self)
application/models.py:8
Methodclean_translated_document
(self)
application/forms.py:19
Functiondelete_all_translations
(request)
application/views.py:144
Functiondetect_language
(request)
application/views.py:38
Functionhome
(request)
application/views.py:31
Functionpreprocess_text
Function to preprocess text from a .pdf file. Parameters ---------- doc_filepath : str String with complete path to the document
src/preprocess_pdf.py:40
Functionpreprocess_text
Function to preprocess text from a .docx file. Each paragraph is obtained through paragraph atribute from python.docx library. Parameters
src/preprocess_docx.py:5
Functionserve_translated_document
(request, filename)
application/views.py:134
Functiontranslate_document
( document, model_name, models_path, max_tokens, lang_origin_code, lang_dest_code,
src/translate_pdf.py:7
Functiontranslate_document
( document, model_name, models_path, max_tokens, lang_origin_code, lang_dest_code,
src/translate_docx.py:7
Functiontranslation_interface
(request)
application/views.py:50
Functionupload_document
(request)
application/views.py:87