Class: Decidim::Ai::SpamDetection::Strategy::Base

Inherits:
Object
  • Object
show all
Defined in:
decidim-ai/lib/decidim/ai/spam_detection/strategy/base.rb

Direct Known Subclasses

Bayes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



10
11
12
13
# File 'decidim-ai/lib/decidim/ai/spam_detection/strategy/base.rb', line 10

def initialize(options = {})
  @name = options.delete(:name)
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'decidim-ai/lib/decidim/ai/spam_detection/strategy/base.rb', line 8

def name
  @name
end

Instance Method Details

#classify(_content) ⇒ Object



15
# File 'decidim-ai/lib/decidim/ai/spam_detection/strategy/base.rb', line 15

def classify(_content); end

#logObject



21
# File 'decidim-ai/lib/decidim/ai/spam_detection/strategy/base.rb', line 21

def log; end

#scoreObject



23
# File 'decidim-ai/lib/decidim/ai/spam_detection/strategy/base.rb', line 23

def score = 0.0

#train(_classification, _content) ⇒ Object



17
# File 'decidim-ai/lib/decidim/ai/spam_detection/strategy/base.rb', line 17

def train(_classification, _content); end

#untrain(_classification, _content) ⇒ Object



19
# File 'decidim-ai/lib/decidim/ai/spam_detection/strategy/base.rb', line 19

def untrain(_classification, _content); end