Skip to main content

Coptic NLP wrapper for spaCy

Project description

Current PyPI packages

spaCy-Coptic

Coptic NLP wrapper for spaCy

Basic Usage

>>> import spacy_coptic
>>> nlp=spacy_coptic.load()
>>> doc=nlp("ⲙⲟⲟϣⲉ ϩⲱⲥ ϣⲏⲣⲉ ⲙ̄ⲡⲟⲩⲟⲉⲓⲛ")
>>> for t in doc:
...   print("\t".join([str(t.i+1),t.orth_,t.lemma_,t.pos_,t.tag_,"_",str(0 if t.head==t else t.head.i+1),t.dep_,"_","_" if t.whitespace_ else "SpaceAfter=No"]))
...
1	ⲙⲟⲟϣⲉ	ⲙⲟⲟϣⲉ	VERB	V	_	0	ROOT	_	_
2	ϩⲱⲥ	ϩⲱⲥ	CCONJ	CONJ	_	3	mark	_	_
3	ϣⲏⲣⲉ	ϣⲏⲣⲉ	NOUN	N	_	1	advcl	_	_
4	ⲙ̄		ADP	PREP	_	6	case	_	SpaceAfter=No
5			DET	ART	_	6	det	_	SpaceAfter=No
6	ⲟⲩⲟⲉⲓⲛ	ⲟⲩⲟⲉⲓⲛ	NOUN	N	_	3	nmod	_	_
>>> import deplacy
>>> deplacy.render(doc,WordRight=True)
 ROOT ╔═════════ VERB  ⲙⲟⲟϣⲉ
 mark  ╔══════> CCONJ ϩⲱⲥ
advcl >╚═╔═════ NOUN  ϣⲏⲣⲉ
 case      ╔══> ADP   ⲙ̄
  det       > DET   
 nmod     >╚═╚═ NOUN  ⲟⲩⲟⲉⲓⲛ

spacy_coptic.load(api) loads spaCy Language pipeline for Coptic NLP WebAPI. If you have already installed coptic-nlp and you have coptic_nlp.py in the current directory, you can try the pipeline locally just as:

>>> import spacy_coptic
>>> from coptic_nlp import nlp_coptic
>>> nlp=spacy_coptic.load(nlp_coptic)
>>> doc=nlp("ⲙⲟⲟϣⲉ ϩⲱⲥ ϣⲏⲣⲉ ⲙ̄ⲡⲟⲩⲟⲉⲓⲛ")

Installation

pip3 install spacy_coptic --user

Installation for Google Colaboratory

Try notebook.

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

spacy_coptic-0.7.6-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file spacy_coptic-0.7.6-py3-none-any.whl.

File metadata

File hashes

Hashes for spacy_coptic-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 5bdd33629c9b30d2112edc875cdd8c8b4cd0773d5d01b57ba2f0acc41b320a4d
MD5 d3b69c165ac9a3cfa27b4bc0bebc72b8
BLAKE2b-256 9cac3a303ac1e0edb85ea60fea35aa4afe2bfeb49aca24ea2a19b3d378c42f26

See more details on using hashes here.

Supported by

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