Skip to content

Commit

Permalink
Update warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wannaphong committed Sep 20, 2022
1 parent 296df1f commit 18c8c50
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7-slim-buster
FROM python:3.8-slim-buster

COPY . .

Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Version | Supported |
| ------- | ------------------ |
| 3.1.x | :white_check_mark: |
| 3.0.x | :white_check_mark: |
| 2.3.x | :white_check_mark: |
| 2.2.x | :x: |
Expand Down
2 changes: 1 addition & 1 deletion pythainlp/corpus/ttc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Thai Textbook Corpus (TTC) word frequency
Credit: Korakot Chaovavanich
Credit: Korakot Chaovavanich
https://www.facebook.com/photo.php?fbid=363640477387469&set=gm.434330506948445&type=3&permPage=1
"""

Expand Down
5 changes: 4 additions & 1 deletion pythainlp/parse/esupar_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
GitHub: https://github.com/KoichiYasuoka/esupar
"""
from typing import List, Union
import esupar
try:
import esupar
except ImportError:
raise ImportError("Import Error; Install esupar by pip install esupar")


class Parse:
Expand Down
2 changes: 1 addition & 1 deletion pythainlp/tag/named_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def load_engine(self, engine: str, corpus: str) -> None:
elif engine == "wangchanberta":
from pythainlp.wangchanberta import ThaiNameTagger
if corpus=="lst20":
print("""
warnings.warn("""
LST20 corpus are free for research and open source only.\n
If you want to use in Commercial use, please contract NECTEC.\n
https://www.facebook.com/dancearmy/posts/10157641945708284
Expand Down
3 changes: 2 additions & 1 deletion pythainlp/tag/perceptron.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
import os
from typing import List, Tuple
import warnings

from pythainlp.corpus import corpus_path, get_corpus_path
from pythainlp.tag import PerceptronTagger, lst20, orchid
Expand Down Expand Up @@ -37,7 +38,7 @@ def _pud_tagger():

def _lst20_tagger():
global _LST20_TAGGER
print("""
warnings.warn("""
LST20 corpus are free for research and open source only.\n
If you want to use in Commercial use, please contract NECTEC.\n
https://www.facebook.com/dancearmy/posts/10157641945708284
Expand Down
3 changes: 2 additions & 1 deletion pythainlp/tag/unigram.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json
import os
from typing import List, Tuple
import warnings

from pythainlp.corpus import corpus_path, get_corpus_path
from pythainlp.tag import lst20, orchid
Expand Down Expand Up @@ -41,7 +42,7 @@ def _pud_tagger():

def _lst20_tagger():
global _LST20_TAGGER
print("""
warnings.warn("""
LST20 corpus are free for research and open source only.\n
If you want to use in Commercial use, please contract NECTEC.\n
https://www.facebook.com/dancearmy/posts/10157641945708284
Expand Down
3 changes: 2 additions & 1 deletion pythainlp/tokenize/crfcls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Clause segmenter
"""
from typing import List
import warnings

import pycrfsuite
from pythainlp.corpus import get_corpus_path
Expand Down Expand Up @@ -55,7 +56,7 @@ def _extract_features(doc):


def segment(doc: List[str]) -> List[List[str]]:
print("""
warnings.warn("""
LST20 corpus are free for research and open source only.\n
If you want to use in Commercial use, please contract NECTEC.\n
https://www.facebook.com/dancearmy/posts/10157641945708284
Expand Down
7 changes: 7 additions & 0 deletions pythainlp/wangchanberta/postag.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from typing import Dict, List, Tuple, Union
import re
import warnings
from transformers import (
CamembertTokenizer,
AutoTokenizer,
Expand All @@ -22,6 +23,12 @@ def __init__(
grouped_word: bool = False
) -> None:
self.corpus = corpus
if corpus=="lst20":
warnings.warn("""
LST20 corpus are free for research and open source only.\n
If you want to use in Commercial use, please contract NECTEC.\n
https://www.facebook.com/dancearmy/posts/10157641945708284
""")
self.grouped_word = grouped_word
self.load()

Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
"transformers>=4.22.1",
],
"dependency_parsing": [
"esupar>=1.3.8",
"spacy_thai>=0.7.1",
"ufal.chu-liu-edmonds>=1.0.2",
"transformers>=4.22.1",
Expand Down Expand Up @@ -126,7 +125,6 @@
"thai_nner",
"wunsen>=0.0.3",
"spacy_thai>=0.7.1",
"esupar>=1.3.8",
"ufal.chu-liu-edmonds>=1.0.2",
],
}
Expand Down

0 comments on commit 18c8c50

Please sign in to comment.