Skip to content

Commit ae8018c

Browse files
authored
Merge pull request #1091 from PyThaiNLP/5.1-patch
PyThaiNLP v5.1.1
2 parents b2b6da9 + 03fed4a commit ae8018c

File tree

10 files changed

+20
-15
lines changed

10 files changed

+20
-15
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ Notable changes between versions.
1111
- For full release notes, see:
1212
<https://github.com/PyThaiNLP/pythainlp/releases>
1313
- For detailed commit changes, see:
14-
<https://github.com/PyThaiNLP/pythainlp/compare/v5.1.0...dev> (select tags to compare)
14+
<https://github.com/PyThaiNLP/pythainlp/compare/v5.1.1...dev> (select tags to compare)
1515

16-
## Version 5.1.0 -> Dev
16+
## Version 5.1.1 -> Dev
1717

1818
[WIP]
1919

20+
## Version 5.1.0 -> 5.1.1
21+
22+
- PR Description: Refactor thai_consonants_all to Use set in syllable.py #1087
23+
- ThaiTransliterator: Select 1D CPU int64 tensor device #1089
24+
2025
## Version 5.0.5 -> 5.1.0
2126

2227
- Add Thai Discourse Treebank postag #910

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ keywords:
4545
- "Thai language"
4646
- "Thai NLP"
4747
license: Apache-2.0
48-
version: 5.1.0
49-
date-released: "2025-02-25"
48+
version: 5.1.1
49+
date-released: "2025-03-31"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pip install pythainlp
3030
3131
| Version | Description | Status |
3232
|:------:|:--:|:------:|
33-
| [5.1.0](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |
33+
| [5.1.1](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |
3434
| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.2 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/1080) |
3535

3636
## Getting Started

README_TH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pip install pythainlp
2626
2727
| รุ่น | คำอธิบาย | สถานะ |
2828
|:------:|:--:|:------:|
29-
| [5.1.0](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |
29+
| [5.1.1](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |
3030
| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.2 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/1080) |
3131

3232
ติดตามพวกเราบน [PyThaiNLP Facebook page](https://www.facebook.com/pythainlp/) เพื่อรับข่าวสารเพิ่มเติม

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"@type": "SoftwareSourceCode",
44
"name": "PyThaiNLP",
55
"description": "Thai Natural Language Processing in Python",
6-
"version": "5.1.0",
6+
"version": "5.1.1",
77
"author": [
88
{
99
"@type": "Person",

pythainlp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-FileCopyrightText: 2016-2025 PyThaiNLP Project
33
# SPDX-FileType: SOURCE
44
# SPDX-License-Identifier: Apache-2.0
5-
__version__ = "5.1.0"
5+
__version__ = "5.1.1"
66

77
thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ" # 44 chars
88

pythainlp/transliterate/thai2rom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def forward(self, sequences, sequences_lengths):
130130

131131
sequences_lengths = torch.flip(
132132
torch.sort(sequences_lengths).values, dims=(0,)
133-
)
133+
).to(device)
134134
index_sorted = torch.sort(-1 * sequences_lengths).indices
135135
index_unsort = torch.sort(index_sorted).indices # to unsorted sequence
136136
sequences = sequences.index_select(0, index_sorted.to(device))
@@ -139,7 +139,7 @@ def forward(self, sequences, sequences_lengths):
139139
sequences = self.dropout(sequences)
140140

141141
sequences_packed = nn.utils.rnn.pack_padded_sequence(
142-
sequences, sequences_lengths.clone(), batch_first=True
142+
sequences, sequences_lengths.clone().to("cpu", torch.int64), batch_first=True
143143
)
144144

145145
sequences_output, hidden = self.rnn(sequences_packed, hidden)

pythainlp/util/syllable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"กบ": list("บปภพฟ"),
2222
}
2323

24-
thai_consonants_all = list(thai_consonants)
24+
thai_consonants_all = set(thai_consonants)
2525
thai_consonants_all.remove("อ")
2626

2727
_temp = list("".join(["".join(v) for v in spelling_class.values()]))
@@ -87,7 +87,7 @@ def sound_syllable(syllable: str) -> str:
8787
return "dead"
8888

8989
# get consonants
90-
consonants = [i for i in syllable if i in list(thai_consonants_all)]
90+
consonants = [i for i in syllable if i in thai_consonants_all]
9191
if (
9292
(len(consonants) == 0)
9393
and ("อ" in syllable)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 5.1.0
2+
current_version = 5.1.1
33
commit = True
44
tag = True
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150

151151
setup(
152152
name="pythainlp",
153-
version="5.1.0",
153+
version="5.1.1",
154154
description="Thai Natural Language Processing library",
155155
long_description=LONG_DESC,
156156
long_description_content_type="text/markdown",
@@ -199,7 +199,7 @@
199199
],
200200
},
201201
project_urls={
202-
"Documentation": "https://pythainlp.org/docs/5.0/",
202+
"Documentation": "https://pythainlp.org/docs/5.1/",
203203
"Tutorials": "https://pythainlp.org/tutorials/",
204204
"Source Code": "https://github.com/PyThaiNLP/pythainlp",
205205
"Bug Tracker": "https://github.com/PyThaiNLP/pythainlp/issues",

0 commit comments

Comments
 (0)