Mac安裝crfpp
步驟
git clone https://github.com/taku910/crfpp.git
./configure
make
sudo make install
cd python
python setup.py install
python test.py
問題
-
如果提示找不到winmain.h,去 https://raw.githubusercontent.com/taku910/crfpp/37ec31fd1a128db09eca8203030c3547b8f8df4b/winmain.h 下載放到主目錄下面
-
運行test.py提示沒有_CRFPP模塊,可以運行
chmod 755 /usr/local/lib/python2.7/dist- packages/*.so
或者是應該沒有裝好,重新檢查問題,重新安裝。
-
運行test.py提示,引入model失敗,去example/basenp下,找exec.sh文件,注釋掉
rm -f model
,運行 exec.sh,生成model文件,將其移動到test.py的上層目錄,隨后運行即可。 -
注意,系統中如果存在多個版本的python,盡量切換為2.7版本,不然可能會遇到奇怪的問題。