Class: Stealth::Nlp::Result
- Inherits:
-
Object
- Object
- Stealth::Nlp::Result
- Defined in:
- lib/stealth/nlp/result.rb
Constant Summary collapse
- ENTITY_TYPES =
%i(number currency email percentage phone age url ordinal geo dimension temp datetime duration key_phrase name)
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #entities ⇒ Object
-
#initialize(result:) ⇒ Result
constructor
A new instance of Result.
- #intent ⇒ Object
- #intent_id ⇒ Object
- #intent_score ⇒ Object
- #parsed_result ⇒ Object
- #present? ⇒ Boolean
- #raw_entities ⇒ Object
-
#sentiment ⇒ Object
:postive, :negative, :neutral.
- #sentiment_score ⇒ Object
Constructor Details
#initialize(result:) ⇒ Result
Returns a new instance of Result.
14 15 16 |
# File 'lib/stealth/nlp/result.rb', line 14 def initialize(result:) @result = result end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
12 13 14 |
# File 'lib/stealth/nlp/result.rb', line 12 def result @result end |
Instance Method Details
#entities ⇒ Object
38 39 40 |
# File 'lib/stealth/nlp/result.rb', line 38 def entities {} end |
#intent ⇒ Object
26 27 28 |
# File 'lib/stealth/nlp/result.rb', line 26 def intent nil end |
#intent_id ⇒ Object
22 23 24 |
# File 'lib/stealth/nlp/result.rb', line 22 def intent_id nil end |
#intent_score ⇒ Object
30 31 32 |
# File 'lib/stealth/nlp/result.rb', line 30 def intent_score nil end |
#parsed_result ⇒ Object
18 19 20 |
# File 'lib/stealth/nlp/result.rb', line 18 def parsed_result nil end |
#present? ⇒ Boolean
51 52 53 |
# File 'lib/stealth/nlp/result.rb', line 51 def present? parsed_result.present? end |
#raw_entities ⇒ Object
34 35 36 |
# File 'lib/stealth/nlp/result.rb', line 34 def raw_entities {} end |
#sentiment ⇒ Object
:postive, :negative, :neutral
43 44 45 |
# File 'lib/stealth/nlp/result.rb', line 43 def sentiment nil end |
#sentiment_score ⇒ Object
47 48 49 |
# File 'lib/stealth/nlp/result.rb', line 47 def sentiment_score nil end |