用户工具

站点工具


zh:notes:install_parscit

How to install ParsCit

Operation System

CentOS 6.8 (64 bits)

Upgrade Perl

> wget https://www.cpan.org/src/5.0/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
> ./Configure -des -Dprefix=/usr/local/perl -Dusethreads -Uversiononly
> make
> make install
 
# redirect link
> mv /usr/bin/perl /usr/bin/perl.bak
> ln -s /usr/local/perl/bin/perl /usr/bin/perl
 
# To check the version
> perl --version

Install perl-CPAN and expat

> yum install perl-CPAN
# Prerequisites for installing library XML::Parser
> yum install expat
> yum install expat-devel

Install Perl libraries

#To check whether an interested libary is installed or not
perl -MClass::Struct -e "print\"model installed\n\"" 

The folling Perl libraries need to be installed:

  • Class::Struct
  • Getopt::Long
  • Getopt::Std
  • File::Basename
  • File::Spec
  • FindBin
  • HTML::Entities
  • IO::File
  • POSIX
  • XML::Parser
  • XML::Twig
  • XML::Writer
  • XML::Writer::String

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.

> perl -MCPAN -e shell
> install HTML::Entities
> install XML::Parser
> install XML::Twig
> install XML::Writer
> install XML::Writer::String

Download ParsCit

> wget https://github.com/knmnyn/ParsCit/archive/master.zip
> unzip master.zip
> rm -f master.zip
> mv master ParsCit

Compile CRF++

> 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

Run ParsCit

> cd ParsCit/bin
> ./citeExtract.pl -m extract_all ../demodata/sample2.txt sample2.txt.out
zh/notes/install_parscit.txt · 最后更改: 2022/06/30 11:30 由 pzczxs