Skip to content

Sentiment

Introduction

The goal of sentiment analysis is to automatically classify text data as positive, negative, or neutral based on the underlying sentiment expressed in the text.

To achieve this Lettria analyzes various linguistic features of the text, such as word choice, syntax, and sentiment-laden words or phrases.

These features are then fed into an algorithm, such as a machine learning model, which is trained to recognize patterns and trends in the data that are indicative of sentiment.

One approach to text sentiment analysis combines the strengths of rule-based algorithms that you can set up as part of your solution on the Lettria platform, with machine learning algorithms that are pre-trained, as well as a solution that is built on the platform with your own data and annotations.

This helps improve the accuracy and efficiency of the sentiment analysis process, as well as reduce the need for manual labeling or annotation of data.

Sentiment Format

KeyTypeDescription
subsentencesSubsentence Sentiment [ ]Subsentences Sentiment
elementsSentiment Element [ ]Sentiment Elements
valuesValuesValues

Subsentence Sentiment

Subsentence Sentiment Format

KeyTypeDescription
start_idNumberStart ID
end_idNumberEnd ID
elementsElement [ ]Elements
sentenceStringSentence
valuesValuesValues

Subsentence Sentiment Example

{
  "start_id": 0,
  "end_id": 2,
  "elements": [
    {
      "target": null,
      "subject": {
        "lemma": "Victor",
        "source": "Victor",
        "index": 0
      },
      "value": 0.27,
      "source": { "index": 1, "lemma": "etre", "source": "est" }
    }
  ],
  "sentence": "Victor est la",
  "values" : { "positive": 0.454, "negative": 0, "total": 0.454 }
}

Sentiment Element

Sentiment Element Format

KeyTypeDescription
targetTargetTarget
subjectSubjectSubject
valueNumberValue
sourceSourceSource

Sentiment Element Example

{
	"target": null,
	"subject": { "lemma": "Victor", "source": "Victor", "index": 0 },
	"value": 0.27,
	"source": { "index": 1, "lemma": "etre", "source": "est" }
}

Values

Values Format

KeyTypeDescription
positiveNumberPositive
negativeNumberNegative
totalNumberTotal

Values Example

{ "positive": 0.27, "negative": 0, "total": 0.27 }

Target

Target Format

KeyTypeDescription
indexNumberIndex
lemmaStringLemma
sourceStringSource

Target Example

{ "lemma": "immeuble", "source": "immeubles", "index": 6 }

Subject

Subject Format

KeyTypeDescription
indexNumberIndex
lemmaStringLemma
sourceStringSource

Subject Example

{ "lemma": "Victor", "source": "Victor", "index": 0 }

Next steps