QWN-PPV is a method to automatically generate polarity lexicons. It only requires a Lexical Knowledge Base (LKB) such as Wordnet and a list of positive and negative seeds (either words or synsets). The algorithm propagates the initial polarities through the LKB projected over a graph by means of the UKB Personalized PageRank algorithm.
Resulting lexicons are polarity annotated at synset and lemma level.
Generated lexicons and other resources can be found at: http://adimen.si.ehu.es/web/qwn-ppv
The contents of the module are the following:
+ formatter.xml Apache OpenNLP code formatter for Eclipse SDK
+ pom.xml maven pom file which deals with everything related to compilation and execution of the module
+ src/ java source code of the module
+ Furthermore, the installation process, as described in the README.md, will generate another directory:
target/ it contains binary executable and other directories
Installing the qwn-ppv requires the following steps:
If you already have installed in your machine JDK6 and MAVEN 3, please go to step 3 directly. Otherwise, follow these steps:
- Install JDK 1.7
If you do not install JDK 1.7 in a default location, you will probably need to configure the PATH in .bashrc or .bash_profile:
export JAVA_HOME=/yourpath/local/java17
export PATH=${JAVA_HOME}/bin:${PATH}
If you use tcsh you will need to specify it in your .login as follows:
setenv JAVA_HOME /usr/java/java17
setenv PATH ${JAVA_HOME}/bin:${PATH}
If you re-login into your shell and run the command
java -version
You should now see that your jdk is 1.7
- Install MAVEN 3
Download MAVEN 3 from
wget http://apache.rediris.es/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz
Now you need to configure the PATH. For Bash Shell:
export MAVEN_HOME=/home/myuser/local/apache-maven-3.0.5
export PATH=${MAVEN_HOME}/bin:${PATH}
For tcsh shell:
setenv MAVEN3_HOME ~/local/apache-maven-3.0.5
setenv PATH ${MAVEN3}/bin:{PATH}
If you re-login into your shell and run the command
mvn -version
You should see reference to the MAVEN version you have just installed plus the JDK 6 that is using.
- Install UKB graph propagation software
Download UKB 2.0 from http://ixa2.si.ehu.es/ukb/
wget http://ixa2.si.ehu.es/ukb/ukb_2.0.tgz
Extract the files and follow the installation instructions in the src/INSTALL file (usual ./configure && make && sudo make install procedure):
tar -xzvf ukb_2.0.tgz
- Get module source code
git clone https://github.com/ixa-ehu/qwn-ppv
- Installing using maven
cd qwn-ppv
mvn clean package
This step will create a directory called target/ which contains various directories and files. Most importantly, there you will find the module executable:
ixa-qwn-ppv-1.0.jar
This executable contains every dependency the module needs, so it is completely portable as long as you have a JVM 1.7 installed.
To install the module in the local maven repository, usually located in ~/.m2/, execute:
mvn clean install
- USING qwn-ppv =========================
QWN-PPV includes some graphs by default. However in order to use them the must be compiled by ukb. In order to do this, execute qwn-ppv-1.0.jar as follows:
java -jar ixa-qwn-ppv-1.0.jar compile -k all
This command will create a 'graphs' folder in the same directory where 'qwn-ppv-1.0.jar' is located, and it will store the graphs included in the QWN-PPV distribution, which are:
- mcr30 : Graph built using all relations included in the Multilingual Central Repository (MCR).
- mcr30_Syn and mcr30_Ant: Graphs built using synonymy (mcr30_Syn) and antomymy relations (mcr30_Ant) in the MCR.
- mcr30_noAnt: Graph built using all relations of the MCR, except for antonymy relations (Gloss information included).
- mcr30_noAntGloss: Graph built using all relations of the MCR, except for antonymy and Gloss relations.
QWN-PPV provides 3 main funcionalities:
- compile: compile graph structures using UKB.
- create: Create polarity lexicons given a list of known polarity seeds (lemmas or MCR/Wordnet synsets -or any other custom graph node representation).
- eval: Evaluate the a given polarity lexicon agains a corpus.
Coming soon. In the meantime you can get the command line documentation by executing:
java -jar ixa-qwn-ppv-1.0.jar create -h
Coming soon. In the meantime you can get the command line documentation by executing:
java -jar ixa-qwn-ppv-1.0.jar eval -h
You can also generate the javadoc of the module by executing:
mvn javadoc:jar
Which will create a jar file core/target/qwn-ppv-1.0-javadoc.jar
Iñaki San Vicente and Rodrigo Agerri
IXA NLP Group
University of the Basque Country (UPV/EHU)
E-20018 Donostia-San Sebastián
inaki.sanvicente,rodrigo.agerri@ehu.es