Skip to content

Commit

Permalink
Merge branch 'release/0.3.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
emfomy committed Apr 9, 2023
2 parents f9c2055 + 8863fc9 commit 61160ef
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ License

|GPL-3.0|

Copyright (c) 2021 `CKIP Lab <https://ckip.iis.sinica.edu.tw>`__ under the `GPL-3.0 License <https://www.gnu.org/licenses/gpl-3.0.html>`__.
Copyright (c) 2023 `CKIP Lab <https://ckip.iis.sinica.edu.tw>`__ under the `GPL-3.0 License <https://www.gnu.org/licenses/gpl-3.0.html>`__.

.. |GPL-3.0| image:: https://www.gnu.org/graphics/gplv3-with-text-136x68.png
:target: https://www.gnu.org/licenses/gpl-3.0.html
4 changes: 2 additions & 2 deletions ckip_transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

__author_name__ = "Mu Yang"
__author_email__ = "[email protected]"
__copyright__ = "2021 CKIP Lab"
__copyright__ = "2023 CKIP Lab"

__title__ = "CKIP Transformers"
__version__ = "0.3.2"
__version__ = "0.3.3"
__description__ = "CKIP Transformers"
__license__ = "GPL-3.0"

Expand Down
2 changes: 1 addition & 1 deletion ckip_transformers/nlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""

__author__ = "Mu Yang <http://muyang.pro>"
__copyright__ = "2021 CKIP Lab"
__copyright__ = "2023 CKIP Lab"
__license__ = "GPL-3.0"

from .driver import (
Expand Down
14 changes: 7 additions & 7 deletions ckip_transformers/nlp/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""

__author__ = "Mu Yang <http://muyang.pro>"
__copyright__ = "2021 CKIP Lab"
__copyright__ = "2023 CKIP Lab"
__license__ = "GPL-3.0"

from typing import (
Expand Down Expand Up @@ -77,8 +77,8 @@ def __call__(
show_progress : ``int``, *optional*, defaults to True
Show progress bar.
pin_memory : ``bool``, *optional*, defaults to True
Pin memory in order to accelerate the speed of data transfer to the GPU. This option is
incompatible with multiprocessing.
Pin memory in order to accelerate the speed of data transfer to the GPU. This option is incompatible with
multiprocessing. Disabled on CPU device.
Returns
-------
Expand Down Expand Up @@ -177,8 +177,8 @@ def __call__(
show_progress : ``int``, *optional*, defaults to True
Show progress bar.
pin_memory : ``bool``, *optional*, defaults to True
Pin memory in order to accelerate the speed of data transfer to the GPU. This option is
incompatible with multiprocessing.
Pin memory in order to accelerate the speed of data transfer to the GPU. This option is incompatible with
multiprocessing. Disabled on CPU device.
Returns
-------
Expand Down Expand Up @@ -267,8 +267,8 @@ def __call__(
show_progress : ``int``, *optional*, defaults to True
Show progress bar.
pin_memory : ``bool``, *optional*, defaults to True
Pin memory in order to accelerate the speed of data transfer to the GPU. This option is
incompatible with multiprocessing.
Pin memory in order to accelerate the speed of data transfer to the GPU. This option is incompatible with
multiprocessing. Disabled on CPU device.
Returns
-------
Expand Down
10 changes: 7 additions & 3 deletions ckip_transformers/nlp/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""

__author__ = "Mu Yang <http://muyang.pro>"
__copyright__ = "2021 CKIP Lab"
__copyright__ = "2023 CKIP Lab"
__license__ = "GPL-3.0"


Expand Down Expand Up @@ -123,10 +123,14 @@ def __call__(
show_progress : ``bool``, *optional*, defaults to True
Show progress bar.
pin_memory : ``bool``, *optional*, defaults to True
Pin memory in order to accelerate the speed of data transfer to the GPU. This option is
incompatible with multiprocessing.
Pin memory in order to accelerate the speed of data transfer to the GPU. This option is incompatible with
multiprocessing. Disabled on CPU device.
"""
# Disable pin memory on CPU device
if self.device.type == "cpu":
pin_memory = False

# Check max length
model_max_length = self.tokenizer.model_max_length - 2 # Add [CLS] and [SEP]
if max_length:
assert max_length < model_max_length, (
Expand Down
5 changes: 5 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ CKIP Transformers

main/readme

.. toctree::
:caption: Tables of Tags

main/tag

.. toctree::
:caption: Contents

Expand Down
15 changes: 15 additions & 0 deletions docs/main/tag.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Part-of-Speech Tags
-------------------

.. csv-table::
:file: ./tag/pos.csv
:widths: 50 50
:header-rows: 1

Named Entity Recognition Tags
-----------------------------

.. csv-table::
:file: ./tag/ner.csv
:widths: 50 50
:header-rows: 1
19 changes: 19 additions & 0 deletions docs/main/tag/ner.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Tag,Description
CARDINAL,數字
DATE,日期
EVENT,事件
FAC,設施
GPE,行政區
LANGUAGE,語言
LAW,法律
LOC,地理區
MONEY,金錢
NORP,民族、宗教、政治團體
ORDINAL,序數
ORG,組織
PERCENT,百分比率
PERSON,人物
PRODUCT,產品
QUANTITY,數量
TIME,時間
WORK_OF_ART,作品
65 changes: 65 additions & 0 deletions docs/main/tag/pos.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Tag,Description
A,非謂形容詞
Caa,對等連接詞
Cab,連接詞,如:等等
Cba,連接詞,如:的話
Cbb,關聯連接詞
D,副詞
Da,數量副詞
Dfa,動詞前程度副詞
Dfb,動詞後程度副詞
Di,時態標記
Dk,句副詞
DM,定量式
I,感嘆詞
Na,普通名詞
Nb,專有名詞
Nc,地方詞
Ncd,位置詞
Nd,時間詞
Nep,指代定詞
Neqa,數量定詞
Neqb,後置數量定詞
Nes,特指定詞
Neu,數詞定詞
Nf,量詞
Ng,後置詞
Nh,代名詞
Nv,名物化動詞
P,介詞
T,語助詞
VA,動作不及物動詞
VAC,動作使動動詞
VB,動作類及物動詞
VC,動作及物動詞
VCL,動作接地方賓語動詞
VD,雙賓動詞
VF,動作謂賓動詞
VE,動作句賓動詞
VG,分類動詞
VH,狀態不及物動詞
VHC,狀態使動動詞
VI,狀態類及物動詞
VJ,狀態及物動詞
VK,狀態句賓動詞
VL,狀態謂賓動詞
V_2,有

DE,的之得地
SHI,是
FW,外文

COLONCATEGORY,冒號
COMMACATEGORY,逗號
DASHCATEGORY,破折號
DOTCATEGORY,點號
ETCCATEGORY,刪節號
EXCLAMATIONCATEGORY,驚嘆號
PARENTHESISCATEGORY,括號
PAUSECATEGORY,頓號
PERIODCATEGORY,句號
QUESTIONCATEGORY,問號
SEMICOLONCATEGORY,分號
SPCHANGECATEGORY,雙直線

WHITESPACE,空白
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding:utf-8 -*-

__author__ = "Mu Yang <http://muyang.pro>"
__copyright__ = "2021 CKIP Lab"
__copyright__ = "2023 CKIP Lab"
__license__ = "GPL-3.0"

from setuptools import setup, find_namespace_packages
Expand Down
2 changes: 1 addition & 1 deletion test/script/nlp/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding:utf-8 -*-

__author__ = "Mu Yang <http://muyang.pro>"
__copyright__ = "2021 CKIP Lab"
__copyright__ = "2023 CKIP Lab"
__license__ = "GPL-3.0"

from ckip_transformers.nlp import *
Expand Down
2 changes: 1 addition & 1 deletion test/script/nlp/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding:utf-8 -*-

__author__ = "Mu Yang <http://muyang.pro>"
__copyright__ = "2021 CKIP Lab"
__copyright__ = "2023 CKIP Lab"
__license__ = "GPL-3.0"

from _base import *
Expand Down

0 comments on commit 61160ef

Please sign in to comment.