Skip to main content

Chinese Word Segmenter developed by Nanjing University NLP Group

Project description

1 Installation and Usage

1.1 Installation

Installation through pip:

pip install njuseg

1.2 Usage

from njuseg import Segmenter
segmenter = Segmenter.load_model(model_pth,use_gpu=True)
sentences = ['美国联邦储备委员会 16 日发布的全国经济形势调查报告显示,去年 12 月初至今年 1 月上旬,美国经济继续温和扩张,但美国企业对经济前景的乐观程度有所下降。','美联储注意到了市场对全球经济放缓等风险因素的担心,但当前美国经济发生衰退的风险并未上升。']
segmented_sentences = segmenter.seg(sentences)

2 Performance

2.1 In domain:

with pretrained unigram + bigram embedding

PKU

MSR

CTB5

CTB6

NLPCC

96.63

96.52

98.14

96.13

95.82

3 Speed

On CPU: 20 k characters per second On single NVIDIA GTX 1080 GPU: 160 k characters per second

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

njuseg-2.0-py2.py3-none-any.whl (12.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file njuseg-2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: njuseg-2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/27.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8

File hashes

Hashes for njuseg-2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f4d409d7a5c5244a77206a33a47f7f1e00037086452dc7061efb52f1b2b8661e
MD5 050fbe1d9153fc4430b4180df8f0505a
BLAKE2b-256 5e4bd440f27cd5e370cce8b0549d12f6d0e5c83996a42b613d5db6f9d67944ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page