Skip to content

Commit 921dd33

Browse files
committed
Update README and pythainlp.translate
- Update PyThaiNLP Version - Add raise ImportError to pythainlp.translate - Add SPDX to small100.py
1 parent 0fb529f commit 921dd33

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนสำหร
2424
pip install pythainlp
2525
```
2626

27-
## News
28-
29-
> Now, You can contact with or ask any questions of the PyThaiNLP team. <a href="https://matrix.to/#/#thainlp:matrix.org" rel="noopener" target="_blank"><img src="https://matrix.to/img/matrix-badge.svg" alt="Chat on Matrix"></a>
30-
3127
| Version | Description | Status |
3228
|:------:|:--:|:------:|
33-
| [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) |
3430
| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.2 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/1080) |
3531

3632
## Getting Started

README_TH.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ PyThaiNLP เป็นไลบารีภาษาไพทอนสำหร
2020
pip install pythainlp
2121
```
2222

23-
## ข่าวสาร
24-
25-
> คุณสามารถพูดคุยหรือแชทกับทีม PyThaiNLP หรือผู้สนับสนุนคนอื่น ๆ ได้ที่ <a href="https://matrix.to/#/#thainlp:matrix.org" rel="noopener" target="_blank"><img src="https://matrix.to/img/matrix-badge.svg" alt="Chat on Matrix"></a>
26-
2723
| รุ่น | คำอธิบาย | สถานะ |
2824
|:------:|:--:|:------:|
29-
| [5.1.0](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |
25+
| [5.1.1](https://github.com/PyThaiNLP/pythainlp/releases) | Stable | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/900) |
3026
| [`dev`](https://github.com/PyThaiNLP/pythainlp/tree/dev) | Release Candidate for 5.2 | [Change Log](https://github.com/PyThaiNLP/pythainlp/issues/1080) |
3127

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

pythainlp/translate/en_th.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111
"""
1212
import os
1313

14-
from fairseq.models.transformer import TransformerModel
15-
from sacremoses import MosesTokenizer
14+
try:
15+
from fairseq.models.transformer import TransformerModel
16+
except ImportError:
17+
raise ImportError("Not found fairseq! Please install fairseq by pip install fairseq")
18+
19+
try:
20+
from sacremoses import MosesTokenizer
21+
except ImportError:
22+
raise ImportError("Not found sacremoses! Please install sacremoses by pip install sacremoses")
1623

1724
from pythainlp.corpus import download, get_corpus_path
1825

pythainlp/translate/small100.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# -*- coding: utf-8 -*-
2+
# SPDX-FileCopyrightText: 2016-2025 PyThaiNLP Project
3+
# SPDX-FileType: SOURCE
4+
# SPDX-License-Identifier: Apache-2.0
15
from transformers import M2M100ForConditionalGeneration
26

37
from .tokenization_small100 import SMALL100Tokenizer

0 commit comments

Comments
 (0)