Skip to content

Commit

Permalink
Remove debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Drew Kerrigan committed Nov 6, 2019
1 parent 42109af commit dd81d11
Showing 1 changed file with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,27 @@ public Map<String, List<String>> extractEntities(String text, String entityTypes
}

CoreDocument document = annotateDocument(text);
try {
List<CoreEntityMention> mentions = document.entityMentions();
if (document.entityMentions() == null) {
mentions = new ArrayList<CoreEntityMention>();
}

for (CoreEntityMention entityMention : mentions) {
String eType = entityMention.entityType();
if (extractLocations && locationNerTagList.contains(eType)) {
List<String> locs = output.get("location");
locs.add(entityMention.text());
output.put("location", locs);
continue;
}
if (nerTagList.contains(eType)) {
List<String> e = output.get(eType.toLowerCase());
e.add(entityMention.text());
output.put(eType.toLowerCase(), e);
}
}
List<CoreEntityMention> mentions = document.entityMentions();
if (document.entityMentions() == null) {
mentions = new ArrayList<CoreEntityMention>();
}

return output;
} catch (Exception e) {
System.out.println("Exception while finding mentions: " + e);
for (CoreEntityMention entityMention : mentions) {
String eType = entityMention.entityType();
if (extractLocations && locationNerTagList.contains(eType)) {
List<String> locs = output.get("location");
locs.add(entityMention.text());
output.put("location", locs);
continue;
}
if (nerTagList.contains(eType)) {
List<String> e = output.get(eType.toLowerCase());
e.add(entityMention.text());
output.put(eType.toLowerCase(), e);
}
}

return output;
}

Expand Down

0 comments on commit dd81d11

Please sign in to comment.