equipes:rcln:cluster_tal:fred

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
equipes:rcln:cluster_tal:fred [2019/04/03 10:19]
rosse créée
equipes:rcln:cluster_tal:fred [2020/09/23 14:36] (Version actuelle)
Ligne 14: Ligne 14:
  
 ==== Requirements ==== ==== Requirements ====
-  - [http://www.swi-prolog.org/download/devel/src/pl-6.3.19.tar.gz SWI Prolog version 6.3.19] uploaded from [http://www.swi-prolog.org/download/devel?show=all this SWI developers page]+  - [[http://www.swi-prolog.org/download/devel/src/pl-6.3.19.tar.gz SWI Prolog version 6.3.19]] uploaded from [[http://www.swi-prolog.org/download/devel?show=all this SWI developers page]]
   - C&C (local distribution)   - C&C (local distribution)
   - Boxer, FRED (local distrib with links to fredlib, api, etc.)   - Boxer, FRED (local distrib with links to fredlib, api, etc.)
-  - [https://stanfordnlp.github.io/CoreNLP/ CoreNLP] (note: it works only with [http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip version 3.4.1]) +  - [[https://stanfordnlp.github.io/CoreNLP/ CoreNLP]] (note: it works only with [[http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip version 3.4.1]]) 
-  - [https://github.com/dasmith/stanford-corenlp-python CoreNLP Python wrapper for 3.4.1] +  - [[https://github.com/dasmith/stanford-corenlp-python CoreNLP Python wrapper for 3.4.1]
-  - [http://babelfy.org/ Babelfy] instead of [http://tagme.di.unipi.it Tagme], as a service with our local credentials.+  - [[http://babelfy.org/ Babelfy]] instead of [[http://tagme.di.unipi.it Tagme]], as a service with our local credentials.
  
 ==== SWI-Prolog ==== ==== SWI-Prolog ====
Ligne 113: Ligne 113:
 </code> </code>
  
-===C&C===+===== C&C ===== 
 The local Boxer - C&C distribution delivered by FRED should like The local Boxer - C&C distribution delivered by FRED should like
 +<code>
  $ pwd  $ pwd
  /opt/FRED/BoxerServer  /opt/FRED/BoxerServer
Ligne 133: Ligne 135:
  -rw-r--r--  1 garciaflores users  4096 févr. 10  2016 ._launch.txt  -rw-r--r--  1 garciaflores users  4096 févr. 10  2016 ._launch.txt
  -rw-r--r--  1 garciaflores users    95 févr. 10  2016 launch.txt  -rw-r--r--  1 garciaflores users    95 févr. 10  2016 launch.txt
 +</code>
  
-As the [http://svn.ask.it.usyd.edu.au/trac/candc/wiki C&C web] is not visible at the moment, we have to go look for [http://web.archive.org/web/20160313031620/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/Installation old C&C installation documentation] to the way back machine+As the [[http://svn.ask.it.usyd.edu.au/trac/candc/wiki C&C web]] is not visible at the moment, we have to go look for [[http://web.archive.org/web/20160313031620/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/Installation old C&C installation documentation]] to the way back machine
  
 So first we go to the candc directory So first we go to the candc directory
 +<code>
  $ cd BoxerServer/candc  $ cd BoxerServer/candc
 +</code>
  
 Then we create a symbolic link to the makefile for unix Then we create a symbolic link to the makefile for unix
- $ ln -s Makefile.unix Makefile+<code> $ ln -s Makefile.unix Makefile </code>
  
 And we make... And we make...
- $ make+<code> $ make </code>
  
-You might get an error about permissions on ''src/scripts/version'' file, so you should ''chmod'' it +You might get an error about permissions on ''src/scripts/version'' file, so you should **chmod** it 
-  chmod a+x src/scripts/version+<code>  chmod a+x src/scripts/version </code>
  
 If you get an errors of unrecognized object files like these If you get an errors of unrecognized object files like these
- src/main/pos.o: file not recognized: Format de fichier non reconnu+<code> src/main/pos.o: file not recognized: Format de fichier non reconnu </code>
  
 ...you should erase the file and make again ...you should erase the file and make again
- $ rm src/main/pos.o+<code> $ rm src/main/pos.o
  $ make  $ make
 +</code>
  
-Afterwards I got a ''sleep'' function error.  +Afterwards I got a **sleep** function error.  
- +<code>
  src/lib/extract/_baseimpl.cc: In member function ‘virtual void NLP::Extract::_BaseImpl::_pass1(NLP::IO::Reader&, bool)’:  src/lib/extract/_baseimpl.cc: In member function ‘virtual void NLP::Extract::_BaseImpl::_pass1(NLP::IO::Reader&, bool)’:
  src/lib/extract/_baseimpl.cc:49:10: error: ‘sleep’ was not declared in this scope  src/lib/extract/_baseimpl.cc:49:10: error: ‘sleep’ was not declared in this scope
Ligne 162: Ligne 168:
           ^            ^ 
  make: *** [src/lib/extract/_baseimpl.o] Erreur 1  make: *** [src/lib/extract/_baseimpl.o] Erreur 1
 +</code>
  
-I doubted between using [http://www.cplusplus.com/reference/thread/this_thread/sleep_for/ ''sleep_for'' c++ function] or just comment the line on ''src/lib/extract/_baseimpl.cc''. I did the latter and apparently it worked: +I doubted between using [[http://www.cplusplus.com/reference/thread/this_thread/sleep_for/ sleep_for c++ function]] or just comment the line on ''src/lib/extract/_baseimpl.cc''. I did the latter and apparently it worked: 
 +<code>
  // Commented by JGF for FRED 12/oct/16  // Commented by JGF for FRED 12/oct/16
  // sleep(3);  // sleep(3);
 +</code>
  
-====C&C Soap Server==== +=== C&C Soap Server === 
-There's [http://web.archive.org/web/20150304125339/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/InstallSOAP a dedicated doc page] for building the C&C Soap server. So here we go. The first thing we check is that there's and ''ext'' directory inside the 'candc' distrib: +There'[[http://web.archive.org/web/20150304125339/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/InstallSOAP a dedicated doc page]] for building the C&C Soap server. So here we go. The first thing we check is that there's and **ext** directory inside the 'candc' distrib: 
 +<code>
  $ pwd  $ pwd
  /opt/FRED/BoxerServer/candc  /opt/FRED/BoxerServer/candc
 +</code> 
 +<code>
  $ ls  $ ls
  bin  ext         lib                LICENCE.txt  Makefile.cygwin  Makefile.macosx   Makefile.mingw  Makefile.targets  models       src        test.ccg  bin  ext         lib                LICENCE.txt  Makefile.cygwin  Makefile.macosx   Makefile.mingw  Makefile.targets  models       src        test.ccg
  doc  grepsource  LICENCE-BOXER.txt  Makefile     Makefile.deps    Makefile.macosxu  Makefile.sunos  Makefile.unix     RELEASE.txt  test1.ccg  working  doc  grepsource  LICENCE-BOXER.txt  Makefile     Makefile.deps    Makefile.macosxu  Makefile.sunos  Makefile.unix     RELEASE.txt  test1.ccg  working
 +</code>
  
-''GSoap'' is already installed in the ''ext'' directory:+//GSoap// is already installed in the ''ext'' directory: 
 +<code>
  $ ls ext/  $ ls ext/
  bin  gsoap-2.8  include  lib  share  bin  gsoap-2.8  include  lib  share
 +</code>
  
-So we follow the building instructions of the [http://web.archive.org/web/20150304125339/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/InstallSOAP C&C Soap server manual]:+So we follow the building instructions of the [[http://web.archive.org/web/20150304125339/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/InstallSOAP C&C Soap server manual]]: 
 +<code>
  $ cd ext/gsoap-2.8  $ cd ext/gsoap-2.8
  $ chmod a+x configure  $ chmod a+x configure
  $ ./configure --prefix=/opt/FRED/BoxerServer/candc/ext/  $ ./configure --prefix=/opt/FRED/BoxerServer/candc/ext/
  $ make  $ make
 +</code>
  
-I got an ''aclocal-1.10'' error+I got an //aclocal-1.10// error 
 +<code>
  cd . && /bin/bash /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run aclocal-1.10  cd . && /bin/bash /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run aclocal-1.10
  /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing: ligne 46: aclocal-1.10 : commande introuvable  /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing: ligne 46: aclocal-1.10 : commande introuvable
Ligne 197: Ligne 212:
          this package.  You may also peek at any GNU archive site, in case          this package.  You may also peek at any GNU archive site, in case
          some other package would contain this missing `aclocal-1.10' program.          some other package would contain this missing `aclocal-1.10' program.
 +</code>
  
-As we don't have but an aclocal-1.14 version, I change manually the ext/gsoap-2.8/Makefile, editing lines 89 and 98 in order to update the ac-local version+As we don't have but an aclocal-1.14 version, I change manually the ''ext/gsoap-2.8/Makefile'', editing lines **89** and **98** in order to update the ac-local version 
 +<code>
  ACLOCAL = ${SHELL} /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run aclocal-1.14  ACLOCAL = ${SHELL} /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run aclocal-1.14
  # ACLOCAL = ${SHELL} /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run aclocal-1.10    # ACLOCAL = ${SHELL} /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run aclocal-1.10  
Ligne 204: Ligne 221:
  AUTOMAKE = ${SHELL} /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run automake-1.14  AUTOMAKE = ${SHELL} /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run automake-1.14
  # AUTOMAKE = ${SHELL} /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run automake-1.10  # AUTOMAKE = ${SHELL} /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/missing --run automake-1.10
 +</code>
  
 And then run make again And then run make again
- $ make+<code> $ make </code>
  
-It works for aclocal, but crashes because on a missing ''yacc'' error+It works for aclocal, but crashes because on a missing //yacc// error 
 +<code>
  make[4]: entrant dans le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/gsoap/src »  make[4]: entrant dans le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/gsoap/src »
  /bin/bash ../../ylwrap soapcpp2_yacc.y y.tab.c soapcpp2_yacc.c y.tab.h `echo soapcpp2_yacc.c | sed -e s/cc/hh/es/cpp/hh/es/cpp/hpp/ -e s/cxx/hxx/es/c++/hxx/es/c++/h++/ -e s/c$/h/ y.output soapcpp2_yacc.output -- yacc -d -v  /bin/bash ../../ylwrap soapcpp2_yacc.y y.tab.c soapcpp2_yacc.c y.tab.h `echo soapcpp2_yacc.c | sed -e s/cc/hh/es/cpp/hh/es/cpp/hpp/ -e s/cxx/hxx/es/c++/hxx/es/c++/h++/ -e s/c$/h/ y.output soapcpp2_yacc.output -- yacc -d -v
Ligne 221: Ligne 240:
  make[1]: quittant le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8 »  make[1]: quittant le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8 »
  make: *** [all] Erreur 2  make: *** [all] Erreur 2
 +</code>
  
-So we install ''yacc'', clean and make again +So we install //yacc//, clean and make again 
 +<code>
  $ sudo apt-get install byacc flex  $ sudo apt-get install byacc flex
  $ make clean  $ make clean
  $ ./configure --prefix=/opt/FRED/BoxerServer/candc/  $ ./configure --prefix=/opt/FRED/BoxerServer/candc/
  $ make  $ make
 +</code>
  
 Yacc looks OK now, but it crashes on a bizarre linking error Yacc looks OK now, but it crashes on a bizarre linking error
 +<code>
  gcc -DWITH_YACC -DWITH_FLEX  -DSOAPCPP_IMPORT_PATH="\"/opt/FRED/BoxerServer/candc/share/gsoap/import\"" -DLINUX -g -O2   -o soapcpp2 soapcpp2-soapcpp2_yacc.o soapcpp2- soapcpp2_lex.o soapcpp2-symbol2.o soapcpp2-error2.o soapcpp2-init2.o soapcpp2-soapcpp2.o -ly -lfl  gcc -DWITH_YACC -DWITH_FLEX  -DSOAPCPP_IMPORT_PATH="\"/opt/FRED/BoxerServer/candc/share/gsoap/import\"" -DLINUX -g -O2   -o soapcpp2 soapcpp2-soapcpp2_yacc.o soapcpp2- soapcpp2_lex.o soapcpp2-symbol2.o soapcpp2-error2.o soapcpp2-init2.o soapcpp2-soapcpp2.o -ly -lfl
  /usr/bin/ld: ne peut trouver -ly  /usr/bin/ld: ne peut trouver -ly
Ligne 243: Ligne 264:
  make[1]: quittant le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8 »  make[1]: quittant le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8 »
  make: *** [all] Erreur 2  make: *** [all] Erreur 2
 +</code>
  
-Apparently, this ''-ly'' gcc option corresponds to line 299 of the Makefile +Apparently, this //-ly// gcc option corresponds to line 299 of the Makefile 
- YACC_LIB = -ly+<code> YACC_LIB = -ly </code>
  
-We will try installing the ''ml-yacc'' and ''libbison-dev'' Ubuntu libraries +We will try installing the //ml-yacc// and //libbison-dev// Ubuntu libraries 
- $ sudo apt-get install ml-yacc libbison-dev+<code> $ sudo apt-get install ml-yacc libbison-dev </code>
  
-Now we get errors concerning ssl and crypto libraries, so we go for ''libssl-dev'' package +Now we get errors concerning ssl and crypto libraries, so we go for //libssl-dev// package 
- $ sudo apt-get install libssl-dev+<code> $ sudo apt-get install libssl-dev </code>
  
 And it's done! And it's done!
 +<code>
  make[5]: entrant dans le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/gsoap/wsdl »  make[5]: entrant dans le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8/gsoap/wsdl »
  make[5]: Rien à faire pour « all-am ».  make[5]: Rien à faire pour « all-am ».
Ligne 263: Ligne 286:
  make[2]: quittant le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8 »  make[2]: quittant le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8 »
  make[1]: quittant le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8 »  make[1]: quittant le répertoire « /opt/FRED/BoxerServer/candc/ext/gsoap-2.8 »
 +</code>
  
 ...so we go for the install ...so we go for the install
 +<code>
  $ make install  $ make install
  +--------------------------------------------------------+  +--------------------------------------------------------+
Ligne 281: Ligne 306:
                http://sourceforge.net/projects/gsoap2   |                http://sourceforge.net/projects/gsoap2   |
  +--------------------------------------------------------+  +--------------------------------------------------------+
- +</code> 
-===Boxer and statistical models=== +===== Boxer and statistical models ===== 
-Following [http://web.archive.org/web/20160313031620/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/Installation the documentation (Step 6)], we just go to the ''candc'' directory and make...+Following [[http://web.archive.org/web/20160313031620/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/Installation the documentation (Step 6)]], we just go to the //candc// directory and make... 
 +<code>
  $ cd /opt/FRED/BoxerServer/cand  $ cd /opt/FRED/BoxerServer/cand
  $ make bin/boxer  $ make bin/boxer
Ligne 304: Ligne 330:
  % Autoloader: iteration 2 resolved 21 predicates and loaded 28 files in 0,074 seconds.  Restarting ...  % Autoloader: iteration 2 resolved 21 predicates and loaded 28 files in 0,074 seconds.  Restarting ...
  % Autoloader: loaded 33 files in 3 iterations in 0,205 seconds  % Autoloader: loaded 33 files in 3 iterations in 0,205 seconds
 +</code>
  
 Finally, we just check that the statistical models are there: Finally, we just check that the statistical models are there:
 +<code>
  $ ls models/  $ ls models/
  boxer  chunk_quotes  muc  noquotes  pos           pos_questions  questions  super_noquotes   super_quotes  boxer  chunk_quotes  muc  noquotes  pos           pos_questions  questions  super_noquotes   super_quotes
  chunk  config        ner  parser    pos_noquotes  pos_quotes     super      super_questions  verbstem.list  chunk  config        ner  parser    pos_noquotes  pos_quotes     super      super_questions  verbstem.list
 +</code>
  
-And do some testing from [http://web.archive.org/web/20150304100912/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/Examples C&C examples page] +And do some testing from [[http://web.archive.org/web/20150304100912/http://svn.ask.it.usyd.edu.au/trac/candc/wiki/Examples C&C examples page]
 +<code>
  $ bin/candc --models models  $ bin/candc --models models
  # this file was generated by the following command(s):  # this file was generated by the following command(s):
Ligne 317: Ligne 347:
  # this file was generated by the following command(s):  # this file was generated by the following command(s):
  #   bin/candc --models models  #   bin/candc --models models
 +</code>
  
 You have to type a sentence (like 'I would like to go'): You have to type a sentence (like 'I would like to go'):
 +<code>
  I would like to go  I would like to go
  1 parsed at B=0.075, K=20  1 parsed at B=0.075, K=20
Ligne 327: Ligne 359:
  (ncsubj go_4 I_0 _)  (ncsubj go_4 I_0 _)
  <c> I|I|PRP|I-NP|O|NP would|would|MD|I-VP|O|(S[dcl]\NP)/(S[b]\NP) like|like|VB|I-VP|O|(S[b]\NP)/(S[to]\NP) to|to|TO|I-VP|O|(S[to]\NP)/(S[b]\NP) go|go|VB|I-VP|O|S[b]\NP  <c> I|I|PRP|I-NP|O|NP would|would|MD|I-VP|O|(S[dcl]\NP)/(S[b]\NP) like|like|VB|I-VP|O|(S[b]\NP)/(S[to]\NP) to|to|TO|I-VP|O|(S[to]\NP)/(S[b]\NP) go|go|VB|I-VP|O|S[b]\NP
 +</code> 
 +<code>
  1 stats 0.693147 25 25 comb 20 13 0 0  1 stats 0.693147 25 25 comb 20 13 0 0
- +</code> 
-===Stanford Core NLP v.3.4.1=== +==== Stanford Core NLP v.3.4.1 ==== 
-FRED works only with Core NLP is 3.4.1, so we should go to [https://stanfordnlp.github.io/CoreNLP/history.html Stanford Core NLP release history page] in order to downloado this specific version. +FRED works only with Core NLP is 3.4.1, so we should go to [[https://stanfordnlp.github.io/CoreNLP/history.html Stanford Core NLP release history page]] in order to download this specific version. 
 +<code>
  $ cd /opt/FRED/externals/tgz  $ cd /opt/FRED/externals/tgz
  $ wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip  $ wget http://nlp.stanford.edu/software/stanford-corenlp-full-2014-08-27.zip
  $ cd ..  $ cd ..
  $ unzip tgz/stanford-corenlp-full-2014-08-27.zip  $ unzip tgz/stanford-corenlp-full-2014-08-27.zip
 +</code>
  
-Now we follow the "[https://stanfordnlp.github.io/CoreNLP/cmdline.html Using Stanford CoreNLP from the command line]" documentation page. So we go to Core NLP root directory and run... +Now we follow the "[[https://stanfordnlp.github.io/CoreNLP/cmdline.html Using Stanford CoreNLP from the command line]]" documentation page. So we go to Core NLP root directory and run... 
 +<code>
  $ java -cp "*" -Xmx2g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,parse,dcoref -file input.txt  $ java -cp "*" -Xmx2g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,parse,dcoref -file input.txt
  
Ligne 382: Ligne 416:
  Pipeline setup: 0,0 sec.  Pipeline setup: 0,0 sec.
  Total time for StanfordCoreNLP pipeline: 1,6 sec.  Total time for StanfordCoreNLP pipeline: 1,6 sec.
 +</code>
  
 According to the documentation, this command process a file called ''input.txt'' and produces an ''input.txt.xml'' file with POS, named entites and lemma annotation. There's some configuration to do (classpath, properties file) but we will wait until we know how exactly FRED uses Core NLP for further configuration. According to the documentation, this command process a file called ''input.txt'' and produces an ''input.txt.xml'' file with POS, named entites and lemma annotation. There's some configuration to do (classpath, properties file) but we will wait until we know how exactly FRED uses Core NLP for further configuration.
  
-===Python interface to Stanford Core NLP tools v3.4.1=== +==== Python interface to Stanford Core NLP tools v3.4.1 ==== 
-So we go back to the /opt/FRED/externals directory and clone [https://github.com/dasmith/stanford-corenlp-python.git Stanford Core NLP Python wrapper]+So we go back to the /opt/FRED/externals directory and clone [[https://github.com/dasmith/stanford-corenlp-python.git Stanford Core NLP Python wrapper]
 +<code>
  $ cd /opt/FRED/externals  $ cd /opt/FRED/externals
  $ git clone https://github.com/dasmith/stanford-corenlp-python.git  $ git clone https://github.com/dasmith/stanford-corenlp-python.git
 +</code>
  
 We check python version and install pip and the wrapper dependencies: We check python version and install pip and the wrapper dependencies:
 +<code>
  $ python --version  $ python --version
  Python 2.7.6  Python 2.7.6
  $ sudo apt-get install python-pip  $ sudo apt-get install python-pip
  $ sudo pip install pexpect unidecode  $ sudo pip install pexpect unidecode
 +</code>
  
-The we follow [https://github.com/dasmith/stanford-corenlp-python/blob/master/README.md the python wrapper documentation], which specifies that Stanford Core NLP must be a child directory of the python wrapper, so we move our Core NLP directory inside the wrapper's directory:+The we follow [[https://github.com/dasmith/stanford-corenlp-python/blob/master/README.md the python wrapper documentation]], which specifies that Stanford Core NLP must be a child directory of the python wrapper, so we move our Core NLP directory inside the wrapper's directory: 
 +<code>
  $ pwd  $ pwd
  /opt/FRED/externals  /opt/FRED/externals
Ligne 403: Ligne 443:
  $ mv stanford-corenlp-full-2014-08-27/ stanford-corenlp-python/  $ mv stanford-corenlp-full-2014-08-27/ stanford-corenlp-python/
  $ ln -s stanford-corenlp-python/stanford-corenlp-full-2014-08-27/ stanford-corenlp  $ ln -s stanford-corenlp-python/stanford-corenlp-full-2014-08-27/ stanford-corenlp
 +</code>
  
 Then we launch the wrapper's server Then we launch the wrapper's server
 +<code>
  $ python corenlp.py  $ python corenlp.py
  
  Loading Models: 5/5  Loading Models: 5/5
  INFO:__main__:Serving on http://127.0.0.1:8080  INFO:__main__:Serving on http://127.0.0.1:8080
 +</code>
  
 There's a client.py program for testing the wrapper: There's a client.py program for testing the wrapper:
 +<code>
  $ python client.py  $ python client.py
  {u'sentences': [{u'parsetree': u'(ROOT (S (VP (NP (INTJ (UH Hello)) (NP (NN world)))) (. !)))',  {u'sentences': [{u'parsetree': u'(ROOT (S (VP (NP (INTJ (UH Hello)) (NP (NN world)))) (. !)))',
Ligne 427: Ligne 471:
       from nltk.tree import Tree       from nltk.tree import Tree
  ImportError: No module named nltk.tree  ImportError: No module named nltk.tree
 +</code>
  
-So we must install [http://www.nltk.org/install.html NLTK] because it looks like a dependecy for the wrapper:+So we must install [[http://www.nltk.org/install.html NLTK]] because it looks like a dependecy for the wrapper: 
 +<code>
  $ sudo pip install -U nltk  $ sudo pip install -U nltk
  $ python  $ python
  >>> import nltk  >>> import nltk
  $ sudo python -m nltk.downloader -d /usr/local/share/nltk_data all  $ sudo python -m nltk.downloader -d /usr/local/share/nltk_data all
 +</code>
  
 We test again We test again
 +<code>
  $ python client.py  $ python client.py
  Traceback (most recent call last):  Traceback (most recent call last):
    File "client.py", line 18, in <module>    File "client.py", line 18, in <module>
       tree = Tree.parse(result['sentences'][0]['parsetree'])       tree = Tree.parse(result['sentences'][0]['parsetree'])
 +</code>
  
 We still have an error, but it doesn't look bad, so we're going to ignore it and move on. We still have an error, but it doesn't look bad, so we're going to ignore it and move on.
  
-===Babelfly=== +==== Babelfly ==== 
-I can't find any reference to entity disambiguation with Babelfly in FRED code, so I wont proceed to the installation from the [http://babelfy.org/download Babelfly download page]. Maybe it's a TODO to replace the Tagme calls (which are still inside FRED code) for Babelfly calls. +I can't find any reference to entity disambiguation with Babelfly in FRED code, so I wont proceed to the installation from the [[http://babelfy.org/download Babelfly download page]]. Maybe it's a TODO to replace the Tagme calls (which are still inside FRED code) for Babelfly calls. 
 +<code>
  $ find . -name "*.py" -exec grep -Hn agme {} \;  $ find . -name "*.py" -exec grep -Hn agme {} \;
  ./fred-corenlp/server-fred-paris.py:139:        tagmeEntities = {}  ./fred-corenlp/server-fred-paris.py:139:        tagmeEntities = {}
Ligne 461: Ligne 511:
  $ find . -name "*.py" -exec grep -Hn abelfly {} \;  $ find . -name "*.py" -exec grep -Hn abelfly {} \;
  [ ]  [ ]
- +</code> 
-==Configuration==+===== Configuration =====
 First we will go to fred-corenlp directory First we will go to fred-corenlp directory
 +<code>
  $ cd /opt/FRED/fred-corenlp  $ cd /opt/FRED/fred-corenlp
 +</code>
  
-There, we will edit the ''config.py'' file to add ''candc'' path in line 5 +There, we will edit the ''config.py'' file to add //candc// path in line 5 
- CANDC_BIN_PATH = '/opt/FRED/BoxerServer/candc'+ ''CANDC_BIN_PATH = /opt/FRED/BoxerServer/candc''
  
-...and line 159 with the right ''nltk_data'' path+...and line 159 with the right //nltk_data// path
  
- NLTK_PATH = '/usr/local/share/nltk_data'   +<code> NLTK_PATH = '/usr/local/share/nltk_data' </code>
  
 Then we go back to FRED root to edit Boxer's files Then we go back to FRED root to edit Boxer's files
 +<code>
   $ cd ..   $ cd ..
   $ emacs -nw localboxerclient localboxerserver   $ emacs -nw localboxerclient localboxerserver
 +</code>
  
-In both files we set ''candc'' root:+In both files we set //candc// root: 
 +<code>
  PREFIX=/opt/FRED/BoxerServer/candc  PREFIX=/opt/FRED/BoxerServer/candc
 +</code>
  
-''localboxerserver'' should look like:+//localboxerserver// should look like: 
 +<code>
  !/bin/bash                                                                                               !/bin/bash                                                                                             
  PREFIX=/opt/FRED/BoxerServer/candc                    PREFIX=/opt/FRED/BoxerServer/candc                  
  PREFIX/bin/soapserverserverlocalhost:9000modelsPREFIX/bin/soapserverserverlocalhost:9000modelsPREFIX/models/boxer --candc-printer boxer --candc-int-betas "0 0 0 0 0"  PREFIX/bin/soapserverserverlocalhost:9000modelsPREFIX/bin/soapserverserverlocalhost:9000modelsPREFIX/models/boxer --candc-printer boxer --candc-int-betas "0 0 0 0 0"
- +</code> 
-==Testing==+===== Testing =====
 We first go to FRED root We first go to FRED root
 +<code>
  $ cd /opt/FRED  $ cd /opt/FRED
 +</code>
  
 And launch the boxer server And launch the boxer server
- $ sh launchboxerserver+<code> $ sh launchboxerserver </code>
  
 We get a permission error, so we add execution attribute for both files We get a permission error, so we add execution attribute for both files
 +<code>
  $ sudo chmod a+x BoxerServer/candc/bin/soap_client   $ sudo chmod a+x BoxerServer/candc/bin/soap_client 
  $ sudo chmod a+x BoxerServer/candc/bin/soap_server  $ sudo chmod a+x BoxerServer/candc/bin/soap_server
 +</code>
  
 And we get more errors: And we get more errors:
 +<code>
  $ sh launchboxerserver  $ sh launchboxerserver
  /opt/FRED/BoxerServer/candc/bin/soap_server: 1: /opt/FRED/BoxerServer/candc/bin/soap_server: Syntax error: "(" unexpected  /opt/FRED/BoxerServer/candc/bin/soap_server: 1: /opt/FRED/BoxerServer/candc/bin/soap_server: Syntax error: "(" unexpected
Ligne 504: Ligne 566:
  /opt/FRED/BoxerServer/candc/bin/soap_client: 1: /opt/FRED/BoxerServer/candc/bin/soap_client: Syntax error: word unexpected (expecting ")")  /opt/FRED/BoxerServer/candc/bin/soap_client: 1: /opt/FRED/BoxerServer/candc/bin/soap_client: Syntax error: word unexpected (expecting ")")
  ERROR: file /tmp/boxer.ccg does not exist  ERROR: file /tmp/boxer.ccg does not exist
 +</code>
  
-''TODO'': recompile soap clients and server paying attention to parenthesis...+**TODO**: recompile soap clients and server paying attention to parenthesis...
  
  • Dernière modification: il y a 5 ans