Skip to content

Commit 3c13df6

Browse files
committed
Moved neccessary stanford models to src directory to reduce space needed. Removed parsers from NLP tools.
1 parent 375b658 commit 3c13df6

20 files changed

Lines changed: 192820 additions & 15 deletions

JavaBot/.classpath

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<classpathentry kind="lib" path="lib/stanford-corenlp-3.7.0/protobuf.jar"/>
2020
<classpathentry kind="lib" path="lib/stanford-corenlp-3.7.0/slf4j-api.jar"/>
2121
<classpathentry kind="lib" path="lib/stanford-corenlp-3.7.0/slf4j-simple.jar"/>
22-
<classpathentry kind="lib" path="lib/stanford-corenlp-3.7.0/stanford-corenlp-3.7.0-models.jar"/>
2322
<classpathentry kind="lib" path="lib/stanford-corenlp-3.7.0/stanford-corenlp-3.7.0.jar" sourcepath="lib/stanford-corenlp-3.7.0/stanford-corenlp-3.7.0-sources.jar">
2423
<attributes>
2524
<attribute name="javadoc_location" value="jar:platform:/resource/JavaBot/lib/stanford-corenlp-3.7.0/stanford-corenlp-3.7.0-javadoc.jar!/"/>
@@ -154,7 +153,6 @@
154153
<attribute name="owner.project.facets" value="jst.web"/>
155154
</attributes>
156155
</classpathentry>
157-
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
158156
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
159157
<classpathentry kind="lib" path="lib/apache-opennlp-1.7.1/lib/aopalliance-repackaged-2.5.0-b30.jar"/>
160158
<classpathentry kind="lib" path="lib/apache-opennlp-1.7.1/lib/grizzly-framework-2.3.28.jar"/>
@@ -192,5 +190,6 @@
192190
<classpathentry kind="lib" path="lib/apache-opennlp-1.7.1/lib/opennlp-tools-1.7.1.jar"/>
193191
<classpathentry kind="lib" path="lib/apache-opennlp-1.7.1/lib/osgi-resource-locator-1.0.1.jar"/>
194192
<classpathentry kind="lib" path="lib/apache-opennlp-1.7.1/lib/validation-api-1.1.0.Final.jar"/>
193+
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
195194
<classpathentry kind="output" path="bin"/>
196195
</classpath>

JavaBot/.project

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -788,11 +788,6 @@
788788
<type>1</type>
789789
<locationURI>PROJECT_LOC/lib/jcolibri2/spamcorpus.jar</locationURI>
790790
</link>
791-
<link>
792-
<name>web/WEB-INF/lib/stanford-corenlp-3.7.0-models.jar</name>
793-
<type>1</type>
794-
<locationURI>PROJECT_LOC/lib/stanford-corenlp-3.7.0/stanford-corenlp-3.7.0-models.jar</locationURI>
795-
</link>
796791
<link>
797792
<name>web/WEB-INF/lib/stanford-corenlp-3.7.0.jar</name>
798793
<type>1</type>

JavaBot/src/agk/chatbot/cbr/sim/TextSimilarity.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ public TextSimilarity() {}
8282
public static void init() throws Exception {
8383
try {
8484
if (Files.exists(Paths.get("wordnet/dict"))) init(new File("wordnet/dict").toURI().toURL());
85-
else if (Files.exists(Paths.get("../../wordnet/dict")))
86-
init(new File("../../wordnet/dict").toURI().toURL());
8785
else if (Files.exists(Paths.get("lib/wn.dict"))) init(new File("lib/wn.dict").toURI().toURL());
8886
else if (Files.exists(Paths.get("wn.dict"))) init(new File("wn.dict").toURI().toURL());
8987
else init(TextSimilarity.class.getClassLoader().getResource("wn.dict"));

JavaBot/src/agk/chatbot/nlp/OpenNLPAnnotator.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.nio.file.Paths;
2626

2727
import opennlp.tools.namefind.*;
28-
//import opennlp.tools.parser.*;
2928
import opennlp.tools.postag.*;
3029
import opennlp.tools.sentdetect.*;
3130
import opennlp.tools.stemmer.Stemmer;
@@ -47,7 +46,6 @@ public class OpenNLPAnnotator implements BotNLPAnnotator {
4746
private TokenNameFinder locationNER;
4847
private TokenNameFinder organisationNER;
4948
private Stemmer stemmer;
50-
// private Parser parser;
5149
private boolean initialised = false;
5250

5351
/**
@@ -83,9 +81,7 @@ public boolean initAnnotator() {
8381
organisationNER = new NameFinderME(nerModel);
8482

8583
stemmer = new SnowballStemmer(SnowballStemmer.ALGORITHM.ENGLISH);
86-
87-
// ParserModel parserModel = new ParserModel(new FileInputStream("opennlp-models/en-parser-chunking.bin"));
88-
// parser = ParserFactory.create(parserModel);
84+
8985
initialised = true;
9086

9187
System.out.println("Loaded OpenNLP tools");

0 commit comments

Comments
 (0)