Class: Decidim::Ai::SpamDetection::Resource::UserBaseEntity
- Inherits:
-
Base
- Object
- Base
- Decidim::Ai::SpamDetection::Resource::UserBaseEntity
show all
- Defined in:
- decidim-ai/lib/decidim/ai/spam_detection/resource/user_base_entity.rb
Instance Method Summary
collapse
Methods inherited from Base
#batch_train
#attachment?, #default_locale?
Instance Method Details
#fields ⇒ Object
8
|
# File 'decidim-ai/lib/decidim/ai/spam_detection/resource/user_base_entity.rb', line 8
def fields = [:about]
|
#train(category, text) ⇒ Object
10
11
12
13
14
|
# File 'decidim-ai/lib/decidim/ai/spam_detection/resource/user_base_entity.rb', line 10
def train(category, text)
raise error_message("Decidim::Ai::SpamDetection.user_detection_service", __method__) unless classifier.respond_to?(:train)
classifier.train(category, text)
end
|
#untrain(category, text) ⇒ Object
16
17
18
19
20
|
# File 'decidim-ai/lib/decidim/ai/spam_detection/resource/user_base_entity.rb', line 16
def untrain(category, text)
raise error_message("Decidim::Ai::SpamDetection.user_detection_service", __method__) unless classifier.respond_to?(:untrain)
classifier.untrain(category, text)
end
|