适用于 Ubuntu 的 python-crfsuite

Vig*_*d V 3 python pip crf python-crfsuite

我想在 Ubuntu 中安装 python-crfsuite。当我使用 pip 安装时,我收到了一些警告并且

在 python-crfsuite 的安装记录中找不到 .egg-info 目录

当我在 python 中导入 crfutils 时,它说找不到模块。可能是什么问题,或者在 Linux 系统中是不可能的?

goC*_*rds 5

安装重要工具

$ apt-get install swig
Run Code Online (Sandbox Code Playgroud)

下载依赖项。

$ wget https://github.com/downloads/chokkan/liblbfgs/liblbfgs-1.10.tar.gz
Run Code Online (Sandbox Code Playgroud)

解压。转到结果目录。键入./configure。然后make。然后make install

下载实际的软件源。

$ wget https://github.com/downloads/chokkan/crfsuite/crfsuite-0.12.tar.gz
Run Code Online (Sandbox Code Playgroud)

解压文件。转到结果目录。键入./configure。然后make。进入swig>python目录。类型

$ ./prepare.sh --swig
$ python setup.py build_ext
$ python setup.py install
Run Code Online (Sandbox Code Playgroud)

您可能需要手动编辑export_wrapper.cpp,但修复程序包含在README

您可能需要添加/usr/local/libLD_LIBRARY_PATH,如果你得到ImportError: libcrfsuite-0.12.so