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.
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 question | Evidence | |
|---|---|---|
RQ1 | Does the proposed architecture improve multilingual emotion and sentiment recognition overall? | Emotion macro-F1 and sentiment macro-F1 |
RQ2 | How does each architectural component contribute to multilingual performance? | The forward ladder M1 to M6 and leave-one-out ablations |
RQ3 | Can 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 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.
| Property | Detail |
|---|---|
| Source | GoEmotions: English Reddit comments labelled by human raters, 27 emotions plus neutral |
| Splits | 43,410 train, 5,426 validation and 5,427 test rows per language, matching the official splits |
| Languages | English (original), Hindi (IndicTrans2) and Spanish (NLLB-200) |
| Label hierarchy | 27 emotions, 7 Ekman groups, and a coarse 3-way sentiment label derived by mapping; labels are copied unchanged through translation |
| Validation | Back-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 retry | 5.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 |
| Verification | The dataset and its per-category label counts were rebuilt independently from raw rater-level annotations and matched exactly |
| Imbalance | Joy 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.
| Component | Role |
|---|---|
| XLM-RoBERTa | Shared multilingual encoder, with dropout 0.1 on its output in the final designs. The same weights serve all three languages and both tasks. |
| BiLSTM | Adds sequential modelling over the encoder output and is the common input to every branch. |
| Global branch | Average and max pooling over the BiLSTM sequence. It is part of the 3-branch Final model and removed in the Proposed Architecture. |
| Context branch | Residual self-attention over the whole sentence. |
| Token branch | Token-importance attention that weights the words that carry emotion, fed from the BiLSTM output in parallel, not after the context branch. |
| Fusion bridge | Projects and combines the parallel branches, with its own dropout of 0.1. |
| Heads | A 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
| Setting | Value |
|---|---|
| Encoder | xlm-roberta-base |
| Optimiser | AdamW, learning rate 2e-5, weight decay 0.01, cosine annealing |
| Batch size and epochs | 16, up to 10 epochs |
| Early stopping | Patience 3 on the combined validation score (2 for the ablations) |
| Selection | Best epoch by combined validation macro-F1, then one evaluation on the test set |
| Gradient clipping | Max norm 1.0, added after the instability described below |
| Tracking | Weights & 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
| Stage | Emotion F1 | Sentiment F1 | English | Hindi | Spanish | Gap ratio |
|---|---|---|---|---|---|---|
| M1 · XLM-R baseline | 0.5133 | 0.6877 | 0.5554 | 0.5135 | 0.4667 | 0.8403 |
| M2 · + BiLSTM | 0.5180 | 0.6951 | 0.5667 | 0.5133 | 0.4690 | 0.8277 |
| M3 · + token attention | 0.5190 | 0.6883 | 0.5626 | 0.5191 | 0.4718 | 0.8386 |
| M4 · + context attention (serial) | 0.4988 | 0.7007 | 0.5529 | 0.4893 | 0.4496 | 0.8132 |
| M5 · + fusion bridge (parallel) | 0.5062 | 0.7138 | 0.5633 | 0.4928 | 0.4576 | 0.8123 |
| M6 · + adaptive gate | 0.5087 | 0.6935 | 0.5586 | 0.5028 | 0.4608 | 0.8249 |
| Final · gate retired | 0.5203 | 0.6947 | 0.5701 | 0.5074 | 0.4818 | 0.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.
| Model | Emotion F1 | Δ | Sentiment F1 | Δ | Gap ratio | Δ |
|---|---|---|---|---|---|---|
| Final (reference) | 0.5203 | — | 0.6947 | — | 0.8452 | — |
| A1 · − token branch | 0.5162 | −0.0041 | 0.7073 | +0.0126 | 0.8093 | −0.0359 |
| A2 · − context branch (clipped) | 0.5015 | −0.0188 | 0.7112 | +0.0165 | 0.8277 | −0.0175 |
| A3 · − global branch (clipped) = Proposed | 0.5349 | +0.0146 | 0.6838 | −0.0109 | 0.8737 | +0.0285 |
| A4 · − bridge | 0.5180 | −0.0023 | 0.6819 | −0.0128 | 0.8196 | −0.0256 |
| A5 · − dropout | 0.5158 | −0.0045 | 0.7092 | +0.0145 | 0.8090 | −0.0362 |
| Final+ · task-specific heads | 0.4993 | −0.0210 | 0.7018 | +0.0071 | 0.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
| Model | Emotion F1, seed 42 | Seed 43 | Gap ratio, seed 42 | Seed 43 |
|---|---|---|---|---|
| Final | 0.5203 | 0.4991 | 0.8452 | 0.8112 |
| Proposed | 0.5349 | 0.5246 | 0.8737 | 0.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
| Idea | Outcome |
|---|---|
| Serial attention | Collapsed into near-duplicate representations (cosine 0.9968). |
| Adaptive gate | Collapsed 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 branch | Removing it improved emotion F1 and the gap ratio on two seeds. |
| Spanish-only training | Became 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.
- 01Uncertainty-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.
- 02Label smoothing
Tested separately for the two heads. The multi-label emotion head has no built-in option, so targets are transformed by hand.
- 03Layer-wise learning-rate decay
A tiny rate on the pretrained encoder and a larger one on the new layers.
- 04Head LayerNorm
Bare normalisation before classification, with no added capacity, which is a different question from the failed task-specific heads.
- 05Temperature calibration
Post-hoc, as a reliability experiment: two models gave 99.4% and 88% confidence on the same sentence with the same prediction.
- 06GradNorm
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
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
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
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
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
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 |
| Filed | 13 December 2024 |
| Published | 17 January 2025 |
| Claims | 8, over 21 pages |
| Role | Co-inventor (NLP), one of nine |