diff --git a/CHANGELOG.md b/CHANGELOG.md index 77b7eeb4c..346690f46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,12 +11,17 @@ Notable changes between versions. - For full release notes, see: - For detailed commit changes, see: - (select tags to compare) + (select tags to compare) -## Version 5.1.0 -> Dev +## Version 5.1.1 -> Dev [WIP] +## Version 5.1.0 -> 5.1.1 + +- PR Description: Refactor thai_consonants_all to Use set in syllable.py #1087 +- ThaiTransliterator: Select 1D CPU int64 tensor device #1089 + ## Version 5.0.5 -> 5.1.0 - Add Thai Discourse Treebank postag #910 diff --git a/CITATION.cff b/CITATION.cff index aa34b65a1..58a55563f 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -45,5 +45,5 @@ keywords: - "Thai language" - "Thai NLP" license: Apache-2.0 -version: 5.1.0 -date-released: "2025-02-25" +version: 5.1.1 +date-released: "2025-03-31" diff --git a/README.md b/README.md index 028461e44..cebd95f59 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ pip install pythainlp | Version | Description | Status | |:------:|:--:|:------:| -| [5.1.0](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) | +| [5.1.1](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) | | [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.2 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/1080) | ## Getting Started diff --git a/README_TH.md b/README_TH.md index bb0b2e5cc..0e155a549 100644 --- a/README_TH.md +++ b/README_TH.md @@ -26,7 +26,7 @@ pip install pythainlp | รุ่น | คำอธิบาย | สถานะ | |:------:|:--:|:------:| -| [5.1.0](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) | +| [5.1.1](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) | | [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.2 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/1080) | ติดตามพวกเราบน [PyThaiNLP Facebook page](https://www.facebook.com/pythainlp/) เพื่อรับข่าวสารเพิ่มเติม diff --git a/codemeta.json b/codemeta.json index 7df85191a..f27f9bd22 100644 --- a/codemeta.json +++ b/codemeta.json @@ -3,7 +3,7 @@ "@type": "SoftwareSourceCode", "name": "PyThaiNLP", "description": "Thai Natural Language Processing in Python", - "version": "5.1.0", + "version": "5.1.1", "author": [ { "@type": "Person", diff --git a/pythainlp/__init__.py b/pythainlp/__init__.py index b32052002..808f3fd2d 100644 --- a/pythainlp/__init__.py +++ b/pythainlp/__init__.py @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2016-2025 PyThaiNLP Project # SPDX-FileType: SOURCE # SPDX-License-Identifier: Apache-2.0 -__version__ = "5.1.0" +__version__ = "5.1.1" thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ" # 44 chars diff --git a/pythainlp/transliterate/thai2rom.py b/pythainlp/transliterate/thai2rom.py index fd27a3f7d..5341fb889 100644 --- a/pythainlp/transliterate/thai2rom.py +++ b/pythainlp/transliterate/thai2rom.py @@ -130,7 +130,7 @@ def forward(self, sequences, sequences_lengths): sequences_lengths = torch.flip( torch.sort(sequences_lengths).values, dims=(0,) - ) + ).to(device) index_sorted = torch.sort(-1 * sequences_lengths).indices index_unsort = torch.sort(index_sorted).indices # to unsorted sequence sequences = sequences.index_select(0, index_sorted.to(device)) @@ -139,7 +139,7 @@ def forward(self, sequences, sequences_lengths): sequences = self.dropout(sequences) sequences_packed = nn.utils.rnn.pack_padded_sequence( - sequences, sequences_lengths.clone(), batch_first=True + sequences, sequences_lengths.clone().to("cpu", torch.int64), batch_first=True ) sequences_output, hidden = self.rnn(sequences_packed, hidden) diff --git a/pythainlp/util/syllable.py b/pythainlp/util/syllable.py index c8e5fb272..e91812e11 100644 --- a/pythainlp/util/syllable.py +++ b/pythainlp/util/syllable.py @@ -21,7 +21,7 @@ "กบ": list("บปภพฟ"), } -thai_consonants_all = list(thai_consonants) +thai_consonants_all = set(thai_consonants) thai_consonants_all.remove("อ") _temp = list("".join(["".join(v) for v in spelling_class.values()])) @@ -87,7 +87,7 @@ def sound_syllable(syllable: str) -> str: return "dead" # get consonants - consonants = [i for i in syllable if i in list(thai_consonants_all)] + consonants = [i for i in syllable if i in thai_consonants_all] if ( (len(consonants) == 0) and ("อ" in syllable) diff --git a/setup.cfg b/setup.cfg index 0d701287c..de9810524 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 5.1.0 +current_version = 5.1.1 commit = True tag = True parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/setup.py b/setup.py index 06c4d755b..42c6bddb7 100644 --- a/setup.py +++ b/setup.py @@ -150,7 +150,7 @@ setup( name="pythainlp", - version="5.1.0", + version="5.1.1", description="Thai Natural Language Processing library", long_description=LONG_DESC, long_description_content_type="text/markdown", @@ -199,7 +199,7 @@ ], }, project_urls={ - "Documentation": "https://pythainlp.org/docs/5.0/", + "Documentation": "https://pythainlp.org/docs/5.1/", "Tutorials": "https://pythainlp.org/tutorials/", "Source Code": "https://github.com/PyThaiNLP/pythainlp", "Bug Tracker": "https://github.com/PyThaiNLP/pythainlp/issues",