<jupyter_start><jupyter_text>[spaCy-ChaPAS](https://github.com/KoichiYasuoka/spaCy-ChaPAS) on Google Colaboratory<jupyter_code>!apt update
!apt install mecab libmecab-dev mecab-ipadic-utf8 openjdk-8-jre-headless
!test -f crfpp.tar.gz || curl -L 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7QVR6VXJ5dWExSTQ' -o crfpp.tar.gz
!test -d CRF++-0.58 || ( tar xzf crfpp.tar.gz && cd CRF++-0.58 && ./configure --prefix=/usr && make install )
!curl -sc cabocha.cookie 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7SDd1Q1dUQkZQaUU' > /dev/null
!test -f cabocha.tar.bz2 || curl -Lb cabocha.cookie 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7SDd1Q1dUQkZQaUU&confirm='`tr -d '\015' < cabocha.cookie | awk '/_warning_/{print $NF}'` -o cabocha.tar.bz2
!test -d cabocha-0.69 || ( tar xjf cabocha.tar.bz2 && cd cabocha-0.69 && ./configure --prefix=/usr --with-charset=UTF8 && make install )
!curl -sc chapas.cookie 'https://drive.google.com/uc?export=download&id=0BwG_CvJHq43fNDlqSkVSREkzaEk' > /dev/null
!test -f chapas.tar.gz || curl -Lb chapas.cookie 'https://drive.google.com/uc?export=download&id=0BwG_CvJHq43fNDlqSkVSREkzaEk&confirm='`tr -d '\015' < chapas.cookie | awk '/_warning_/{print $NF}'` -o chapas.tar.gz
!test -d chapas-0.742 || ( tar xzf chapas.tar.gz && echo exec /usr/lib/jvm/j*-1.8.*/bin/java -Xmx1g -jar /content/chapas-0.742/chapas.jar '"$@"' > /usr/bin/chapas && chmod 755 /usr/bin/chapas )
!pip install spacy_chapas
import spacy_chapas
nlp=spacy_chapas.load("gendai")
doc=nlp("太郎は花子が読んでいる本を次郎に渡した")
import deplacy
deplacy.render(doc,Japanese=True)
deplacy.serve(doc,port=None)
# import graphviz
# graphviz.Source(deplacy.dot(doc))<jupyter_output>太郎 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(動詞補助成分)
{'fraction_non_alphanumeric': 0.19832402234636873, 'fraction_numerical': 0.03165735567970205, 'mean_word_length': 3.8292134831460674, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '214989', 'license': 'MIT', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1100, 'n_words': 183, 'path': 'spacy_chapas.ipynb', 'repo_name': 'KoichiYasuoka/spaCy-ChaPAS', 'size': '2148'}