Skip to content

Commit

Permalink
Merge branch 'hotfix/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mu Yang committed May 7, 2021
2 parents 0cb9896 + 9871dc0 commit 9ca9f04
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ Installation via Pip
To use CkipClassic Parser Client backend, please

#. Register an account at http://parser.iis.sinica.edu.tw/v1/reg.exe
#. Set the environment variables ``$CKIPPARSER_USERNAME`` and ``$CKIPPARSER_PASSWORD`` to the username and password.
#. Set the username and password in the pipeline's options:

.. code-block:: python
pipeline = CkipPipeline(opts={'con_parser': {'username': YOUR_USERNAME, 'password': YOUR_PASSWORD})
Detail
------
Expand Down
2 changes: 1 addition & 1 deletion ckipnlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__copyright__ = '2018-2020 CKIP Lab'

__title__ = 'CKIPNLP'
__version__ = '1.0.1'
__version__ = '1.0.2'
__description__ = 'CKIP CoreNLP'
__license__ = 'GPL-3.0'

Expand Down
10 changes: 9 additions & 1 deletion ckipnlp/driver/classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ class CkipClassicConParserClient(_CkipClassicConParser):
---------
lazy : bool
Lazy initialize the driver.
username : string
(*optional*) The username of CkipClassicParserClient.
password : string
(*optional*) The password of CkipClassicParserClient.
Notes
-----
Expand All @@ -266,7 +270,11 @@ class CkipClassicConParserClient(_CkipClassicConParser):

driver_family = 'classic-client'

def __init__(self, *, lazy=False, **opts):
super().__init__(lazy=lazy)
self._opts = opts

def _init(self):

import ckip_classic.client
self._core = ckip_classic.client.CkipParserClient()
self._core = ckip_classic.client.CkipParserClient(**self._opts)
8 changes: 8 additions & 0 deletions docs/main/usage/pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ The |CkipPipeline| will compute all necessary dependencies. For example, if one
for line in WsPosParagraph.to_text(doc.ws, doc.pos):
print(line)
To customize the driver (e.g. disable CUDA in |CkipTaggerWordSegmenter|), you may pass the options to the pipeline:

.. code-block:: python
pipeline = CkipPipeline(opts = {'word_segmenter': {'disable_cuda': True}})
Please refer each driver's documentation for the extra options.

Co-Reference Pipeline
^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 9ca9f04

Please sign in to comment.