Skip to content
المشاريع

حول

Pipeline component for spaCy (and other spaCy-wrapped parsers such as spacy-stanza and spacy-udpipe) that adds CoNLL-U properties to a Doc and its sentences and tokens. Can also be used as a command-line tool.

أدوات التطوير

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
جارٍ جمع السجل
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

spacy-conll

CI codecov PyPI Docs

spacy-conll is a spaCy pipeline component that formats parsed documents as CoNLL-U. It also reads CoNLL-U into spaCy Doc objects and includes the command line tool parse-as-conll. It works with spaCy models and, as an optional backend, with spacy-udpipe.

The output labels are those of the model that you use. For Universal Dependencies labels, use the UDPipe backend. spacy-stanza is not supported anymore since it has been unmaintained for a while now.

Installation

pip install spacy-conll
pip install "spacy-conll[udpipe]"  # adds the UDPipe backend
pip install "spacy-conll[all]"     # adds the UDPipe backend and pandas

spacy-conll needs Python 3.11 or newer. Install a spaCy model as well, for example python -m spacy download en_core_web_sm.

Example

import spacy

nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("conll_formatter", last=True)

doc = nlp("I like cookies.")
print(doc._.conll_str)
1	I	I	PRON	PRP	Case=Nom|Number=Sing|Person=1|PronType=Prs	2	nsubj	_	_
2	like	like	VERB	VBP	Tense=Pres|VerbForm=Fin	0	ROOT	_	_
3	cookies	cooky	NOUN	NNS	Number=Plur	2	dobj	_	SpaceAfter=No
4	.	.	PUNCT	.	PunctType=Peri	2	punct	_	_

The same from the command line:

parse-as-conll en_core_web_sm spacy --input-str "I like cookies."

Documentation

The documentation has a usage guide, the API reference and a migration guide for v4 users. See examples/ for runnable scripts and the changelog for the release history.

Contributing

See CONTRIBUTING.md.

Credits

The first version of this library was inspired by the work of rgalhama and has changed a lot since then.

License

BSD 2-Clause. See LICENSE.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…