Content Handler
This microservice is served with multiple APIs to handle and retrieve the contents (final result) of files translated in the Anuvaad system.
Modules
Common Information
Some common info that is applicable to save, update operations on translations.
Workflow Code
WF_S_TR
andWF_S_TKTR
: Changes the sentence structure, hence s0 pair needs to be updated.DP_WFLOW_S_C
: Doesn't change the sentence structure, hence no need to update the s0 pair.
Sentence Keys
s0_src
: Source sentence extracted from the file.s0_tgt
: Sentence translation from NMT.tgt
: Translation updated by the user (User translation). (Source may vary if the user edits the input document, or else it keeps the same ass0_src
).
File Content Modules
SaveFileContent
API to save translated documents. The JSON request object is generated from block-merger and later updated by tokenizer and translator. This API is used internally.
Mandatory parameters: userid
, pages
, record_id
, src_lang
, tgt_lang
Actions:
Validating input parameters as per the policies.
The document to be saved is converted into blocks.
Block can be of type images, lines, text_blocks, etc.
Every block is created with UUID.
Saving blocks in the database.
GetFileContent
API to fetch back the documents. The response object would be an array of pages, with pagination enabled. RBAC enabled.
Mandatory parameters: start_page
, end_page
, record_id
Actions:
Validating input parameters as per the policies.
Fetching back the blocks as per the page number requested.
UpdateFileContent
API to update the block content; triggered on split, merge, re-translate operations. Used internally.
Mandatory parameters: record_id
, user_id
, blocks
, workflowCode
Actions:
Validating input parameters as per the policies.
Updating the list of blocks.
SaveFileContentReferences
Internal API to store S3 link references to translated documents (on docx flow).
Mandatory parameters: job_id
, file_link
Actions:
Validating input parameters as per the policies.
Storing records in the database.
GetFileContentReferences
API to fetch back the S3 link for docx files. RBAC enabled.
Mandatory parameters: job_ids
Actions:
Validating input parameters as per the policies.
Fetching back the data from the database.
Sentence Modules
SaveSentence
API to store user translations. RBAC enabled.
Mandatory parameters: sentences
, workflowCode
, user_id
Actions:
Validating input parameters as per the policies.
Updating the sentence blocks.
Saved sentences are always updated with
"save": true
flag.Saved sentences are also saved in the Redis store for Sentence Memory.
FetchSentence
Bulk API to fetch back sentences. RBAC enabled.
Mandatory parameters: sentences
, record_id
, block_identifier
, s_id
Actions:
Validating input parameters as per the policies.
Returning back an array of sentences searched for.
Last updated