Class: Mitier::Extractor
- Inherits:
-
Object
- Object
- Mitier::Extractor
- Defined in:
- lib/mitier/extractor.rb
Defined Under Namespace
Classes: ModelNotLoaded
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ Extractor
constructor
A new instance of Extractor.
- #load ⇒ Object
- #process_ner(text) ⇒ Object
Constructor Details
#initialize(path) ⇒ Extractor
Returns a new instance of Extractor.
7 8 9 |
# File 'lib/mitier/extractor.rb', line 7 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/mitier/extractor.rb', line 3 def path @path end |
Instance Method Details
#load ⇒ Object
11 12 13 14 |
# File 'lib/mitier/extractor.rb', line 11 def load @extractor = Mitier::Wrapper.mitie_load_named_entity_extractor @path self end |
#process_ner(text) ⇒ Object
16 17 18 19 |
# File 'lib/mitier/extractor.rb', line 16 def process_ner(text) raise ModelNotLoaded unless @extractor Ner.new(@extractor, text).process end |