spaCy-Alpino
Basic Usage
>>> import spacy_alpino
>>> nlp=spacy_alpino.load()
>>> doc=nlp("Zorg dat daar geen zwarte hond tussen komt.")
>>> 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 Zorg zorgen VERB WW|pv|tgw|ev _ 0 ROOT _ _
2 dat dat SCONJ VG|onder _ 8 mark _ _
3 daar daar ADV VNW|aanw|adv-pron|obl|vol|3o|getal _ 8 obl _ _
4 geen geen DET VNW|onbep|det|stan|prenom|zonder|agr _ 6 det _ _
5 zwarte zwart ADJ ADJ|prenom|basis|met-e|stan _ 6 amod _ _
6 hond hond NOUN N|soort|ev|basis|zijd|stan _ 8 nsubj _ _
7 tussen tussen ADP VZ|fin _ 3 case _ _
8 komt komen VERB WW|pv|tgw|met-t _ 1 ccomp _ SpaceAfter=No
9 . . PUNCT LET _ 1 punct _ SpaceAfter=No
>>> import deplacy
>>> deplacy.render(doc)
Zorg VERB ═════════════╗═╗ ROOT
dat SCONJ <══════════╗ ║ ║ mark
daar ADV ═════╗<══╗ ║ ║ ║ obl
geen DET <══╗ ║ ║ ║ ║ ║ det
zwarte ADJ <╗ ║ ║ ║ ║ ║ ║ amod
hond NOUN ═╝═╝ ║<╗ ║ ║ ║ ║ nsubj
tussen ADP <════╝ ║ ║ ║ ║ ║ case
komt VERB ═══════╝═╝═╝<╝ ║ ccomp
. PUNCT <══════════════╝ punct
spacy_alpino.load() invokes Alpino with lassy2ud.
Installation for Linux (Debian, Ubuntu, Kali) with Alpino
First, install xqilla and necessary packages:
sudo apt update
sudo apt install xqilla libxss1 python3-pip python3-dev g++ curl
Second, install Alpino:
cd /tmp
curl -L https://www.let.rug.nl/vannoord/alp/Alpino/versions/binary/latest.tar.gz | tar xzf -
sudo mkdir -p /usr/local/bin
sudo mv Alpino /usr/local/Alpino
( echo '#! /bin/sh' ; echo 'exec /usr/local/Alpino/bin/Alpino "$@"' ) > Alpino
sudo install Alpino /usr/local/bin
And at last, install spaCy-Alpino:
pip3 install spacy_alpino --user
Installation for Google Colaboratory
Try notebook.
Installation without Alpino
pip3 install spacy_alpino --user
spacy_alpino.load() invokes Alpino WebAPI unless Alpino is installed.
Release files for spacy-alpino 0.7.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spacy_alpino-0.7.8-py3-none-any.whl | Python 3 | none | any | Details |
Release files / spacy_alpino-0.7.8-py3-none-any.whl
| Download URL | spacy_alpino-0.7.8-py3-none-any.whl |
|---|---|
| Size | 32.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
783fa6844fdaeefe26d5ec273f9d6deb44e6544ead2ef5f83363b4fe4b811662
|
|
BLAKE2b-256 checksum How to use checksums |
7cb3ea50f6bb65a9084d405febd38c1b575ec3f3ebac65347e9d42b35b5a8106
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.2
|