Class: Quarry::TextPipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/quarry_rb/text_pipeline.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tp = nil) ⇒ TextPipeline

Returns a new instance of TextPipeline.



4
5
6
# File 'lib/quarry_rb/text_pipeline.rb', line 4

def initialize(tp = nil)
  @text_pipeline = tp || Quarry::ImplTextPipeline.new
end

Instance Attribute Details

#text_pipelineObject (readonly)

Returns the value of attribute text_pipeline.



3
4
5
# File 'lib/quarry_rb/text_pipeline.rb', line 3

def text_pipeline
  @text_pipeline
end

Class Method Details

.standard_pipelineObject



12
13
14
# File 'lib/quarry_rb/text_pipeline.rb', line 12

def self.standard_pipeline
  new(Quarry::Preprocessing::Text.standard_pipeline)
end

Instance Method Details

#process_text(data_set, text, create_features = false) ⇒ Object



8
9
10
# File 'lib/quarry_rb/text_pipeline.rb', line 8

def process_text(data_set, text, create_features = false)
  ::Quarry::DataSet::Example.new(@text_pipeline.process_text(data_set.data_set, text, create_features))
end