2017-06-20 2 views
0

J'ai installé un serveur local de la bibliothèque de Stanford coreNLP sur mon système. Bien que, je suis en mesure d'obtenir les réponses comme on peut obtenir sur le demo site. Mais dans mon serveur wikipedia entity option ne fonctionne pas. Le serveur donne l'erreur suivante:L'annotateur d'entité de Wikipedia ne fonctionne pas dans le noyau de StanfordNLP

java.lang.RuntimeException: edu.stanford.nlp.io.RuntimeIOException: java.io.IOException: Unable to open "edu/stanford/nlp/models/kbp/wikidict.tab.gz" as class path, filename or URL 
     at edu.stanford.nlp.pipeline.WikidictAnnotator.<init>(WikidictAnnotator.java:81) 
     at edu.stanford.nlp.pipeline.AnnotatorImplementations.link(AnnotatorImplementations.java:296) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getNamedAnnotators$63(StanfordCoreNLP.java:517) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.lambda$getDefaultAnnotatorPool$65(StanfordCoreNLP.java:533) 
     at edu.stanford.nlp.util.Lazy$3.compute(Lazy.java:118) 
     at edu.stanford.nlp.util.Lazy.get(Lazy.java:31) 
     at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:146) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:447) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:150) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:146) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:133) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLPServer.mkStanfordCoreNLP(StanfordCoreNLPServer.java:319) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLPServer.access$500(StanfordCoreNLPServer.java:50) 
     at edu.stanford.nlp.pipeline.StanfordCoreNLPServer$CoreNLPHandler.handle(StanfordCoreNLPServer.java:642) 
     at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) 
     at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) 
     at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) 
     at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:675) 
     at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) 
     at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:647) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
     at java.lang.Thread.run(Thread.java:748) 
Caused by: edu.stanford.nlp.io.RuntimeIOException: java.io.IOException: Unable to open "edu/stanford/nlp/models/kbp/wikidict.tab.gz" as class path, filename or URL 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable$1.getReader(IOUtils.java:802) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable$1.<init>(IOUtils.java:760) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable.iterator(IOUtils.java:758) 
     at edu.stanford.nlp.pipeline.WikidictAnnotator.<init>(WikidictAnnotator.java:58) 
     ... 22 more 
Caused by: java.io.IOException: Unable to open "edu/stanford/nlp/models/kbp/wikidict.tab.gz" as class path, filename or URL 
     at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:480) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable.getStream(IOUtils.java:750) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable.access$000(IOUtils.java:719) 
     at edu.stanford.nlp.io.IOUtils$GetLinesIterable$1.getReader(IOUtils.java:792) 
     ... 25 more 

J'ai téléchargé le fichier wikidict.tab.gz, mais je suis incapable de comprendre comment l'utiliser.

+0

Quel est le problème? Pourquoi downvote? Mentionnez également certaines raisons. –

Répondre

3

@ réponse de sv_jan5 fonctionnera bien , mais peut-être plus facile est de télécharger et d'inclure dans votre classpath le modèle English (KBP) jar de la page de téléchargement (https://stanfordnlp.github.io/CoreNLP/download.html). La dénomination est quelque peu énigmatique - KBP signifie «Knowledge Base Population», qui englobe l'entité reliant les modèles et les nouveaux modèles d'extraction des relations.

Le lien direct est here pour la version 3.8.0 (avertissement: téléchargement de 500 Mo).

+0

Votre réponse est plus propre. Merci beaucoup! –

0

J'ai trouvé un moyen de résoudre ce problème. Vous devez effectuer les étapes suivantes:

  1. unzip stanford-corenlp-3.8.0-models.jar.
  2. Télécharger wikidict.tab.gz fichier de here
  3. Copiez le fichier wikidict.tab.gz dans edu/stanford/NLP/modèles/kbp
  4. Compresser tout dans stanford-corenlp-3.8.0-models.jar fichier
  5. Relancez le serveur