NLP Data Structures

In order to help developers formalize responses to NLP Queries, quotek provides a set of structures to store the data.

struct quotek::nlp::sentiment

Public Members

float score

stores the computed sentiment score.

std::string sentimentstr

Stores whether the computed sentiment is felt overall as positive, negative or neutral. so data stored in here can be “positive”, “negative” or “neutral”

bool mixed

Stores whether the sentiment is felt as mixed or not. If sentiment is mixed, you should take the result carefully.

bool error

Tells if sentiment analysis failed or not

std::string error_message

Stores the analysis error message in case of failure

struct quotek::nlp::relation

Relation structures contain results of machine learning relationship algorithms, which mainly allow to guess “Who does what”. This is a trivial form of summerizing which allows machine processing of complex texts.

Public Members

std::string subject

Tells who/what is the subject of the sentence.

quotek::nlp::action action

Tells what and kind of action is performed in sentence.

std::string object

Tells on what/who the action is performed.

std::string sentence

Initial sentence, extracted from text.

struct quotek::nlp::action

action struct is meant to store detected action for a sentence. Action is composed of 3 components, text (verb) , tense, and negated (if verb is used in its negative form).

Public Members

std::string text

stores the verb.

std::string tense

stores the verb tense.

bool negated

tells if verb is used in negative form.