Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The HelloQA pipeline works out of the box, but you'll need to download the
Gutenberg index input data separately (it's a big file and doesn't make sense to
keep it in the repository, bad practice and all).

## Dataset Preparation

!!! Note that the following is obsolete. Dataset is included in the repo.
See also https://github.com/oaqa/helloqa/wiki/DSO-Project !!!

1. Download the Gutenberg index
[here](https://github.com/downloads/oaqa/helloqa/guten.tar.gz "guten.tar.gz").

Expand All @@ -16,6 +21,8 @@ keep it in the repository, bad practice and all).
project such that your helloqa/data/guten directory contains bin, conf, data,
lib, etc.

## Running the Pipeline (Eclipse)

You're now ready to run the pipeline.

1. Open project in Eclipse.
Expand All @@ -25,3 +32,12 @@ You're now ready to run the pipeline.
3. Expand "launches" and right-click on test.launch > Run As > test. This
launch should now be the default behavior whenever you click the "Run" button
in the toolbar while you're in the helloqa project.

## Running the Pipeline (commandline)

As an alternative, you may run the project outside of Eclipse. Simply
issue the command:

mvn exec:exec -Dexec.executable=java -Dexec.args="-Djava.library.path=lib/ -classpath %classpath edu.cmu.lti.oaqa.ecd.driver.ECDDriver phases.err-analysis-IE-dsoqa"

You may vary the last argument, see the src/main/resources/phases/ directory.
Binary file modified data/oaqa-eval.db3
Binary file not shown.
2 changes: 1 addition & 1 deletion launches/test.launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
<mapEntry key="[debug]" value="org.eclipse.jdt.launching.localJavaApplication"/>
</mapAttribute>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="/home/ruil/workspace/git/helloqa/console.log"/>
<stringAttribute key="org.eclipse.debug.ui.ATTR_CAPTURE_IN_FILE" value="console-brm.log"/>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="edu.cmu.lti.oaqa.ecd.driver.ECDDriver"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="phases.err-analysis-IE-dsoqa"/>
Expand Down
Empty file modified lib/libindri_jni.so
100644 → 100755
Empty file.
15 changes: 14 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</repository>
<repository>
<id>oaqa-thirdparty</id>
<url>http://mu.lti.cs.cmu.edu:8081/nexus/content/repositories/oaqa-thirdparty</url>
<url>http://mu.lti.cs.cmu.edu:8081/nexus/content/repositories/thirdparty</url>
</repository>
</repositories>

Expand Down Expand Up @@ -234,6 +234,19 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>edu.cmu.lti.oaqa.ecd.driver.ECDDriver</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void initialize(UimaContext aContext)

@Override
public void initialize() {
String filePathName = "/home/ruil/workspace/git/helloqa/src/main/resources/gs/dso-extension-answerkey.txt";
String filePathName = "src/main/resources/gs/dso-extension-answerkey.txt";
List<String> lines = FileUtil.readFile(filePathName);
for (int i = 0; i < lines.size(); i++) {
String psggs = lines.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.io.File;

import org.apache.uima.UimaContext;
import org.apache.uima.resource.ResourceInitializationException;
Expand Down Expand Up @@ -37,21 +38,23 @@ public void initialize(UimaContext aContext)

@Override
public void initialize() {
localWikiSearcher = new LocalCorpusSearcher();
localDSOSearcher = new LocalCorpusSearcher();

DSOLocalRetrievalCache dso_cache = new DSOLocalRetrievalCache();
WikiLocalRetrievalCache wiki_cache = new WikiLocalRetrievalCache();

searchers.add(localWikiSearcher);
searchers.add(localDSOSearcher);
String wikiIndex = "/home/ruil/Downloads/Indexes/wikipedia";
if (new File(wikiIndex).isFile()) {
localWikiSearcher = new LocalCorpusSearcher();
WikiLocalRetrievalCache wiki_cache = new WikiLocalRetrievalCache();
localWikiSearcher.initialize(wiki_cache.getInstance(), wikiIndex);
searchers.add(localWikiSearcher);
}

localWikiSearcher.initialize(wiki_cache.getInstance(),
"/home/ruil/Downloads/Indexes/wikipedia");
localDSOSearcher.initialize(dso_cache.getInstance(),
"xmirepo/dso/index");
String DSOIndex = "xmirepo/dso/index";
if (new File(DSOIndex).isFile()) {
localDSOSearcher = new LocalCorpusSearcher();
DSOLocalRetrievalCache dso_cache = new DSOLocalRetrievalCache();
localDSOSearcher.initialize(dso_cache.getInstance(), DSOIndex);
searchers.add(localDSOSearcher);
}

String filePathName = "/home/ruil/workspace/git/helloqa/src/main/resources/gs/dso-extension-psg.txt";
String filePathName = "src/main/resources/gs/dso-extension-psg.txt";
List<String> lines = FileUtil.readFile(filePathName);
for (int i = 0; i < lines.size(); i++) {
String psggs = lines.get(i);
Expand All @@ -73,13 +76,17 @@ public List<RetrievalResult> retrieveDocuments(String qid,
String answerType) {
List<RetrievalResult> mergedresults = new ArrayList<RetrievalResult>();

List<RetrievalResult> localWikipassages = localWikiSearcher
.retrieveDocuments(keyterms, keyphrases, question, answerType);
mergedresults.addAll(localWikipassages);
if (localWikiSearcher != null) {
List<RetrievalResult> localWikipassages = localWikiSearcher
.retrieveDocuments(keyterms, keyphrases, question, answerType);
mergedresults.addAll(localWikipassages);
}

List<RetrievalResult> localDSOpassages = localDSOSearcher
.retrieveDocuments(keyterms, keyphrases, question, answerType);
mergedresults.addAll(localDSOpassages);
if (localDSOSearcher != null) {
List<RetrievalResult> localDSOpassages = localDSOSearcher
.retrieveDocuments(keyterms, keyphrases, question, answerType);
mergedresults.addAll(localDSOpassages);
}

RetrievalResult gspassage = readGsPsgs(qid);
mergedresults.add(gspassage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.ArrayList;
import java.util.List;
import java.io.File;

import org.apache.uima.UimaContext;
import org.apache.uima.resource.ResourceInitializationException;
Expand Down Expand Up @@ -35,20 +36,27 @@ public void initialize(UimaContext aContext)

@Override
public void initialize() {
localWikiSearcher = new LocalCorpusSearcher();
localDSOSearcher=new LocalCorpusSearcher();
//webSearcher = new WebDocumentSearcher();
//rdfSearcher = new RDFSearcher();

DSOLocalRetrievalCache dso_cache=new DSOLocalRetrievalCache();
WikiLocalRetrievalCache wiki_cache=new WikiLocalRetrievalCache();

searchers.add(localWikiSearcher);
searchers.add(localDSOSearcher);
//searchers.add(rdfSearcher);

localWikiSearcher.initialize(wiki_cache.getInstance(), "/home/ruil/Downloads/Indexes/wikipedia");
localDSOSearcher.initialize(dso_cache.getInstance(), "xmirepo/dso/index");
String wikiIndex = "/home/ruil/Downloads/Indexes/wikipedia";
if (new File(wikiIndex).isFile()) {
localWikiSearcher = new LocalCorpusSearcher();
WikiLocalRetrievalCache wiki_cache=new WikiLocalRetrievalCache();
localWikiSearcher.initialize(wiki_cache.getInstance(), wikiIndex);
searchers.add(localWikiSearcher);
}

String DSOIndex = "xmirepo/dso/index";
if (new File(DSOIndex).isFile()) {
localDSOSearcher=new LocalCorpusSearcher();
DSOLocalRetrievalCache dso_cache=new DSOLocalRetrievalCache();
localDSOSearcher.initialize(dso_cache.getInstance(), DSOIndex);
searchers.add(localDSOSearcher);
}

// try {
// rdfSearcher.initialize(null, "");
// } catch (JSONException e) {
Expand All @@ -64,13 +72,17 @@ public List<RetrievalResult> retrieveDocuments(String qid, List<String> keyterms
// keyterms, keyphrases, question, answerType);
// mergedresults.addAll(RDFpassages);

List<RetrievalResult> localWikipassages = localWikiSearcher.retrieveDocuments(
keyterms, keyphrases, question, answerType);
mergedresults.addAll(localWikipassages);
if (localWikiSearcher != null) {
List<RetrievalResult> localWikipassages = localWikiSearcher.retrieveDocuments(
keyterms, keyphrases, question, answerType);
mergedresults.addAll(localWikipassages);
}

List<RetrievalResult> localDSOpassages = localDSOSearcher.retrieveDocuments(
keyterms, keyphrases, question, answerType);
mergedresults.addAll(localDSOpassages);
if (localDSOSearcher != null) {
List<RetrievalResult> localDSOpassages = localDSOSearcher.retrieveDocuments(
keyterms, keyphrases, question, answerType);
mergedresults.addAll(localDSOpassages);
}

// List<RetrievalResult> webpassages = webSearcher.retrieveDocuments(
// keyterms, keyphrases, question);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void TREC2CSE_QUestion(){

static void Question(){
HashMap<String, String> questionMap=new HashMap<String, String>();
ArrayList<String> lines=FileUtil.readFile("/home/ruil/workspace/git/helloqa/src/main/resources/gs/dso-extension-psg.txt");
ArrayList<String> lines=FileUtil.readFile("src/main/resources/gs/dso-extension-psg.txt");

int index=1;
for(String line:lines){
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/org.uimafit/types.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
classpath*:edu/cmu/lti/oaqa/OAQATypes.xml
classpath*:edu/cmu/lti/oaqa/frameworkTypesDescriptor.xml
2 changes: 1 addition & 1 deletion src/main/resources/phases/dsoqa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pipeline:
- inherit: jdbc.sqlite.cse.phase
name: passage-retrieval
options: |
- inherit: phases.PassageRetrieval
- inherit: phases.pr.PassageRetrieval

- inherit: jdbc.sqlite.cse.phase
name: information-extractor
Expand Down