Skip to content

PhD dissertation · Ganpat University · Completing December 2026

Adaptive Sentiment and Interaction Modeling Framework

One model that recognises emotion and sentiment together in English, Hindi and Spanish, built and tested one component at a time, on data whose translation quality is measured. This page is the technical record: the dataset, the architecture, the experiments, the collapses and the open questions.

162,789translated instances, 54,263 per language
27 → 7 → 3emotions, Ekman groups, sentiment classes
13architecture variants trained and compared
2seeds on the headline models
~289Mparameters in the Proposed Architecture
5papers, 4 published, plus a patent application

Questions and contributions

Conversational AI has to understand what people say (sentiment) and how they feel (emotion), often in more than one language. Most published work solves one task, or one language, and reports a single accuracy that hides which part of the model helped. This dissertation builds one multilingual model for both tasks and tests it one component at a time.

Research questionEvidence
RQ1Does the proposed architecture improve multilingual emotion and sentiment recognition overall?Emotion macro-F1 and sentiment macro-F1
RQ2How does each architectural component contribute to multilingual performance?The forward ladder M1 to M6 and leave-one-out ablations
RQ3Can architecture reduce the cross-language gap caused by uneven translation quality?Per-language F1 and the Spanish-to-English gap ratio, a secondary endpoint defined before the experiments

A validated multilingual dataset

Real annotated text, translated, back-translated and scored, retried where weak, and independently rebuilt from the raw annotations. Two comparable public efforts either document no validation at all or use fully synthetic text.

One research programme, not two studies

The translation-quality asymmetry measured while building the data, dropped clauses in Spanish and mistranslated idioms in Hindi, becomes a testable variable in the model study, through the gap ratio.

Evidence-driven architecture

A limitation observed in one stage (serial representation collapse) was measured, the design was changed on that evidence, and the fix was verified, instead of adding layers on principle.

Honest reporting as method

Collapses, instabilities, an implementation gap and a failed hypothesis are documented with the data that exposed them, not smoothed over.

What is not claimed. The components (an XLM-R encoder, a BiLSTM, attention and fusion) are individually well established, and no state-of-the-art claim is made. The contribution is the controlled, evidence-driven way the architecture was built and tested, on data whose quality is measured.

The research arc

The work moved through five recorded stages. Each ended with a decision backed by data, including the two that removed a component the design had started with.

The research arc: a forward ladder of components, the gate retired after it collapsed, leave-one-out ablations, the Global branch retired, and the learning-objective phase that follows Forward ladder M1 to M6, onecomponent per stage Gate retired M6 collapsed to aconstant routing policy Leave-one-out A1 to A5 on thefinal 3-branch model Global retired removing it helped ontwo seeds: Proposed Learning objective next: one change at atime, architecture fixed Every transition is evidence-driven each step is a recorded decision with its data, so the final model is the product of a traceable process, not a hunch
Forward ladder, gate retired, leave-one-out, Global branch retired, then the learning-objective phase.

The data

Emotion datasets are mostly English, and translated data usually carries its errors straight into training. The first contribution is a multilingual GoEmotions in which every translation has a measured quality score.

Building the multilingual dataset: translate GoEmotions, back-translate and score every row, retry weak translations, then verify against the raw annotations GoEmotions English source54,263 rows27 emotions Translate Hindi: IndicTrans2Spanish: NLLB-200 Back-translate each row returns toEnglish Score LaBSE similaritybelow 0.80 is flagged Retry flagged rows re-run;kept only if better Verify rebuilt from rawannotations: exact match No rows are removed after the retry, 5.96% of Hindi and 20.07% of Spanish rows stay flagged as a column, so training on everything can be compared with training on the clean subset
Translate, score, retry, verify. Nothing is deleted, so flagged rows stay available for a controlled comparison.
PropertyDetail
SourceGoEmotions: English Reddit comments labelled by human raters, 27 emotions plus neutral
Splits43,410 train, 5,426 validation and 5,427 test rows per language, matching the official splits
LanguagesEnglish (original), Hindi (IndicTrans2) and Spanish (NLLB-200)
Label hierarchy27 emotions, 7 Ekman groups, and a coarse 3-way sentiment label derived by mapping; labels are copied unchanged through translation
ValidationBack-translation to English and LaBSE similarity, with 0.80 as the flag threshold; flagged rows are retried and the new version is kept only if it scores higher
Still flagged after retry5.96% of Hindi rows and 20.07% of Spanish rows; kept in the data as a column, so training on everything can be compared with training on the clean subset
VerificationThe dataset and its per-category label counts were rebuilt independently from raw rater-level annotations and matched exactly
ImbalanceJoy outnumbers fear 23.4 to 1; class-balanced loss weights are computed once from the English distribution and reused for every language

The architecture

One shared multilingual encoder and sequence model feed parallel branches that look at the sentence in different ways. A fusion bridge combines them, and each task has a head on the same shared representation. The dashed Global branch is the one the evidence later removed.

The dissertation architecture: a shared XLM-RoBERTa encoder and BiLSTM feed parallel branches, a fusion bridge combines them, and two heads predict emotion and sentiment. The Proposed Architecture removes the Global branch. Sentence English, Hindior Spanish XLM-RoBERTa encoderdropout 0.1 BiLSTM shared sequencemodel Global branch BiLSTM average andmax pooling Context branch residualself-attention Token branch token-importanceattention Fusion bridge bridge dropout 0.1 Emotion head 7 labelsmulti-label Sentiment head 3 classes removed in the Proposed Architecture
The 3-branch Final model, and the Proposed Architecture without its Global branch.
ComponentRole
XLM-RoBERTaShared multilingual encoder, with dropout 0.1 on its output in the final designs. The same weights serve all three languages and both tasks.
BiLSTMAdds sequential modelling over the encoder output and is the common input to every branch.
Global branchAverage and max pooling over the BiLSTM sequence. It is part of the 3-branch Final model and removed in the Proposed Architecture.
Context branchResidual self-attention over the whole sentence.
Token branchToken-importance attention that weights the words that carry emotion, fed from the BiLSTM output in parallel, not after the context branch.
Fusion bridgeProjects and combines the parallel branches, with its own dropout of 0.1.
HeadsA multi-label emotion head with binary cross-entropy over 7 classes, and a 3-class sentiment head with cross-entropy. The loss is their sum.

Experimental protocol

One change per stage

Hyperparameters and evaluation are identical at every stage of the ladder, so a difference can only come from the component just added.

Predefined questions

Each stage answers a question written before it was run: what does this component do, not just whether the score rose.

Ablations kept separate

Leave-one-out runs are named and tabulated apart from the forward stages, with a delta from the reference model, so the two designs are never confused.

Four questions per run

Did it train as expected, what are the per-language results, what do the representations show, and is the explanation supported: no epoch-by-epoch cheering.

Representation before score

Similarity and diversity logs are read before the F1 number, so the interpretation is not fitted to the result.

Cautious language

Causal wording is reserved for leave-one-out evidence, and single-seed differences are not called significant.

Training setup

SettingValue
Encoderxlm-roberta-base
OptimiserAdamW, learning rate 2e-5, weight decay 0.01, cosine annealing
Batch size and epochs16, up to 10 epochs
Early stoppingPatience 3 on the combined validation score (2 for the ablations)
SelectionBest epoch by combined validation macro-F1, then one evaluation on the test set
Gradient clippingMax norm 1.0, added after the instability described below
TrackingWeights & Biases, with per-epoch logs, an experiment ledger and kept artefacts

Phase 1: the forward ladder

Start from a plain XLM-R baseline and add one component per stage. Test-set emotion F1 below, seed 42.

  • M1 baseline 0.5133
  • M2 + BiLSTM 0.5180
  • M3 + token attention 0.5190
  • M4 + context attention 0.4988
  • M5 + fusion bridge 0.5062
  • M6 + adaptive gate 0.5087
  • Final 0.5203
  • Proposed 0.5349
Bars start at 0.45, so differences look larger than they are. The Proposed bar is from phase 2.
StageEmotion F1Sentiment F1EnglishHindiSpanishGap ratio
M1 · XLM-R baseline0.51330.68770.55540.51350.46670.8403
M2 · + BiLSTM0.51800.69510.56670.51330.46900.8277
M3 · + token attention0.51900.68830.56260.51910.47180.8386
M4 · + context attention (serial)0.49880.70070.55290.48930.44960.8132
M5 · + fusion bridge (parallel)0.50620.71380.56330.49280.45760.8123
M6 · + adaptive gate0.50870.69350.55860.50280.46080.8249
Final · gate retired0.52030.69470.57010.50740.48180.8452

Per-language columns are test-set emotion F1. The gap ratio is Spanish divided by English, so higher means more consistent across languages. Most stages ran on seed 42 only, and the variance section below says how much weight small differences can bear.

What the representations showed

Scores alone cannot say why a component helped or failed, so the model’s internals were measured.

Serial collapse (M4)

In the trained M4, the context-refined and token-attended representations had cosine similarity 0.9968, while each stayed near 0.89 to the BiLSTM output. Stacking token attention after context attention washed out the selectivity token attention had alone, so two layers did the work of one. The bridge was redesigned with parallel branches, and per-epoch logging showed no collapse afterwards.

Gate collapse (M6)

The adaptive gate learned a constant: weights of 1.0000, 0.0000 and 0.0000 for the BiLSTM, context and token branches in all three languages. Raw logits sat at +10 to +17 against −5 to −11. M6’s score therefore reflects one branch, not adaptive fusion, which the -Context and -Gate ablations confirmed by tying with it.

Token and equity (A1)

Removing the token branch barely moved emotion F1 (−0.0041) but cut the gap ratio by 0.0359, and the two surviving branches separated after projection (similarity 0.0403 to −0.0132). Consistent with the token branch contributing more to cross-lingual equity than to raw accuracy, from one seed.

Why the Global branch hurts

Three hypotheses were tested. Redundancy was not supported. A sentiment bias was not supported, since all three branches probed identically (about +0.10 to +0.11). A prediction that removing the branch would raise the fused effective rank was falsified (3.58 against 3.90). The architecture change was adopted on the replicated causal evidence, and the mechanism is reported as an open question.

Phase 2: leave-one-out

Remove one component at a time from the 3-branch Final model. Seed 42, with the difference from Final.

ModelEmotion F1ΔSentiment F1ΔGap ratioΔ
Final (reference)0.5203—0.6947—0.8452—
A1 · − token branch0.5162−0.00410.7073+0.01260.8093−0.0359
A2 · − context branch (clipped)0.5015−0.01880.7112+0.01650.8277−0.0175
A3 · − global branch (clipped) = Proposed0.5349+0.01460.6838−0.01090.8737+0.0285
A4 · − bridge0.5180−0.00230.6819−0.01280.8196−0.0256
A5 · − dropout0.5158−0.00450.7092+0.01450.8090−0.0362
Final+ · task-specific heads0.4993−0.02100.7018+0.00710.8164−0.0288

Removing the Global branch was the only change that improved emotion F1 and the gap ratio together. It was then checked on a second seed.

The Proposed Architecture on two seeds

ModelEmotion F1, seed 42Seed 43Gap ratio, seed 42Seed 43
Final0.52030.49910.84520.8112
Proposed0.53490.52460.87370.8507

The ranking holds on both seeds. Its size is within the run-to-run variance described below, which is why the finding is stated as a consistent direction, not a precise gain.

Training stability

The symptom

Two ablations (-Context and -Global) collapsed after a healthy first epoch: validation emotion F1 fell to exactly 0.0000 at epoch 2 while training loss rose.

The diagnosis

A faithful reproduction of the training loop, logged step by step, showed gradient-norm spikes above 300 against a typical 7 to 19, even in the ostensibly healthy first epoch.

The root cause

The training script had no gradient clipping anywhere in the project’s history. It was an implementation gap, not a protocol choice.

The decision

Clipping at 1.0 was added as an opt-in flag and applied to the two unstable runs only. The original runs are kept as documented artefacts, and the stable models were not retrained.

The consequence

The Proposed Architecture needs clipping to train at all, so its comparison with the unclipped Final is not a perfectly clean single-variable ablation. That is stated wherever the result is reported.

A second finding

A code review found the M5 stage had a default bridge dropout of 0.1 that no other stage had. It was localised to M5, disclosed, and the final architecture adopted it deliberately.

Variance and reproducibility

Seed-to-seed spread

Emotion F1 moves by roughly 0.01 to 0.02 between seeds: M1 0.5133 and 0.5306, Final 0.5203 and 0.4991, Proposed 0.5349 and 0.5246. That is as large as most single-seed differences on the ladder.

Same seed, different run

A retrain of the Proposed Architecture with identical settings and seed 42 reached 0.5132, not 0.5349, with its best epoch at 4 instead of 6. The cause was not isolated.

The gap ratio swings too

Final varied by 0.0339 and the Proposed Architecture by 0.0229 between seeds, so no single value is a precise constant.

What this means

Read the ladder through the measured collapses and the consistent direction across runs, not through third-decimal differences. Significance testing waits for multi-seed data.

What did not work

IdeaOutcome
Serial attentionCollapsed into near-duplicate representations (cosine 0.9968).
Adaptive gateCollapsed to a constant routing policy; a fixed average performed the same.
Task-specific heads (Final+)Lost to the shared representation on emotion F1 (0.4993 against 0.5203).
Global branchRemoving it improved emotion F1 and the gap ratio on two seeds.
Spanish-only trainingBecame unstable at epoch 3; the preliminary epochs were kept, not retracted.

Limits and threats to validity

Machine-translated text

Hindi and Spanish are translations, not naturally written language, so they do not represent how native speakers express emotion online. Their test sets are translations too.

Flagged rows

20.07% of Spanish and 5.96% of Hindi rows still score below the similarity threshold after retry. The similarity score favours longer sentences, so it is a triage signal and not an error measure.

Few seeds

Most ladder stages and every ablation ran on one seed, and the headline models on two. Differences within the measured variance are not claims.

A clipping confound

The Proposed Architecture trains with gradient clipping and the Final model without.

An open mechanism

Why removing the Global branch helps is not explained. Three hypotheses were tested and none survived.

No state-of-the-art claim

Comparison with published numbers is limited by different data, languages and metrics.

What comes next

The architecture is now fixed. The next phase changes the learning objective around it, one variable at a time, so that any change in F1 can be attributed to a single named intervention. The leave-one-out ablations will also be re-run against the Proposed Architecture, and multi-seed statistics will follow.

  1. 01
    Uncertainty-weighted loss

    Learn a log-variance per task so the model sets the emotion and sentiment weighting itself, aimed at the trade-off seen at M2, M4 and M6.

  2. 02
    Label smoothing

    Tested separately for the two heads. The multi-label emotion head has no built-in option, so targets are transformed by hand.

  3. 03
    Layer-wise learning-rate decay

    A tiny rate on the pretrained encoder and a larger one on the new layers.

  4. 04
    Head LayerNorm

    Bare normalisation before classification, with no added capacity, which is a different question from the failed task-specific heads.

  5. 05
    Temperature calibration

    Post-hoc, as a reliability experiment: two models gave 99.4% and 88% confidence on the same sentence with the same prediction.

  6. 06
    GradNorm

    Last, and only if step 1 helps, to test whether competing task gradients cause the trade-off.

Publications

Five papers, four published. Together they form one line of work: foundations in chatbot memory and a first framework, a pilot model, and the two papers that carry the dissertation’s data and framework.

  • 2026 Dissertation · data Under peer review

    Translating Emotions at Scale: A Validated Multilingual Extension of GoEmotions

    Mihir Raval, Saurabh A. Dave, Kashyap C. Patel, Sachinkumar Anandpal Goswami

    International Journal of Computer Applications (IJCA)

    The validated Hindi and Spanish GoEmotions that every dissertation experiment trains and tests on.

  • 2025 Pilot model Published

    A Hierarchical Attention–Gated Framework for Joint Emotion and Sentiment Modeling

    Mihir Raval

    Computer Research and Development (ISSN 1000-1239), Vol. 25, Issue 10

    The earlier single-model study. A failure mode found there motivated the data validation and the controlled ablation method of the dissertation.

    Cite this paper
    @article{raval2025hierarchical,
      title   = {A Hierarchical Attention–Gated Framework for Joint Emotion and Sentiment Modeling},
      author  = {Raval, Mihir},
      journal = {Computer Research and Development},
      year    = {2025},
      volume  = {25},
      number  = {10},
      pages   = {276--297},
      issn    = {1000-1239},
      doi     = {10.5281/zenodo.17610460},
    }
  • 2025 Dissertation · framework Published

    Development of an Adaptive Sentiment and Interaction Modeling Framework: A Methodological Approach for Multilingual Conversational AI

    Mihir Rawal, Saurabh Dave, Kashyap C. Patel, Sachinkumar Anandpal Goswami

    Journal of Scholastic Engineering Science and Management (JSESM)

    The methodological framework behind the dissertation's model chapters: multilingual encoding with adaptive learning.

    Cite this paper
    @article{rawal2025development,
      title   = {Development of an Adaptive Sentiment and Interaction Modeling Framework: A Methodological Approach for Multilingual Conversational AI},
      author  = {Rawal, Mihir and Dave, Saurabh and Patel, Kashyap C. and Goswami, Sachinkumar Anandpal},
      journal = {Journal of Scholastic Engineering Science and Management},
      year    = {2025},
      volume  = {4},
      number  = {7},
      pages   = {1--19},
      issn    = {2583-3294},
      doi     = {10.5281/zenodo.15834538},
    }
  • 2024 Foundations Published

    Enhancing User Experiences: Memory Retention and Recall in AI Chatbots

    Mihir Raval, Saurabh Dave, Kashyap C. Patel, Sachin Anandpal Goswami

    Computer Research and Development (ISSN 1000-1239), Vol. 24, Issue 7

    Earlier chatbot work on short-term memory, long-term storage and attention-based recall.

    Cite this paper
    @article{raval2024enhancing,
      title   = {Enhancing User Experiences: Memory Retention and Recall in AI Chatbots},
      author  = {Raval, Mihir and Dave, Saurabh and Patel, Kashyap C. and Goswami, Sachin Anandpal},
      journal = {Computer Research and Development},
      year    = {2024},
      volume  = {24},
      number  = {7},
      pages   = {490--496},
      issn    = {1000-1239},
    }
  • 2024 Foundations Published

    Developing a Custom Machine Learning Model with Sentiment Analysis for Enhanced Conversational Agents

    Mihir Raval, Saurabh Dave, Kashyap C. Patel, Sachin Anandpal Goswami

    Computer Research and Development (ISSN 1000-1239), Vol. 24, Issue 12

    Introduces the Adaptive Sentiment and Interaction Modeling Framework as a six-phase plan, the starting point of the dissertation.

    Cite this paper
    @article{raval2024developing,
      title   = {Developing a Custom Machine Learning Model with Sentiment Analysis for Enhanced Conversational Agents},
      author  = {Raval, Mihir and Dave, Saurabh and Patel, Kashyap C. and Goswami, Sachin Anandpal},
      journal = {Computer Research and Development},
      year    = {2024},
      volume  = {24},
      number  = {12},
      pages   = {123--151},
      issn    = {1000-1239},
    }

Papers are shown with the authors as printed in each one. The surname appears as both Raval and Rawal across the published record, so searching under either spelling finds the work.

Patent

Designing Data Integration Model for Data Resource System, an Indian patent application with nine named inventors, published on 17 January 2025: ontology-based mapping, metadata, unified query processing and a blockchain-backed security layer for integrating heterogeneous data sources.

Application no.202421098837 A
Filed13 December 2024
Published17 January 2025
Claims8, over 21 pages
RoleCo-inventor (NLP), one of nine

Read the technical summary of the patent