Class: NerRuby::Configuration
- Inherits:
-
Object
- Object
- NerRuby::Configuration
- Defined in:
- lib/ner_ruby/configuration.rb
Instance Attribute Summary collapse
-
#batch_size ⇒ Object
Returns the value of attribute batch_size.
-
#default_labels ⇒ Object
Returns the value of attribute default_labels.
-
#default_model_path ⇒ Object
Returns the value of attribute default_model_path.
-
#default_tokenizer_path ⇒ Object
Returns the value of attribute default_tokenizer_path.
-
#enable_cache ⇒ Object
Returns the value of attribute enable_cache.
-
#max_length ⇒ Object
Returns the value of attribute max_length.
-
#merge_adjacent ⇒ Object
Returns the value of attribute merge_adjacent.
-
#min_score ⇒ Object
Returns the value of attribute min_score.
-
#min_scores_per_type ⇒ Object
Returns the value of attribute min_scores_per_type.
-
#stride ⇒ Object
Returns the value of attribute stride.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #model_registry ⇒ Object
- #register_model(name, **opts) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ner_ruby/configuration.rb', line 10 def initialize @default_model_path = nil @default_tokenizer_path = nil @default_labels = nil @min_score = 0.5 @batch_size = 32 @min_scores_per_type = {} @enable_cache = true @max_length = 512 @stride = 128 @merge_adjacent = true end |
Instance Attribute Details
#batch_size ⇒ Object
Returns the value of attribute batch_size.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def batch_size @batch_size end |
#default_labels ⇒ Object
Returns the value of attribute default_labels.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def default_labels @default_labels end |
#default_model_path ⇒ Object
Returns the value of attribute default_model_path.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def default_model_path @default_model_path end |
#default_tokenizer_path ⇒ Object
Returns the value of attribute default_tokenizer_path.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def default_tokenizer_path @default_tokenizer_path end |
#enable_cache ⇒ Object
Returns the value of attribute enable_cache.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def enable_cache @enable_cache end |
#max_length ⇒ Object
Returns the value of attribute max_length.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def max_length @max_length end |
#merge_adjacent ⇒ Object
Returns the value of attribute merge_adjacent.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def merge_adjacent @merge_adjacent end |
#min_score ⇒ Object
Returns the value of attribute min_score.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def min_score @min_score end |
#min_scores_per_type ⇒ Object
Returns the value of attribute min_scores_per_type.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def min_scores_per_type @min_scores_per_type end |
#stride ⇒ Object
Returns the value of attribute stride.
5 6 7 |
# File 'lib/ner_ruby/configuration.rb', line 5 def stride @stride end |
Instance Method Details
#model_registry ⇒ Object
23 24 25 |
# File 'lib/ner_ruby/configuration.rb', line 23 def model_registry @model_registry ||= ModelRegistry.new end |
#register_model(name, **opts) ⇒ Object
27 28 29 |
# File 'lib/ner_ruby/configuration.rb', line 27 def register_model(name, **opts) model_registry.register(name, **opts) end |