Skip to content

Commit

Permalink
Fix minor types
Browse files Browse the repository at this point in the history
  • Loading branch information
bact authored Dec 10, 2023
1 parent 7e24d3f commit 826cfed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pythainlp/phayathaibert/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# SPDX-FileCopyrightText: Copyright 2016-2023 PyThaiNLP Project
# SPDX-License-Identifier: Apache-2.0
from typing import Callable, Collection, List, Tuple, Union
import re
import random
import re
import warnings

from pythainlp.tokenize import word_tokenize
from transformers import (
CamembertTokenizer,
Expand Down Expand Up @@ -49,7 +50,7 @@ def rm_brackets(text: str) -> str:
new_line = re.sub(r"\(\)", "", text)
new_line = re.sub(r"\{\}", "", new_line)
new_line = re.sub(r"\[\]", "", new_line)
# brakets with only punctuations
# brackets with only punctuations
new_line = re.sub(r"\([^a-zA-Z0-9ก-๙]+\)", "", new_line)
new_line = re.sub(r"\{[^a-zA-Z0-9ก-๙]+\}", "", new_line)
new_line = re.sub(r"\[[^a-zA-Z0-9ก-๙]+\]", "", new_line)
Expand Down Expand Up @@ -225,7 +226,7 @@ def augment(self,
"""
Text Augment from phayathaibert
:param str text: thai text
:param str text: Thai text
:param int num_augs: an amount of augmentation text needed as an output
:param bool sample: whether to sample the text as an output or not,\
true if more word diversity is needed
Expand Down

0 comments on commit 826cfed

Please sign in to comment.