Class: Stealth::ServiceMessage
- Inherits:
-
Object
- Object
- Stealth::ServiceMessage
- Defined in:
- lib/stealth-aws-comprehend/nlp.rb
Instance Method Summary collapse
- #entities ⇒ Object
- #key_phrases ⇒ Object
- #language ⇒ Object
- #sentiment ⇒ Object
- #sentiment_score ⇒ Object
Instance Method Details
#entities ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/stealth-aws-comprehend/nlp.rb', line 14 def entities @entities ||= begin if .present? Stealth::AwsComprehend.detect_entities( message: ) end end end |
#key_phrases ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/stealth-aws-comprehend/nlp.rb', line 24 def key_phrases @key_phrases ||= begin if .present? Stealth::AwsComprehend.detect_key_phrases( message: ) end end end |
#language ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/stealth-aws-comprehend/nlp.rb', line 4 def language @language ||= begin if .present? Stealth::AwsComprehend.detect_dominate_language( message: ) end end end |
#sentiment ⇒ Object
38 39 40 |
# File 'lib/stealth-aws-comprehend/nlp.rb', line 38 def sentiment get_sentiment.sentiment end |
#sentiment_score ⇒ Object
34 35 36 |
# File 'lib/stealth-aws-comprehend/nlp.rb', line 34 def sentiment_score get_sentiment.sentiment_score end |