Class: MemoriClient::Engine::V2::NLP
- Defined in:
- lib/memori_client/engine/v2/nlp.rb
Overview
Generated on 2025-01-27 16:56:16 +0000
Class Method Summary collapse
-
.check_nsfw(strSessionID:, payload: {}) ⇒ Object
‘POST /memori/v2/CheckNSFW/strSessionID`.
-
.check_undefined_words(strSessionID:, payload: {}) ⇒ Object
‘POST /memori/v2/CheckWords/strSessionID`.
-
.compute_sentences_similarity(strSessionID:, payload: {}) ⇒ Object
‘POST /memori/v2/ComputeSimilarity/strSessionID`.
-
.get_similar_words(strSessionID:, word:) ⇒ Object
‘GET /memori/v2/SimilarWords/strSessionID/word`.
-
.get_word_vector(strSessionID:, word:) ⇒ Object
‘GET /memori/v2/WordVector/strSessionID/word`.
-
.guess_language(strSessionID:, payload: {}) ⇒ Object
‘POST /memori/v2/GuessLanguage/strSessionID`.
Methods inherited from Resource
Methods inherited from Resource
build_arguments, build_url, exec_http_request, validate_payload!
Class Method Details
.check_nsfw(strSessionID:, payload: {}) ⇒ Object
‘POST /memori/v2/CheckNSFW/strSessionID`
Checks a sentence for NSFW content.
‘check_nsfw(strSessionID:, payload: {})`
125 126 127 128 129 130 131 132 133 134 |
# File 'lib/memori_client/engine/v2/nlp.rb', line 125 def self.check_nsfw(strSessionID:, payload: {}) args = build_arguments(binding) payload_keys = [ 'text', ] payload_required_keys = %w[] validate_payload!(args[:payload], keys: payload_keys, required: payload_required_keys) exec_http_request('post', '/memori/v2/CheckNSFW/{strSessionID}', **args) end |
.check_undefined_words(strSessionID:, payload: {}) ⇒ Object
‘POST /memori/v2/CheckWords/strSessionID`
Checks the words of a sentence for their definition in the word vector dictionary.
‘check_undefined_words(strSessionID:, payload: {})`
102 103 104 105 106 107 108 109 110 111 |
# File 'lib/memori_client/engine/v2/nlp.rb', line 102 def self.check_undefined_words(strSessionID:, payload: {}) args = build_arguments(binding) payload_keys = [ 'text', ] payload_required_keys = %w[] validate_payload!(args[:payload], keys: payload_keys, required: payload_required_keys) exec_http_request('post', '/memori/v2/CheckWords/{strSessionID}', **args) end |
.compute_sentences_similarity(strSessionID:, payload: {}) ⇒ Object
‘POST /memori/v2/ComputeSimilarity/strSessionID`
Computes the similarity between a reference and a comparison sentences.
‘compute_sentences_similarity(strSessionID:, payload: {})`
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/memori_client/engine/v2/nlp.rb', line 76 def self.compute_sentences_similarity(strSessionID:, payload: {}) args = build_arguments(binding) payload_keys = [ 'comparisonText', 'comparisonTextType', 'referenceText', 'referenceTextType', ] payload_required_keys = %w[] validate_payload!(args[:payload], keys: payload_keys, required: payload_required_keys) exec_http_request('post', '/memori/v2/ComputeSimilarity/{strSessionID}', **args) end |
.get_similar_words(strSessionID:, word:) ⇒ Object
‘GET /memori/v2/SimilarWords/strSessionID/word`
Searches for the 10 words most semantically similar words to the specified word.
‘get_similar_words(strSessionID:, word:)`
29 30 31 32 33 |
# File 'lib/memori_client/engine/v2/nlp.rb', line 29 def self.get_similar_words(strSessionID:, word:) args = build_arguments(binding) exec_http_request('get', '/memori/v2/SimilarWords/{strSessionID}/{word}', **args) end |
.get_word_vector(strSessionID:, word:) ⇒ Object
‘GET /memori/v2/WordVector/strSessionID/word`
Looks up the vector definition for a word.
‘get_word_vector(strSessionID:, word:)`
13 14 15 16 17 |
# File 'lib/memori_client/engine/v2/nlp.rb', line 13 def self.get_word_vector(strSessionID:, word:) args = build_arguments(binding) exec_http_request('get', '/memori/v2/WordVector/{strSessionID}/{word}', **args) end |
.guess_language(strSessionID:, payload: {}) ⇒ Object
‘POST /memori/v2/GuessLanguage/strSessionID`
Tries to guess the language of a sentence by analyzing keyword occurrences.
‘guess_language(strSessionID:, payload: {})`
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/memori_client/engine/v2/nlp.rb', line 47 def self.guess_language(strSessionID:, payload: {}) args = build_arguments(binding) payload_keys = [ 'text', ] payload_required_keys = %w[] validate_payload!(args[:payload], keys: payload_keys, required: payload_required_keys) exec_http_request('post', '/memori/v2/GuessLanguage/{strSessionID}', **args) end |