Permalink
Browse files

If there is at least one NE model or a chunker, use the OpenNLP spotter:

  • Loading branch information...
jodaiber committed Apr 6, 2013
1 parent 36a6881 commit 8c26d2b14883a9484b68b25ec219a17edf9231f7
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/src/main/scala/org/dbpedia/spotlight/db/SpotlightModel.scala
@@ -96,7 +96,8 @@ object SpotlightModel {
new GenerativeContextSimilarity(tokenTypeStore)
))
- val spotter = if(new File(modelFolder, "opennlp/pos-maxent.bin").exists()) {
+ //If there is at least one NE model or a chunker, use the OpenNLP spotter:
+ val spotter = if( new File(modelFolder, "opennlp").exists() && new File(modelFolder, "opennlp").list().exists(f => f.startsWith("ner-") || f.startsWith("chunker")) ) {
val nerModels = new File(modelFolder, "opennlp").list().filter(_.startsWith("ner-")).map { f: String =>
new TokenNameFinderModel(new FileInputStream(new File(new File(modelFolder, "opennlp"), f)))
}.toList

0 comments on commit 8c26d2b

Please sign in to comment.