Skip to main content

This program is SDK of Ner service API to handle one sentence or simple text file in chinese.

Project description

ner

SDK to access API of Ner service

This program is SDK of Ner service API.

It can handle one sentence or simple text file by self-hosted NER service or Stanford NER service (http://nlp.stanford.edu:8080/ner/process).

Installation

pip install pyner

Usage

usage: ner.py [-h] [--nertype NERTYPE] [--classifier CLASSIFIER]
              [--endpoint ENDPOINT] [--sentence SENTENCE] [--path PATH]

Process one sentence and simple textfile by remote self-NER service or
Stanford NER one.

optional arguments:
  -h, --help            show this help message and exit
  --nertype NERTYPE     NER service type,0:self-NER(defualt),1:Stanford-NER
  --classifier CLASSIFIER
                        classifier code of Stanford NER service,including
                        7class, 4class, 3class, distsim
  --endpoint ENDPOINT   Endpoint of self-NER service,ignored when Stanford-NER
                        type
  --sentence SENTENCE   Sentence to process
  --path PATH           Path file to process

For instance:

$ python ner.py --endpoint http://example.com/ner/bert/normal --path test.txt --sentence '康龙化成(03759)拟续聘安永华明为2020年度境内会计师事 务所'
{'ORG': ['康龙化成', '安永华明']}
{'LOC': ['新冠', '新疆'],
 'ORG': ['华资实业',
         '明科',
         '中葡',
         '亚星',
         '厦华',
         '中房股份',
         '中房股份',
         '西域旅游',
         '西域旅游',
         '丰华股份',
         '丰华股份',
         '壳公司']}
$ python ner.py --nertype stanford --sentence 'hello, chongqing, intel, IBM, Tecent. Bill Gates said.' --classifier 7class
{'LOC': ['chongqing'],
 'ORG': ['intel', 'IBM', 'Tecent'],
 'PER': ['Gates']}

Project details


Download files

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

Source Distribution

pyner-0.0.5.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

pyner-0.0.5-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file pyner-0.0.5.tar.gz.

File metadata

  • Download URL: pyner-0.0.5.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for pyner-0.0.5.tar.gz
Algorithm Hash digest
SHA256 7a3d647d7c381966146738d5465e5a29417f4c2cbc35772d671bbc96c47d25e1
MD5 31fa58651c3738a3bb6929db4903a206
BLAKE2b-256 401538ff569f907aa2b23ba7517293371b499cc7456295216826203e168852d0

See more details on using hashes here.

File details

Details for the file pyner-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: pyner-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.12

File hashes

Hashes for pyner-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 45d2cb9d04689ef1666b6c9676d3fdd79cbf4c9a07aac63bb8143f78bcd9f192
MD5 087f13280f493cfadc7df72793f6248f
BLAKE2b-256 9ee5abe122a8d88c1acb07975efb2c7416f7512fa990de6a97892bfecd88fdaf

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