[![Current PyPI packages](https://badge.fury.io/py/spacy-alpino.svg)](https://pypi.org/project/spacy-alpino/)
# spaCy-Alpino
[Alpino](http://www.let.rug.nl/vannoord/alp/Alpino/) wrapper for [spaCy](https://spacy.io)
## Basic Usage
```py
>>> 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](https://github.com/gossebouma/lassy2ud).
## Installation for Linux (Debian, Ubuntu, Kali) with Alpino
First, install [xqilla](http://xqilla.sourceforge.net/) and necessary packages:
```sh
sudo apt update
sudo apt install xqilla libxss1 python3-pip python3-dev g++ curl
```
Second, install Alpino:
```sh
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:
```sh
pip3 install spacy_alpino --user
```
## Installation for Google Colaboratory
Try [notebook](https://colab.research.google.com/github/KoichiYasuoka/spaCy-Alpino/blob/main/spacy_alpino.ipynb).
## Installation without Alpino
```sh
pip3 install spacy_alpino --user
```
`spacy_alpino.load()` invokes [Alpino WebAPI](https://urd2.let.rug.nl/~vannoord/bin/alpino) unless Alpino is installed.
Raw data
{
"_id": null,
"home_page": "https://github.com/KoichiYasuoka/spaCy-Alpino",
"name": "spacy-alpino",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "spacy nlp",
"author": "Koichi Yasuoka",
"author_email": "yasuoka@kanji.zinbun.kyoto-u.ac.jp",
"download_url": null,
"platform": null,
"description": "[![Current PyPI packages](https://badge.fury.io/py/spacy-alpino.svg)](https://pypi.org/project/spacy-alpino/)\n\n# spaCy-Alpino\n\n[Alpino](http://www.let.rug.nl/vannoord/alp/Alpino/) wrapper for [spaCy](https://spacy.io)\n\n## Basic Usage\n\n```py\n>>> import spacy_alpino\n>>> nlp=spacy_alpino.load()\n>>> doc=nlp(\"Zorg dat daar geen zwarte hond tussen komt.\")\n>>> for t in doc:\n... 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\"]))\n...\n1\tZorg\tzorgen\tVERB\tWW|pv|tgw|ev\t_\t0\tROOT\t_\t_\n2\tdat\tdat\tSCONJ\tVG|onder\t_\t8\tmark\t_\t_\n3\tdaar\tdaar\tADV\tVNW|aanw|adv-pron|obl|vol|3o|getal\t_\t8\tobl\t_\t_\n4\tgeen\tgeen\tDET\tVNW|onbep|det|stan|prenom|zonder|agr\t_\t6\tdet\t_\t_\n5\tzwarte\tzwart\tADJ\tADJ|prenom|basis|met-e|stan\t_\t6\tamod\t_\t_\n6\thond\thond\tNOUN\tN|soort|ev|basis|zijd|stan\t_\t8\tnsubj\t_\t_\n7\ttussen\ttussen\tADP\tVZ|fin\t_\t3\tcase\t_\t_\n8\tkomt\tkomen\tVERB\tWW|pv|tgw|met-t\t_\t1\tccomp\t_\tSpaceAfter=No\n9\t.\t.\tPUNCT\tLET\t_\t1\tpunct\t_\tSpaceAfter=No\n>>> import deplacy\n>>> deplacy.render(doc)\nZorg VERB \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\u2550\u2557 ROOT\ndat SCONJ <\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557 \u2551 \u2551 mark\ndaar ADV \u2550\u2550\u2550\u2550\u2550\u2557<\u2550\u2550\u2557 \u2551 \u2551 \u2551 obl\ngeen DET <\u2550\u2550\u2557 \u2551 \u2551 \u2551 \u2551 \u2551 det\nzwarte ADJ <\u2557 \u2551 \u2551 \u2551 \u2551 \u2551 \u2551 amod\nhond NOUN \u2550\u255d\u2550\u255d \u2551<\u2557 \u2551 \u2551 \u2551 \u2551 nsubj\ntussen ADP <\u2550\u2550\u2550\u2550\u255d \u2551 \u2551 \u2551 \u2551 \u2551 case\nkomt VERB \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255d\u2550\u255d\u2550\u255d<\u255d \u2551 ccomp\n. PUNCT <\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255d punct\n```\n\n`spacy_alpino.load()` invokes Alpino with [lassy2ud](https://github.com/gossebouma/lassy2ud).\n\n## Installation for Linux (Debian, Ubuntu, Kali) with Alpino\n\nFirst, install [xqilla](http://xqilla.sourceforge.net/) and necessary packages:\n\n```sh\nsudo apt update\nsudo apt install xqilla libxss1 python3-pip python3-dev g++ curl\n```\n\nSecond, install Alpino:\n\n```sh\ncd /tmp\ncurl -L https://www.let.rug.nl/vannoord/alp/Alpino/versions/binary/latest.tar.gz | tar xzf -\nsudo mkdir -p /usr/local/bin\nsudo mv Alpino /usr/local/Alpino\n( echo '#! /bin/sh' ; echo 'exec /usr/local/Alpino/bin/Alpino \"$@\"' ) > Alpino\nsudo install Alpino /usr/local/bin\n```\n\nAnd at last, install spaCy-Alpino:\n\n```sh\npip3 install spacy_alpino --user\n```\n\n## Installation for Google Colaboratory\n\nTry [notebook](https://colab.research.google.com/github/KoichiYasuoka/spaCy-Alpino/blob/main/spacy_alpino.ipynb).\n\n## Installation without Alpino\n\n```sh\npip3 install spacy_alpino --user\n```\n\n`spacy_alpino.load()` invokes [Alpino WebAPI](https://urd2.let.rug.nl/~vannoord/bin/alpino) unless Alpino is installed.\n\n",
"bugtrack_url": null,
"license": "LGPL",
"summary": "Alpino wrapper for spaCy",
"version": "0.7.7",
"project_urls": {
"Alpino": "http://www.let.rug.nl/vannoord/alp/Alpino/",
"Homepage": "https://github.com/KoichiYasuoka/spaCy-Alpino",
"Source": "https://github.com/KoichiYasuoka/spaCy-Alpino",
"Tracker": "https://github.com/KoichiYasuoka/spaCy-Alpino/issues",
"lassy2ud": "https://github.com/gossebouma/lassy2ud"
},
"split_keywords": [
"spacy",
"nlp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e37da36e3b3f9d3025c6afe2736745ceed52183697f75e829d6d9ca5e5dec4f0",
"md5": "7eee0aaf3024e18fc060dccd028abc19",
"sha256": "7da53e855cf83910d2a07a3b7c7f28852fff5c73e07769e51f479f9ad9339b8d"
},
"downloads": -1,
"filename": "spacy_alpino-0.7.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7eee0aaf3024e18fc060dccd028abc19",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 32632,
"upload_time": "2024-11-20T03:10:06",
"upload_time_iso_8601": "2024-11-20T03:10:06.407826Z",
"url": "https://files.pythonhosted.org/packages/e3/7d/a36e3b3f9d3025c6afe2736745ceed52183697f75e829d6d9ca5e5dec4f0/spacy_alpino-0.7.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-20 03:10:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "KoichiYasuoka",
"github_project": "spaCy-Alpino",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "spacy-alpino"
}