这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
zh:notes:install_parscit [2019/08/02 13:26] pzczxs [Install Perl libraries] |
zh:notes:install_parscit [2022/06/30 11:30] (当前版本) pzczxs 讨论状态变化了 |
||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 安装ParsCit ====== | + | ====== How to install ParsCit ====== |
- | 参考:https://github.com/knmnyn/parscit,http://parscit.comp.nus.edu.sg/index.html | + | Reference:https://github.com/knmnyn/parscit,http://parscit.comp.nus.edu.sg/index.html |
- | ===== 系统环境 ===== | + | ===== Operation System ===== |
CentOS 6.8 (64 bits) | CentOS 6.8 (64 bits) | ||
- | ===== 升级Perl ===== | + | ===== Upgrade Perl ===== |
<code bash> | <code bash> | ||
> wget https://www.cpan.org/src/5.0/perl-5.30.0.tar.gz | > wget https://www.cpan.org/src/5.0/perl-5.30.0.tar.gz | ||
> tar -zxvf perl-5.30.0.tar.gz | > tar -zxvf perl-5.30.0.tar.gz | ||
+ | > rm -f perl-5.30.0.tar.gz | ||
> cd perl-5.30.0 | > cd perl-5.30.0 | ||
> ./Configure -des -Dprefix=/usr/local/perl -Dusethreads -Uversiononly | > ./Configure -des -Dprefix=/usr/local/perl -Dusethreads -Uversiononly | ||
行 14: | 行 15: | ||
> make install | > make install | ||
- | # 重定向 | + | # redirect link |
> mv /usr/bin/perl /usr/bin/perl.bak | > mv /usr/bin/perl /usr/bin/perl.bak | ||
> ln -s /usr/local/perl/bin/perl /usr/bin/perl | > ln -s /usr/local/perl/bin/perl /usr/bin/perl | ||
- | # 查看版本号 | + | # To check the version |
> perl --version | > perl --version | ||
</code> | </code> | ||
行 25: | 行 26: | ||
<code bash> | <code bash> | ||
> yum install perl-CPAN | > yum install perl-CPAN | ||
- | # 安装XML::Parser库下面这两个包 | + | # Prerequisites for installing library XML::Parser |
> yum install expat | > yum install expat | ||
> yum install expat-devel | > yum install expat-devel | ||
行 37: | 行 38: | ||
The folling Perl libraries need to be installed: | The folling Perl libraries need to be installed: | ||
- | -Class::Struct | + | *Class::Struct |
- | -Getopt::Long | + | *Getopt::Long |
- | -Getopt::Std | + | *Getopt::Std |
- | -File::Basename | + | *File::Basename |
- | -File::Spec | + | *File::Spec |
- | -FindBin | + | *FindBin |
- | -HTML::Entities | + | *HTML::Entities |
- | -IO::File | + | *IO::File |
- | -POSIX | + | *POSIX |
- | -XML::Parser | + | *XML::Parser |
- | -XML::Twig | + | *XML::Twig |
- | -XML::Writer | + | *XML::Writer |
- | -XML::Writer::String | + | *XML::Writer::String |
- | Generally, the libraries //Class::Struct//, //Getopt::Long// | + | Generally, the libraries //Class::Struct//, //Getopt::Long//, //Getopt::Std//, //File::Basename//, //File::Spec//, //FindBin//, //IO::File//, and //POSIX// are installed by default. One can install other libraries as follows. |
+ | <code bash> | ||
+ | > perl -MCPAN -e shell | ||
+ | > install HTML::Entities | ||
+ | > install XML::Parser | ||
+ | > install XML::Twig | ||
+ | > install XML::Writer | ||
+ | > install XML::Writer::String | ||
+ | </code> | ||
+ | |||
+ | ===== Download ParsCit ===== | ||
+ | <code bash> | ||
+ | > wget https://github.com/knmnyn/ParsCit/archive/master.zip | ||
+ | > unzip master.zip | ||
+ | > rm -f master.zip | ||
+ | > mv master ParsCit | ||
+ | </code> | ||
+ | |||
+ | ===== Compile CRF++ ===== | ||
+ | <code bash> | ||
+ | > cd ParsCit/crfpp | ||
+ | > tar -xvzf crf++-0.51.tar.gz | ||
+ | > cd CRF++-0.51 | ||
+ | > ./configure | ||
+ | > make | ||
+ | |||
+ | # move executables to where ParsCit expects to find them | ||
+ | > cp crf_learn crf_test .. | ||
+ | > cd .libs | ||
+ | > cp -Rf * ../../.libs | ||
+ | > cd ../../.libs | ||
+ | > chmod u+x lt-crf_learn | ||
+ | > chmod u+x lt-crf_test | ||
+ | </code> | ||
+ | |||
+ | ===== Run ParsCit ===== | ||
+ | <code bash> | ||
+ | > cd ParsCit/bin | ||
+ | > ./citeExtract.pl -m extract_all ../demodata/sample2.txt sample2.txt.out | ||
+ | </code> | ||
+ | |||
+ | ~~DISCUSSION:closed~~ |