Skip to main content

Tokenizer POS-tagger and Dependency-parser with BERT/RoBERTa/DeBERTa models for Japanese and other languages

Project description

Current PyPI packages

esupar

Tokenizer, POS-tagger, and dependency-parser with Transformers and SuPar.

Basic usage

>>> import esupar
>>> nlp=esupar.load("ja")
>>> doc=nlp("太郎は花子が読んでいる本を次郎に渡した")
>>> print(doc)
1	太郎	_	PROPN	_	_	12	nsubj	_	SpaceAfter=No
2		_	ADP	_	_	1	case	_	SpaceAfter=No
3	花子	_	PROPN	_	_	5	nsubj	_	SpaceAfter=No
4		_	ADP	_	_	3	case	_	SpaceAfter=No
5	読ん	_	VERB	_	_	8	acl	_	SpaceAfter=No
6		_	SCONJ	_	_	5	mark	_	SpaceAfter=No
7	いる	_	AUX	_	_	5	aux	_	SpaceAfter=No
8		_	NOUN	_	_	12	obj	_	SpaceAfter=No
9		_	ADP	_	_	8	case	_	SpaceAfter=No
10	次郎	_	PROPN	_	_	12	obl	_	SpaceAfter=No
11		_	ADP	_	_	10	case	_	SpaceAfter=No
12	渡し	_	VERB	_	_	0	root	_	SpaceAfter=No
13		_	AUX	_	_	12	aux	_	_

>>> import deplacy
>>> deplacy.render(doc,Japanese=True)
太郎 PROPN ═╗<════════╗ nsubj(主語)
   ADP   <          case(格表示)
花子 PROPN ═╗<══╗      nsubj(主語)
   ADP   <         case(格表示)
読ん VERB  ═╗═╗═╝<    acl(連体修飾節)
   SCONJ <        mark(標識)
いる AUX   <══╝       aux(動詞補助成分)
   NOUN  ═╗═════╝<  obj(目的語)
   ADP   <         case(格表示)
次郎 PROPN ═╗<       obl(斜格補語)
   ADP   <        case(格表示)
渡し VERB  ═╗═╝═════╝═╝ root()
   AUX   <           aux(動詞補助成分)

esupar.load(model) loads a natural language processor pipeline, working on Universal Dependencies. Available model options are:

Installation for Linux

pip3 install esupar --user

Installation for Cygwin64

Make sure to get python37-devel python37-pip python37-cython python37-numpy python37-wheel gcc-g++ mingw64-x86_64-gcc-g++ git curl make cmake, and then:

curl -L https://raw.githubusercontent.com/KoichiYasuoka/CygTorch/master/installer/supar.sh | sh
pip3.7 install esupar

Installation for Google Colaboratory

!pip install esupar

Try notebook.

Author

Koichi Yasuoka (安岡孝一)

Project details


Release history Release notifications | RSS feed

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.

esupar-1.5.2-py3-none-any.whl (59.1 kB view details)

Uploaded Python 3

File details

Details for the file esupar-1.5.2-py3-none-any.whl.

File metadata

  • Download URL: esupar-1.5.2-py3-none-any.whl
  • Upload date:
  • Size: 59.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for esupar-1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 034e560177867bcc48c7e0e44472db41fc151a227989cc1b141be6c2989810d3
MD5 ac55e4f392d2be83119b9d8bbe9e6c6f
BLAKE2b-256 a73e6f6d567ac696c1026d103a1cbd08705482b43641521a1b8c46dbe766661b

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