-
Notifications
You must be signed in to change notification settings - Fork 30
/
install_mecab-ko_on_colab190912.sh
84 lines (64 loc) · 2.34 KB
/
install_mecab-ko_on_colab190912.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
cd /content
echo "Installing konlpy....."
! pip3 install konlpy
echo "Done"
echo "Installing mecab-0.996-ko-0.9.2.tar.gz....."
echo "Downloading mecab-0.996-ko-0.9.2.tar.gz......."
echo "from https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz"
! wget https://bitbucket.org/eunjeon/mecab-ko/downloads/mecab-0.996-ko-0.9.2.tar.gz
echo "Done"
echo "Unpacking mecab-0.996-ko-0.9.2.tar.gz......."
! tar xvfz mecab-0.996-ko-0.9.2.tar.gz > /dev/null 2>&1
echo "Done"
echo "Change Directory to mecab-0.996-ko-0.9.2......."
cd mecab-0.996-ko-0.9.2/
echo "installing mecab-0.996-ko-0.9.2.tar.gz........"
echo 'configure'
! ./configure > /dev/null 2>&1
echo 'make'
! make > /dev/null 2>&1
echo 'make check'
! make check > /dev/null 2>&1
echo 'make install'
! make install > /dev/null 2>&1
echo 'ldconfig'
! ldconfig > /dev/null 2>&1
echo "Done"
echo "Change Directory to /content"
cd ../
echo "Downloading mecab-ko-dic-2.1.1-20180720.tar.gz......."
echo "from https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2.1.1-20180720.tar.gz"
! wget https://bitbucket.org/eunjeon/mecab-ko-dic/downloads/mecab-ko-dic-2.1.1-20180720.tar.gz
echo "Done"
echo "Unpacking mecab-ko-dic-2.1.1-20180720.tar.gz......."
! tar xvfz mecab-ko-dic-2.1.1-20180720.tar.gz > /dev/null 2>&1
echo "Done"
echo "Change Directory to mecab-ko-dic-2.1.1-20180720"
cd mecab-ko-dic-2.1.1-20180720/
echo "Done"
echo "installing........"
echo 'configure'
! ./configure > /dev/null 2>&1
echo 'make'
! make > /dev/null 2>&1
echo 'make install'
! make install > /dev/null 2>&1
echo 'apt-get update'
! apt-get update > /dev/null 2>&1
echo 'apt-get upgrade'
! apt-get upgrade > /dev/null 2>&1
echo 'apt install curl'
! apt install curl > /dev/null 2>&1
echo 'apt install git'
! apt install git > /dev/null 2>&1
echo 'bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh)'
! bash <(curl -s https://raw.githubusercontent.com/konlpy/konlpy/master/scripts/mecab.sh) > /dev/null 2>&1
echo "Done"
echo "Successfully Installed"
echo "Now you can use Mecab"
echo "from konlpy.tag import Mecab"
echo "mecab = Mecab()"
echo "사용자 사전 추가 방법 : https://bit.ly/3k0ZH53"
echo "NameError: name 'Tagger' is not defined 오류 발생 시 런타임을 재실행 해주세요"
echo "블로그에 해결 방법을 남겨주신 tana님 감사합니다."