Skip to content

Commit 731a2cd

Browse files
Copilotbact
andcommitted
Remove redundant type annotations on reassignments
Co-authored-by: bact <128572+bact@users.noreply.github.com>
1 parent 06b015f commit 731a2cd

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

pythainlp/transliterate/w2p.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ def _encode(self, word: str) -> "np.ndarray":
219219
def _short_word(self, word: str) -> Optional[str]:
220220
self.word: str = word
221221
if self.word.endswith("."):
222-
self.word: str = self.word.replace(".", "")
223-
self.word: str = "-".join([i + "อ" for i in list(self.word)])
222+
self.word = self.word.replace(".", "")
223+
self.word = "-".join([i + "อ" for i in list(self.word)])
224224
return self.word
225225
return None
226226

pythainlp/wangchanberta/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ def get_ner(
113113
for i in self.json_ner
114114
]
115115
elif self.dataset_name == "thainer":
116-
self.sent_ner: list[tuple[str, str]] = [
116+
self.sent_ner = [
117117
(i["word"].replace("<_>", " ").replace("▁", ""), i["entity"])
118118
for i in self.json_ner
119119
if i["word"] != "▁"
120120
]
121121
else:
122-
self.sent_ner: list[tuple[str, str]] = [
122+
self.sent_ner = [
123123
(
124124
i["word"].replace("<_>", " ").replace("▁", ""),
125125
i["entity"].replace("_", "-").replace("E-", "I-"),

pythainlp/wsd/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def __init__(
4646
def change_device(self, device: str) -> None:
4747
from sentence_transformers import SentenceTransformer
4848

49-
self.device: str = device
50-
self.model: "SentenceTransformer" = SentenceTransformer(self.model_name, device=self.device)
49+
self.device = device
50+
self.model = SentenceTransformer(self.model_name, device=self.device)
5151

5252
def get_score(self, sentences1: str, sentences2: str) -> float:
5353
from sentence_transformers import util

0 commit comments

Comments
 (0)