Dear Jose,
On 22/06/16 05:25 PM, Jose Luis Vieyra Sagaon wrote:
> I've been trying to make it work how ever when I run it like this:
> LsrSenseInventory lsr = new
> LsrSenseInventory("wordnet/wordnet_properties.xml","en");
>
> However I got an exception asking for a resources.xml, I checked in your
> code to see if you have one example of the xml but I found none,
> moreover all the tests are ignored!
>
> Do you have a working example of LsrSenseInventory?
I'm afraid that DKPro LSR isn't very well documented -- or at least, not
any more. This library requires that you create a special XML file that
documents the location of your WordNet installation. I think an example
file may have been provided back when the project was hosted on Google
Code, but I can't find one on its current home on GitHub. (I've raised
an issue about this here: <
https://github.com/dkpro/dkpro-lsr/issues/8>)
To give a quick answer: First you need to make sure to set an
environment variable $DKPRO_HOME, whose value is some folder in your
home directory. (For example, ~/dkpro.) Then you need to create a file
named
$DKPRO_HOME/de.tudarmstadt.ukp.dkpro.lexsemresource.core.ResourceFactory/resources.xml.
The contents should be as follows:
<beans xmlns="
http://www.springframework.org/schema/beans"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
</bean>
<bean id="wordnet-en" lazy-init="true"
class="de.tudarmstadt.ukp.dkpro.lexsemresource.wordnet.WordNetResource">
<constructor-arg
value="${HOME}/share/WordNet/WordNet-3.0/extjwnl18_properties.xml"/>
</bean>
</beans>
Change "${HOME}/share/WordNet/WordNet-3.0/extjwnl18_properties.xml" to
the location of your extJWNL properties file.
Then, with your $DKPRO_HOME environment variable set, launch your DKPro
WSD application (or Eclipse, if you're running from there). You should
now be able to create an LsrSenseInventory as follows:
LsrSenseInventory lsr = new LsrSenseInventory("wordnet","en");
You probably noticed that this is a lot of work! DKPro LSR is a
somewhat antiquated component -- it's about ten years old; it is not
under very active development and so not a lot of work has gone into
documenting it and making it convenient to use. As I mentioned in my
previous e-mail, you should consider instead using the native extJWNL
interface to WordNet, which you can find in the si.wordnet module of
DKPro LSR. Then you won't need to fiddle around with any
arbitrarily-located configuration files, other than the extJWNL
properties file itself.