dbpedia-spotlight / dbpedia-spotlight-model

DBpedia Spotlight is a tool for automatically annotating mentions of DBpedia resources in text. Improving Efficiency and Accuracy in Multilingual Entity Extraction approach
http://www.dbpedia-spotlight.org
Apache License 2.0
177 stars 43 forks source link

How to run in localhost server compiling from the newest source code #16

Open ShomyLiu opened 6 years ago

ShomyLiu commented 6 years ago

First I git clone the source code from https://github.com/dbpedia-spotlight/dbpedia-spotlight But I got a 0.70.jar after maven the project. However it can run successful with the command:

java -jar **********

So I find this repo, and clone to my computer and then use maven to package a jar: spotlight-1.0-jar-with-dependencies.jar

But when I run the jar, it got an error:

Error: Could not find or load main class org.dbpedia.spotlight.web.rest.Server

Did I forget something to deal with? Thanks

BTW, According to my test, the version 0.7 has a quite faster speed than the 1.0. I annotate a same text file, one cost 110 seconds and the other is 260 seconds.

darioloetscher commented 6 years ago

Hey,

You just picked the wrong jar. The jar you want to run is rest/target/rest-1.0-jar-with-dependencies.jar .

Then you can follow the normal instruction here https://github.com/dbpedia-spotlight/dbpedia-spotlight/wiki/Run-from-a-JAR .

As u can see, they just renaming the rest-1.0-jar-with-dependencies.jar to dbpedia-spotlight-nightly-build.jar in there CI http://jenkins.dbpedia-spotlight.org/job/spotlight/lastBuild/console .

ShomyLiu commented 6 years ago

@darioloetscher Hi, Thanks. It does work with the jar in rest/target/rest-1.0-jar-with-dependencies.jar. But why is the annotate speed in version 1.0 is quite slower than the version 0.7, costing almost 2X time.

sandroacoelho commented 6 years ago

Hi @darioloetscher, thank you for the answer.

Hi @ShomyLiu: our version 1.0 is version 0.7 without our first approach with Lucene. Btw, I am going to check it. Thank you for reporting it

ShomyLiu commented 6 years ago

@sandroacoelho OK, Looking forward to your checking result.

Skunnyk commented 6 years ago

@ShomyLiu can you post more informations about your performances problems between 0.7 and 1.0 ? Maybe you are hit by the "100-Continue" thing, see https://github.com/dbpedia-spotlight/dbpedia-spotlight/issues/450#issuecomment-329505073

ShomyLiu commented 6 years ago

@Skunnyk Thanks!
It seems that the problem is caused by 100-Continue. And as the #450 says, use a nginx server behind spotlight rest server, which means I can start multiple spotlight instances ,and use a upstream for loading balance like below:

 upstream localhost {
        server localhost:2222;  #a spotlight instance server
        server 1ocalhost:2223; #another spotlight instance server
        ....;
    }

    server {
        listen 80;
        location / {
            proxy_pass http://localhost;
        }
    }

Sorry for that I am new to nignx server, So would you mind checking the code ? Thanks

Gautamshahi commented 6 years ago

Hi, @ShomyLiu Do you have the jar file, can you please provide the link? On the given website its not working and nobody is helping.

ShomyLiu commented 6 years ago

@Gautamshahi Hi, I have uploaded the spotlight 1.0 jar in : https://drive.google.com/file/d/1vFwVCzoY9R9rBPpfmgD9LlXpW6KdEc7-/view?usp=sharing

As for the language jar (i.e, en.tar.gz) you can download from https://sourceforge.net/projects/dbpedia-spotlight/files/2016-10/en/model/

then you can run your jar according to https://github.com/dbpedia-spotlight/dbpedia-spotlight/wiki/Run-from-a-JAR

tar en.tar.gz
java -jar rest-1.0-jar-with-dependencies.jar path/to/model/folder/en_2+2 http://localhost:2222/rest

In fact, you can maven the spotlight 1.0 jar from the source code https://github.com/dbpedia-spotlight/dbpedia-spotlight-model: Be sure that installing java and maven

mvn clean
mvn install

this will cost some time in the first time for downloading some jars. After finishing this part, the jar will be in rest/target/rest-1.0-jar-with-dependencies.jar

Gautamshahi commented 6 years ago

Thank you for your effort.

I tried both ways but getting the error of load main class, one of the screenshot.

image

ShomyLiu commented 6 years ago

@Gautamshahi Hi, from the error information, it seems that your target folder DISI_3rd and 4th has blank space. You can rename your folder that doesn't have spaces or escape wiht \

Gautamshahi commented 6 years ago

Thank you, any suggestion?

image

ShomyLiu commented 6 years ago

@Gautamshahi From your error information, it's out of memory while loading the english corpus model. You can set more memory for jvm via -xms =xmx, which depends on the memory in your computer, such as:

java -Xms8G -Xmx8G -jar ........
Gautamshahi commented 6 years ago

Thank you, Yes It needs more RAM. I laptop has 6GB only.