Skip to main content

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

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.13.tar.gz (4.7 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.13-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyner-0.0.13.tar.gz
  • Upload date:
  • Size: 4.7 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.13.tar.gz
Algorithm Hash digest
SHA256 3d4ea1294ca5ccc7221b5c6a8e7f8c7b0e38fa02d4f3467e81da6fe32521568b
MD5 b873e31dcf9eb9ac21719ccc0d21f982
BLAKE2b-256 e4d3b7301162d09bd4b6f80225f5dc12fb0737f14e1b42bb16d5bc91c8b8c5aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyner-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 6.4 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.13-py3-none-any.whl
Algorithm Hash digest
SHA256 aaa3ff8998a0b12138f69d0e7df8f8cfdcead9640c7c77ca105496af9ffb3c4a
MD5 3bdf009f0e67ae69f94145657c7b76fe
BLAKE2b-256 bb365ec99bf22f439d8eb4a8f5f54ebf669d5b5f7fe63e351531f95d395021e0

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