Encrypted Sentiment Classification

L5 · Privacy-Preserving Applications
sentiment · 1 specification · 0 implementations · no benchmarks yet
WHAT IT ISClassify the sentiment of an encrypted feature vector under CKKS.
CKKS
SIGNATURE
kernel sentiment<N: u32>(
%features: secret<tensor<N x f64>>,
) -> %score: secret<f64>
Sizes and element types are left open here. A specification fixes them; an implementation says over which of them it works.
DESCRIPTION

Definition

Sentiment classification is the task of deciding the sentiment expressed by a piece of text — for example positive versus negative. In the encrypted setting the text is represented as a secret feature vector and the model runs homomorphically: nothing is decrypted between the encrypted input and the encrypted output.

Given an encrypted feature vector xRNx \in \mathbb{R}^N, a fixed model ff is evaluated on the ciphertext to produce a score

s=f(x)R,s = f(x) \in \mathbb{R},

and the predicted sentiment is obtained by thresholding the score,

y^=[s>τ]\hat{y} = [\, s > \tau \,]

for a decision threshold τ\tau fixed by the specification.

Context

The operation is defined over real-valued data encrypted under an approximate homomorphic scheme (CKKS). The model ff is a fixed function from an NN-dimensional feature vector to a single real score; it is applied to the ciphertext without access to the plaintext input. What varies between specifications is the scheme and its parameters, the feature representation and its length, the decision threshold, the dataset, and the model itself.

The kernel states only the input/output contract and the classification semantics. It does not fix a feature-extraction pipeline, a model architecture, an approximation strategy, or accuracy figures — those are properties of a specification and of the submitted solution.

Composition

This is an end-to-end application kernel (abstraction level "applications"), not a primitive. A solution is built by composing lower-level component kernels of the catalogue, for example:

  • matrix multiplication or a dot product for the linear part of the model;
  • activation approximations — such as logistic or sign — evaluated as polynomials on ciphertext to produce and shape the score.

The application defines the outer contract (encrypted features in, encrypted score out); the component kernels supply the arithmetic underneath.

Parameters Defined by Specifications

A specification pins the general task down to a concrete problem by fixing:

  • the encryption scheme and its parameters (here CKKS);
  • the feature representation and its length NN;
  • the decision threshold that turns the score into a class;
  • the dataset and its labelling;
  • the correctness metric (classification accuracy against plaintext labels);
  • what is secret and what is fixed/public (the input versus the model).

Applications

Encrypted sentiment classification supports private text analytics: gauging opinion in social-media posts, reviews, or messages without revealing the text to the model holder, and without the text owner obtaining the model. It is a representative case of running a trained classifier on confidential inputs.

MAINTAINER
FM
fairmathreviews specifications · resolves disputes
USED BY · 0 KERNELS
Kernels above this one. If this kernel is wrong, or slow, they are wrong or slow with it.Nothing depends on this kernel yet.
BUILDS ON · 0 KERNELS
Kernels this one is stated in terms of. Not a call graph — a statement of dependence between problems.Nothing. This kernel sits at the bottom of the graph.
RECENT ACTIVITYNothing yet.