module Nabatheon
Constants
- BASE_DEP_PATH
- Entity
- Pipeline
- VERSION
Public Class Methods
annotate(text)
click to toggle source
# File lib/nabatheon.rb, line 16 def self.annotate(text) annotated_text = StanfordCoreNLP::Annotation.new(text) Pipeline.annotate(annotated_text) tagged = [] annotated_text.get(:sentences).each do |sentence| sentence.get(:tokens).each do |token| entity_tag = token.get(:named_entity_tag).to_s lemma = token.get(:lemma).to_s tagged << { named_entity: entity_tag, type: lemma } end end tagged end
relevant_searches_for(annotations)
click to toggle source
# File lib/nabatheon.rb, line 31 def self.relevant_searches_for(annotations) Rule.apply_on(annotations) end