opennlp

Convert Natural Language Questions to SQL Queries

自古美人都是妖i 提交于 2019-12-03 07:44:26
问题 I want to convert Natural Language questions to SQL queries using opennlp Java library, i.e. Who won women figure skating in Sochi? should be converted to select name from winners where event='skating_woman' Anybody know which classes will be useful and how to achieve this? Also pasting code which I tried. I have converted question into statements and later into tokens. /////////1st part String paragraph = "Did Matt win the men slalom?"; InputStream is1 = new FileInputStream("bins/en-sent.bin

Sentence compression using NLP [closed]

天涯浪子 提交于 2019-12-03 05:54:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . Using Machine translation, can I obtain a very compressed version of a sentence, eg. I would really like to have a delicious tasty cup of coffee would be translated to I want coffee Does any of the NLP engines provide such a functionality? I got a few research papers that does paraphase generation and sentence

Can not apply patch LUCENE-2899.patch to SOLR on Windows

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 22:28:20
问题 I am trying to apply patch LUCENE-2899.patch to Solr. I have done this: Cloned solr from official repo (I am on master branch) Downloaded and installed ant and GNU patch, i get it here http://gnuwin32.sourceforge.net/packages/patch.htm Put Ant and GNU patch to PATH env var. And I got this... ``` D:\utils\solr_master\lucene-solr>patch -p1 -i LUCENE-2899.patch --dry-run patching file dev-tools/idea/.idea/ant.xml Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354 This application

Convert Natural Language Questions to SQL Queries

家住魔仙堡 提交于 2019-12-02 21:11:30
I want to convert Natural Language questions to SQL queries using opennlp Java library, i.e. Who won women figure skating in Sochi? should be converted to select name from winners where event='skating_woman' Anybody know which classes will be useful and how to achieve this? Also pasting code which I tried. I have converted question into statements and later into tokens. /////////1st part String paragraph = "Did Matt win the men slalom?"; InputStream is1 = new FileInputStream("bins/en-sent.bin"); SentenceModel model1 = new SentenceModel(is1); SentenceDetectorME sdetector = new

Sentence compression using NLP [closed]

寵の児 提交于 2019-12-02 19:18:15
Using Machine translation, can I obtain a very compressed version of a sentence, eg. I would really like to have a delicious tasty cup of coffee would be translated to I want coffee Does any of the NLP engines provide such a functionality? I got a few research papers that does paraphase generation and sentence compression . But is there any library which has already implemented this? If your intention is to make your sentences brief without losing important idea from that sentences then you can do that by just extracting triplet subject-predicate-object. Talking about tools/engine, I recommend

How to detect that two sentences are similar?

拈花ヽ惹草 提交于 2019-12-02 18:09:55
I want to compute how similar two arbitrary sentences are to each other. For example: A mathematician found a solution to the problem. The problem was solved by a young mathematician. I can use a tagger, a stemmer, and a parser, but I don’t know how detect that these sentences are similar. These two sentences are not just similar, they are almost paraphrases , i.e., two alternative ways of expressing the same meaning. It is also a very simple case of paraphrase, in which both utterances use the same words with the only exception of one being in active form while the other is passive. (The two

Training n-gram NER with Stanford NLP

巧了我就是萌 提交于 2019-12-02 14:10:59
Recently I have been trying to train n-gram entities with Stanford Core NLP. I have followed the following tutorials - http://nlp.stanford.edu/software/crf-faq.shtml#b With this, I am able to specify only unigram tokens and the class it belongs to. Can any one guide me through so that I can extend it to n-grams. I am trying to extract known entities like movie names from chat data set. Please guide me through in case I have mis-interpretted the Stanford Tutorials and the same can be used for the n-gram training. What I am stuck with is the following property #structure of your training file;

Why does the loading of a POSModel file not work from inside the WEB-INF folder?

跟風遠走 提交于 2019-12-02 13:27:37
I'm using Spring MVC for my web project. I placed the model files inside the WEB-INF directory String taggerModelPath = "/WEB-INF/lib/en-pos-maxent.bin"; String chunkerModelPath = "/WEB-INF/lib/en-chunker.bin"; POSModel model = new POSModelLoader() .load(new File(servletContext.getResource(taggerModelPath).toURI().getPath())); This worked Windows environment. However when I deployed it on my remote Linux server I got an error HTTP Status 500 - Request processing failed; nested exception is opennlp.tools.cmdline.TerminateToolException: The POS Tagger model file does not exist! Path: /localhost

OpenNLP POSTagger output from command line

半城伤御伤魂 提交于 2019-12-02 13:18:19
问题 I want to use OpenNLP in order to tokenize Thai words. I downloaded OpenNLP and Thai tokenize model and run the following ./bin/opennlp POSTagger -lang th -model thai.tok.bin < sentence.txt > output.txt I put thai.tok.bin that I downloaded on the directory that I call from and run the following. sentence.txt has this text inside กินอะไรยังนาย . However, the output I got has only these text: Usage: opennlp POSTagger model < sentences Execution time: 0.000 seconds I'm pretty new to OpenNLP ,

Span class in opennlp is not working

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 10:09:06
I am new to java opennlp and i am trying to implement a program that extracts city names from a file but i am testing my code on a string first and i get some errors the code is import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import main.java.opennlp.tools.namefind.NameFinderME; import main.java.opennlp.tools.namefind.TokenNameFinderModel; import main.java.opennlp.tools.util.InvalidFormatException; import main.java.opennlp.tools.util.Span; import opennlp.tools.tokenize.Tokenizer; import opennlp.tools.tokenize