Skip to content

Commit

Permalink
chore: add string doc
Browse files Browse the repository at this point in the history
  • Loading branch information
vTuanpham committed Dec 13, 2023
1 parent cdb34ab commit ab5bc91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 5 additions & 1 deletion configs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

@dataclass
class Config(ABC):
qas_id: str
"""
Abstract config that inherited all method
"""

qas_id: str # Required field in all subclass

def __str__(self) -> str:
return self.__repr__
Expand Down
13 changes: 8 additions & 5 deletions translator/data_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ def __init__(self, file_path: str,
target_fields: List[str],
target_config: Union[BaseConfig, QAConfig, DialogsConfig],
do_translate: bool = False,
enable_sub_task_thread: bool = True,
enable_sub_task_thread: bool = True, # Enable splitting the list into sublist if a list of one example is too large to process
# This argument go with max_list_length_per_thread
no_translated_code: bool = False,
max_example_per_thread: int = 400,
large_chunks_threshold: int = 20000,
max_list_length_per_thread: int = 3,
max_example_per_thread: int = 400, # How many examples, each thread can contain
large_chunks_threshold: int = 20000, # Maximum number of examples that will be evenly across threads
max_list_length_per_thread: int = 3, # Maximum number of strings contain in a list in a single thread.
# if larger, split the list into sub-list and process in parallel
source_lang: str = "en",
target_lang: str = "vi",
fail_translation_code: str="P1OP1_F"
fail_translation_code: str="P1OP1_F" # Fail code for unexpected fail translation and can be removed
# post-translation
) -> None:

self.data_read = None
Expand Down

0 comments on commit ab5bc91

Please sign in to comment.