Copyright for this paper by its authors. Use permitted under Creative Commons
License Attribution 4.0 International (CC BY 4.0).

Woodstock’21: Symposium on the irreproducible science, June 07–11, 2021,
Woodstock, NY

# One to rule them all: Towards Joint Indic Language Hate Speech Detection.

Mehar Bhatia*  Tenzin Singhay Bhotia  Akshat Agarwal  Prakash Ramesh  Shubham
Gupta  Kumar Shridhar  Felix Laumann  Ayushman Dash  NeuralSpace, London,
United Kingdom

(2021)

###### Abstract

This paper is a contribution to the Hate Speech and Offensive Content
Identification in Indo-European Languages (HASOC) 2021 shared task. Social
media today is a hotbed of toxic and hateful conversations, in various
languages. Recent news reports have shown that current models struggle to
automatically identify hate posted in minority languages. Therefore,
efficiently curbing hate speech is a critical challenge and problem of
interest. We present a multilingual architecture using state-of-the-art
transformer language models to jointly learn hate and offensive speech
detection across three languages namely, English, Hindi, and Marathi. On the
provided testing corpora, we achieve Macro F1 scores of 0.7996, 0.7748, 0.8651
for sub-task 1A and 0.6268, 0.5603 during the fine-grained classification of
sub-task 1B. These results show the efficacy of exploiting a multilingual
training scheme.

###### keywords:

Hate Speech Social MediaIndic LanguagesLow ResourceMultilingual Language
Models

##  1 Introduction

Since the proliferation of social media users worldwide, platforms like
Facebook, Twitter, or Instagram have suffered from a rise of hate speech by
individuals and groups. In a large-scale study on Twitter, and Whisper, [1]
empirically show the prevalence of abusive comments and toxic language on such
platforms and its most prevalent categories: race, physical and gender.

A Bloomberg article [2] reported that users have even found new ways of
bullying others online using euphemistic emojis. Widespread use of such
abusive language on social media platforms often causes public embarrassment
to victims leading to major repercussions. Recently, Twitch filed a lawsuit
against two users who targeted LGBTQ+ and Black streamers with hate speech
[3]. One week later, content creators boycotted the game-streaming platform
due to the inability to control the hateful content. Observing the growing
usage of online hate, often anonymous, that comes at a scale unmanageable by
human moderators, it is essential for social media platforms to control the
abuse of users’ freedom of expression and maintaining an inclusive and
respectful society. To enforce such supervision, platforms must be able to
develop a system that can identify hate speech amongst billions of text
comments by users at scale.

Figure 1: Overview of HASOC 2021 Problem Statement

There have been research contributions in solving the problem of identifying
abusive comments or other forms of toxic language [4, 5, 6, 7], however, most
of them have majorly focused on high-resource languages, predominantly
English. As social media connects people from all over the world,
communicating in different languages, much of the potentially hateful content
is present in a multilingual setting. The failure to pay attention to non-
English languages is allowing such offensive speech to flourish. The lack of
datasets and models for various low-resource languages has made the task of
hate speech identification extremely difficult. In this paper, we present our
findings on a subset of Indic low-resource languages.

The HASOC (Hate Speech and Offensive Content) 2021 challenge has been
organized as a step towards this direction in three languages - English,
Hindi, and Marathi. Figure 1 demonstrates HASOC 2021 problem statement. We
focus on sub-task 1A and 1B of this competition, which we describe in the
following paragraph.

Sub-task 1A focuses on hate speech and offensive language identification in
English Hindi, and Marathi. It is a simple binary classification task in which
participating systems are required to classify tweets into one of the two
classes, namely:

  * •

(HOF) Hate and Offensive: Posts of this category contain either hate, offense,
profanity, or a combination of them.

  * •

(NOT) Non-Hate and offensive: Posts of this category do not contain any hate
speech, profane or offensive content.

Sub-task 1B is a multi-class classification task in English and Hindi. In this
task, hate speech and offensive posts from sub-task A are further classified
into the following three categories.

  * •

(HATE) Hate speech: Posts of this category contain hate speech content.

  * •

(OFFN) Offensive: Posts of this category contain offensive content.

  * •

(PRFN) Profane: Posts of this category contain profane words.

In this paper, we make the following contributions:

  * •

A pre-processing pipeline for modeling hate speech in the text of tweet
domain.

  * •

A joint fine-tuning procedure that empirically proves to outperform other
approaches in hate speech detection.

  * •

A summary of different approaches that did not work as expected.

  * •

The implementation and idea behind our winning approach for one of HASOC 2021
sub-tasks.

In the forthcoming sections, we give a brief overview of past approaches as
related work in section 2. Then, we present a detailed description of the
statistics of datasets used in section 3. We present our approach in section
4, delineating upon our pre-processing steps and model architecture. We
highlight our model hyperparameters and other experimental details in section
5. Later, in section 6, we display our final results and elaborate on various
other approaches that did not work well in section 7. We end with our
conclusion and point to future work in section 8.

##  2 Related Work

In the past, there have been many approaches to tackle the problem of hate
speech identification. Kwok and Wang [8] have experimented with a simple bag
of words (BOW) approach to identify hate speech. While being light-weight,
these models performed poorly with high false positive rates. Including
various core natural language processing (NLP) features like part of speech
tags [9] and N-gram graphs [10] have helped in improving the performance.
Lexical methods using TF-IDF and SVM as a classification model have achieved
surprisingly good performance [11].

With the rise of embedding words in distributed representations, researchers
have leveraged word embeddings like Glove [12], and FastText [13] for
embedding discrete text into a latent space and have improved the performance
over standard BOW and lexical approaches.

Recurrent Neural Networks (RNNs) for many years were the de-facto approach for
tackling any natural language problem. The winning approach at the 2020 HASOC
competition for Hindi [14] used a one-layer BiLSTM with FastText embeddings to
identify hate speech. Similarly for English, the most accurate model [15] used
an LSTM with Glove embeddings to represent text inputs. Mohtaj et al. [16]
also used a character-based LSTM following a similar trend.

In recent times, self-attention-based transformer [17] models and language
models derived from its huge corpus trained encoders like BERT [18] have shown
more promise than standard RNNs for most of the NLP tasks. Many researchers
have found BERT-like models to perform much better than other approaches
majorly due to their high transfer learning prowess [19]. While there has been
a lot of research on hate speech in general, experiments especially focusing
on low-resource languages are less popular. Simple logistic regression using
LASER embeddings has been shown to perform better than BERT-based models [20]
indicating the need for more accurate multilingual base language models. Since
then, we have witnessed the rise of multilingual language models like XLM-
Roberta [21]. In the following sections, we will delineate our approach of
building a solution using XLM-Roberta for identifying hate speech along with
an exhaustive comparison to other approaches.

##  3 Dataset Description

Datasets for HASOC 2021 [22] for English [23], Hindi [23], and Marathi [24]
languages were collected from social media platforms and comprises two sub-
tasks. We focus only on the first sub-task which is divided into two, i.e.,
sub-task 1A and sub-task 1B. As shown in Table 1, each dataset instance
consists of a unique hasoc_id, a tweet_id, full text of the tweet, and target
variables task_1 and task_2 for the sub-task 1A and 1B respectively. sub-task
1A is a binary classification problem with two target classes namely, HOF
(Hate and Offensive) and NOT (Non-Hate-offensive), whereas sub-task 1B is a
further fine-grained classification. The data is further classified into four
classes, namely OFFN (Offensive), PRFN (Profane), HATE, and NONE class. sub-
task 1A challenges with datasets in English, Hindi, and Marathi languages,
whereas only English and Hindi datasets are available for sub-task 1B. The
statistics of both the train and test data and shown in Table 2 and Table 3.

It can be seen that the datasets are highly imbalanced. For sub-task 1A, we
notice that the number of hate and offensive tweets is almost double for
English and Marathi. On the other hand, the number of non-hate-offensive
tweets is 55% higher for the Hindi dataset. In addition to that, for sub-task
1B, offered in English and Marathi language, the further classification of
hate and offensive tweets are imbalanced in opposite ratios.

Table 1: Dataset Description Columns | Description
---|---
hasoc_id | unique hasoc ID for each tweet
tweet_id | unique value for each tweet
text | full text of the tweets
task_1 | target value for sub-task 1A (HOF or NOT)
task_2 | target value for sub-task 1B (OFFN, PRFN, HATE or NONE)
Table 2: Class division of both sub-tasks for Train Dataset Language | Task 1 | Task 2 | TOTAL
---|---|---|---
| HOF | NOT | HATE | OFFN | PRFN | NONE |
English | 2501 | 1342 | 683 | 622 | 1196 | 1342 | 3843
Hindi | 1433 | 3161 | 566 | 654 | 213 | 3161 | 4594
Marathi | 1205 | 669 | $-$ | $-$ | $-$ | $-$ | 1874
Table 3: Class division of both sub-tasks for Test Dataset Language | Task 1 | Task 2 | TOTAL
---|---|---|---
| HOF | NOT | HATE | OFFN | PRFN | NONE |
English | 798 | 483 | 224 | 195 | 379 | 483 | 1281
Hindi | 505 | 1027 | 215 | 215 | 44 | 1027 | 1532
Marathi | 483 | 418 | $-$ | $-$ | $-$ | $-$ | 901

##  4 Approach

In this section, we demonstrate our approach of solving HASOC 2021 sub-task1A
and sub-task1B tasks.

###  4.1 Preprocessing

For preprocessing the tweet data and hashtags, we used python libraries,
namely tweet-preprocessor111https://github.com/s/preprocessor and
ekphrasis222https://github.com/cbaziotis/ekphrasis, a segmenter built on
Twitter corpus. For English data, the tweet-preprocessor’s clean functionality
was used to extract clean, parse and tokenize the tweet texts. For Hindi and
Marathi data, we first tokenized the tweet text on whitespaces and symbols
including colons, commas, semicolons, dashes, and underscores. Secondly, we
used the tweet-preprocessor python library for the removal of URLs, hashtags,
mentions, emojis, smileys, numbers, and reserved words (such as @RT which
stands for Retweets). We also noticed the usage of words in English and Arabic
in the Hindi and Marathi datasets. We first transliterated this text to the
desired language using NeuralSpace’s transliteration tool
333https://docs.neuralspace.ai/transliteration/overview. Later, if English or
Arabic occurrences remain, we used python library langdetect
444https://pypi.org/project/langdetect/ (a re-implementation of Google’s
language-detection library 555https://github.com/shuyo/language-detection from
Java to Python) to extract the pure Hindi and Marathi text within the tweet.

###  4.2 Feature Extraction

To extract features for our classifier, we use tweet-preprocessor to supply
various information fields, in addition to the cleaned content. The first
feature is obtained from the hashtag text which is segmented into constituent
and meaningful tokens using the ekphrasis segmenter. Ekphrasis tokenizes the
text based on a list of regular expressions. For example, the hashtags
‘##JitegaModiJitegaBharat’, ‘#IPL2019Final’, ‘#hogicongresskijeet’ is
tokenized to ‘Jitega Modi Jitega Bharat’, ‘IPL 2019 Final’, ‘hogi congress ki
jeet‘. Other features are acquired from URLs within the text, name mentions
such as ‘BJP4Punjab’, ‘aajtak’, ‘PMOIndia’, and ‘narendramodi’, and smileys
and emojis. The extracted emojis were processed in two ways.

First, we use emot666https://github.com/NeelShah18/emot python library to
obtain the textual description of a particular emoji in the text. Emot uses
advanced dynamic pattern generation. For example, ‘rofl emoji’ refers to
‘rolling-on-the-floor-and-laughing face’ and ‘speak-no-evil emoji’ refers to
‘speak-no-evil Monkey’. However, we felt this mapping is not sufficient as it
does not highlight the genuine meaning of what the emoji represents in
reality. Given that the usage of such emojis is so prevalent and that most of
them inherently have emotions built-in, emojis can give a lot of insights into
the sentiment of online text. For this reason, we also considered emoji2vec
[25] embeddings for 1661 emoji Unicode symbols learned from a total of 6088
descriptions in the Unicode emoji standard. Previous work has demonstrated the
usefulness of this by evaluating various tasks such as Twitter sentiment
analysis [25]. For example, consider ‘pray emoji’ and ‘tipping-hand-woman
emoji’, which map to ‘the-folded-hands’ symbol and the ‘woman-tipping-hand’
emoji. The textual representation will not showcase the emoji’s association
with ‘showing gratitude, expressing an apology, sentiments such as hope or
respect or even a high five‘ which is its real-world implication. On the other
hand, the person-tipping symbol is commonly used to express ‘sassiness’ or
sarcasm. We expect emoji2vec to capture these kinds of analogy examples.

###  4.3 Proposed Architecture

We leverage Transformer-based [17] masked language models to generate semantic
embeddings for the cleaned tweet text.

We use the available training corpora and fine-tune the transformer layers in
a multilingual fashion for our downstream task. We experimented with various
multi-lingual transformer models, i.e XLM-RoBERTa (XLMR), mBERT(multilingual
BERT), and DistilmBERT (multilingual-distilBERT). A summary for each model is
as follows:

  * •

XLM-RoBERTa: The pre-training of XLM-RoBERTa is based on 100 languages, using
around 2.5TB of preprocessed CommonCrawl dataset to train cross-language
representations in a self-supervised manner. XLM-RoBERTa [21] shows that the
use of large-scale multi-language pre-training models can significantly
improve the performance of cross-language migration tasks.

  * •

mBERT: Multilingual BERT [18] uses Wikipedia data of 102 languages, totaling
to 177M parameters, and is trained using two objectives i.e, 1) using a masked
language modeling (MLM) when 15% of input is randomly masked, and 2) using
next sentence prediction.

  * •

DistilmBERT: Distil multilingual BERT [26]is a distilled version of the above
mBERT model. It is also trained on the concatenation of Wikipedia in 102
different languages. It has a total of 134M parameters. On average DistilmBERT
is twice as fast as mBERT-base.

To solve the sub-task 1A of three languages (English, Hindi, and Marathi), and
sub-task 1B of two languages (English and Hindi) at the same time, we adopt
these multi-lingual models.

As mentioned in Section 4.2, we generate semantic vector representations for
all the emojis and smileys, their respective text, and segmented hashtags
within the tweet. We encode the emoji, smiley text embeddings, and hashtag
embeddings in the same latent space. To create the emojis’ semantic
embeddings, emoji2vec is utilized. An important point to notice is that the
segmented hashtags and text descriptions of emojis can be of variable length.
Hence, we generate the centralized emoji or hashtag representation by
averaging the vector representations. This is a simple approach proposed by
[27] to produce a comprehensive vector representation for sentences.

Figure 2: High level overview of our proposed architecture

##  5 Experimental Details

We used Hugging Face’s implementation and corresponding pre-trained models of
XLM-RoBERTa 777, multilingual BERT888https://huggingface.co/bert-base-
multilingual-uncased, and multilingual-distilBERT
999https://huggingface.co/distilbert-base-multilingual-cased in our proposed
architecture. Our architectures using Transformer models with custom
classification heads were implemented using PyTorch. We used Adam optimizer
for training with an initial learning rate of 2e-4, dropout probability of 0.2
with other hyper-parameters set to their default values. We use a cross-
entropy loss to update the weights. We have also used UKPLab’s sentence-
transformers library 101010https://github.com/UKPLab/sentence-transformers to
encode the hashtags and textual descriptions of the emojis.

All the fine-tuned language models broadly fall into two following categories.

  * •

Monolingual: These are a type of model that have been fine-tuned on only the
respective target language. For instance, we only use the English train
dataset to fine-tune the model and then infer on the English test set only.

  * •

Multilingual: These are a type of model that has been fine-tuned on a
combination of all available languages irrespective of the target language.
For instance, to train a model for the English target language on sub-task 1A,
we combine the train datasets for all languages (English, Hindi, and Marathi)
and then fine-tune the model once. Such a model can then be inferenced on any
given target language. Intuitively, such a training scheme provides three
benefits.

    * –

It enforces joint modeling of the training distribution for all the given
languages. Empirically we find this to perform better than individually
modeling on respective language.

    * –

During inference, we only rely on one model to infer instead of a unique model
for each language. An approach that can be extremely computed efficient for
production.

    * –

We combine naturally occurring human-annotated data just in a different
language. Hence, it becomes a promising approach towards resolving poor model
performance due to the data scarcity issue for low-resource languages.

As shown in Table 4, we empirically observe that a multilingual training
setting clearly outperforms the monolingual setting across both the tasks in
all three languages irrespective of the base model. For English sub-task 1,
only mBERT and DistilmBERT score below the monolingual setting, but the
difference is not as significant. This experiment suggests that multilingual
training can be an important approach to train better-performing models,
especially as it provides a step towards resolving the data scarcity issue for
low-resource languages. It will be interesting to validate the
generalizability of this hypothesis on different NLP tasks in the future.

All experiments were carried on a workstation with one NVIDIA A100-SXM4-40GB
GPU with 12 CPU cores. We used a batch size of 64 throughout. For the initial
experiments, we have divided the released training data into a training set
and a validation set and conducted the experiments using accuracy as the
performance metric. Finally, the performance of the proposed system was tested
on the test set released by the organizers. For these experiments, we combined
all the training and validation data into a single training set and applied
our algorithm. For the multilingual setting, our experiment took 3.5 hours to
train till convergence. For the monolingual setup, our model took 1.2 hours to
train till convergence.

##  6 Results

Table 4 presents our performance evaluations of our proposed architectures on
the provided testing set. The evaluation metric used throughout is the macro
F1-score.

We see that fine-tuned multilingual models clearly beat the baselines by at
least % , demonstrating the prowess of large language models.

It is observed from Table 4, that for all three languages, XLM-RoBERTa has
outperformed similar multilingual Transformer models such as mBERT
(multilingual BERT) and distilmBERT (multilingual-distilBERT) on our hate
speech detection task. We observe a minimum absolute gain of 1.63 F1 and 1.20
F1 for Task1 and Task 2 respectively via the multilingual approach with XLM-
RoBERTa. While a maximum absolute gain of 2.1 F1 and 2.31 F1 for Task1 and
Task 2 respectively. Empirically such significant improvements suggest the
importance of multilingual training over monolingual training. Notably,
multilingually trained XLM-RoBERTa secured the 1st position among 24
participants and the 5th position among 34 participants on the HASOC 2021
leaderboard for Task 1 and 2 respectively. Securing such high ranks again
indicates the importance of the multilingual approach and calls for a detailed
investigation of this approach on other tasks as well for future work.

Table 4: Results of proposed architectures on test data Proposed Architecture | English | Hindi | Marathi
---|---|---|---
Model | Mono/Multi | Task1 | Task2 | Task1 | Task2 | Task1
XLM-R Finetuned | Monolingual | 0.7786 | 0.6148 | 0.7585 | 0.5447 | 0.8420
mBERT Finetuned | Monolingual | 0.7631 | 0.5703 | 0.7462 | 0.5202 | 0.8269
DistilmBERT Finetuned | Monolingual | 0.7637 | 0.5826 | 0.7554 | 0.5267 | 0.8350
XLM-R Finetuned | Multilingual | 0.7996 | 0.6268 | 0.7748 | 0.5603 | 0.8651
mBERT Finetuned | Multilingual | 0.7626 | 0.6121 | 0.7593 | 0.5554 | 0.8461
DistilmBERT Finetuned | Multilingual | 0.7592 | 0.6104 | 0.7589 | 0.5591 | 0.8510

##  7 Key Takeaways

In this section, we aim to provide a checklist of various approaches and
techniques that we implemented for this task but did not result in competitive
positions on the leaderboard. We believe that our readers will benefit from
this checklist during future work.

To begin with, as the dataset was overall highly imbalanced across all
languages, we perform SOUP (Similarity-based Oversampling and Undersampling
processing), a technique in which the number of the minority class samples is
increased the number of majority class samples are decreased to obtain a
balanced data set. This technique was suggested by [11] and we use this
balanced data for performing the classification task, however, when compared
to our best performing model, we see a drop of 5% in accuracy.

Secondly, to add more training samples to our multilingual dataset, we use
data augmentation techniques such as back-translation to generate this
synthetic data. We adopt ML Translator API, which is Google’s Neural Machine
Translation (NMT) system. This translation method was widely used because of
its simplicity and zero-shot translation. With this method, we increase our
dataset size by three times, however, we don’t see any performance gains using
this augmented dataset for our proposed architecture. Moreover, we observed a
reduction of toxicity upon using this back-translation method possibly
resulting in false labels for many instances.

Based on winning approaches from [28] and [29], we applied different machine
learning algorithms, i.e, random forest, and LightGBM, a gradient boosting
framework based on decision trees. These techniques have shown an average drop
of 5.3%. We also looked into two different deep neural networks approaches and
tested them for all three languages. For the English model, we used GloVe
111111https://nlp.stanford.edu/projects/glove/ embeddings [12] for both sub-
tasks. This embedding layer is fed to a CNN model. The architecture comprises
two convolutional, two dropouts, and two max-pooling layers accompanied by a
flatten layer and a dense layer. We achieved a macro F1 score of 0.75 and 0.56
respectively on HASOC 2021 sub-task A and B test sets. For Hindi and Marathi
models, we used fastText 121212https://fasttext.cc/docs/en/crawl-vectors.html
embeddings [13] for both the sub-tasks. Here, the embeddings are passed
through a bi-directional LSTM model and a dropout layer, followed by a dense
layer. We achieved macro F1 scores of 0.74, 0.54, and 0.84 on Hindi Task1, 2
and Marathi Task 1, respectively. Overall, we see that our final proposed
architecture performed the best overall tasks.

##  8 Conclusion

This work has been submitted to CEUR 2021 Workshop Proceedings for the task,
Identification of Hate and Offensive Speech in Indo-European Languages (HASOC
2021). In this research, the problem of identifying hate and offensive content
in tweets has been experimentally studied on three different language datasets
namely, English, Hindi, and Marathi. We propose a joint language training
approach based on recent advances in large-scale transformer-based language
models and demonstrate our best results. We plan to further explore other
novel methods of capturing social media text semantics as part of future work.
We also aim to look at more accurate data augmentation techniques to handle
the data imbalance and enhancing hate and offensive speech detection in social
media posts.

## References

  * Silva et al. [2016] L. Silva, M. Mondal, D. Correa, F. Benevenuto, I. Weber,  Analyzing the targets of hate in online social media,  in: Tenth international AAAI conference on web and social media, 2016.
  * Levingston [2021] I. Levingston, Racist emojis are the latest test for facebook, twitter moderators, 2021. URL: {https://www.bloomberg.com/news/articles/2021-09-13/racist-emojis-are-the-latest-test-for-facebook-twitter-moderators}.
  * Speakman [2021] K. Speakman, Twitch sues users who it alleges conducted ‘hate raids’, 2021. URL: {https://www.forbes.com/sites/kimberleespeakman/2021/09/10/twitch-sues-users-who-it-alleges-conducted-hate-raids/?sh=36407fe87822}.
  * Waseem and Hovy [2016] Z. Waseem, D. Hovy,  Hateful symbols or hateful people? predictive features for hate speech detection on twitter,  in: Proceedings of the NAACL student research workshop, 2016, pp. 88–93.
  * Watanabe et al. [2018] H. Watanabe, M. Bouazizi, T. Ohtsuki,  Hate speech on twitter: A pragmatic approach to collect hateful and offensive expressions and perform hate speech detection,  IEEE access 6 (2018) 13825–13835.
  * Al-Hassan and Al-Dossari [2019] A. Al-Hassan, H. Al-Dossari,  Detection of hate speech in social networks: a survey on multilingual corpus,  in: 6th International Conference on Computer Science and Information Technology, volume 10, 2019\.
  * Zhang and Luo [2019] Z. Zhang, L. Luo,  Hate speech detection: A solved problem? the challenging case of long tail on twitter,  Semantic Web 10 (2019) 925–945.
  * Kwok and Wang [2013] I. Kwok, Y. Wang,  Locate the hate: Detecting tweets against blacks,  in: Twenty-seventh AAAI conference on artificial intelligence, 2013.
  * Chen et al. [2012] Y. Chen, Y. Zhou, S. Zhu, H. Xu,  Detecting offensive language in social media to protect adolescent online safety,  in: 2012 International Conference on Privacy, Security, Risk and Trust and 2012 International Confernece on Social Computing, IEEE, 2012, pp. 71–80.
  * Themeli [2018] C. K. Themeli,  Hate speech detection using different text representations in online user comments,  no. October 2018 (2018).
  * Reddy and Rajalakshmi [2020] Y. Reddy, R. Rajalakshmi,  Dlrg@ hasoc 2020: A hybrid approach for hate and offensive content identification in multilingual tweets.,  in: FIRE (Working Notes), 2020, pp. 304–310.
  * Pennington et al. [2014] J. Pennington, R. Socher, C. D. Manning,  Glove: Global vectors for word representation,  in: Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), 2014, pp. 1532–1543.
  * Bojanowski et al. [2017] P. Bojanowski, E. Grave, A. Joulin, T. Mikolov,  Enriching word vectors with subword information,  Transactions of the Association for Computational Linguistics 5 (2017) 135–146.
  * Raja et al. [2021] R. Raja, S. Srivastavab, S. Saumyac,  Nsit & iiitdwd@ hasoc 2020: Deep learning model for hate-speech identification in indo-european languages (2021).
  * Mishraa et al. [2020] A. K. Mishraa, S. Saumyab, A. Kumara,  Iiit_dwd@ hasoc 2020: Identifying offensive content in indo-european languages (2020).
  * Mohtaj et al. [2020] S. Mohtaj, V. Woloszyn, S. Möller,  Tub at hasoc 2020: Character based lstm for hate speech detection in indo-european languages.,  in: FIRE (Working Notes), 2020, pp. 298–303.
  * Vaswani et al. [2017] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, I. Polosukhin,  Attention is all you need,  in: Advances in neural information processing systems, 2017, pp. 5998–6008.
  * Devlin et al. [2018] J. Devlin, M.-W. Chang, K. Lee, K. Toutanova,  Bert: Pre-training of deep bidirectional transformers for language understanding,  arXiv preprint arXiv:1810.04805 (2018).
  * Mozafari et al. [2019] M. Mozafari, R. Farahbakhsh, N. Crespi,  A bert-based transfer learning approach for hate speech detection in online social media,  in: International Conference on Complex Networks and Their Applications, Springer, 2019, pp. 928–940.
  * Aluru et al. [2020] S. S. Aluru, B. Mathew, P. Saha, A. Mukherjee,  Deep learning models for multilingual hate speech detection,  arXiv preprint arXiv:2004.06465 (2020).
  * Conneau et al. [2019] A. Conneau, K. Khandelwal, N. Goyal, V. Chaudhary, G. Wenzek, F. Guzmán, E. Grave, M. Ott, L. Zettlemoyer, V. Stoyanov,  Unsupervised cross-lingual representation learning at scale,  arXiv preprint arXiv:1911.02116 (2019).
  * Modha et al. [2021] S. Modha, T. Mandl, G. K. Shahi, H. Madhu, S. Satapara, T. Ranasinghe, M. Zampieri,  Overview of the HASOC Subtrack at FIRE 2021: Hate Speech and Offensive Content Identification in English and Indo-Aryan Languages and Conversational Hate Speech,  in: FIRE 2021: Forum for Information Retrieval Evaluation, Virtual Event, 13th-17th December 2021, ACM, 2021.
  * Mandl et al. [2021] T. Mandl, S. Modha, G. K. Shahi, H. Madhu, S. Satapara, P. Majumder, J. Schäfer, T. Ranasinghe, M. Zampieri, D. Nandini, A. K. Jaiswal,  Overview of the HASOC subtrack at FIRE 2021: Hate Speech and Offensive Content Identification in English and Indo-Aryan Languages,  in: Working Notes of FIRE 2021 - Forum for Information Retrieval Evaluation, CEUR, 2021\. URL: http://ceur-ws.org/.
  * Gaikwad et al. [2021] S. Gaikwad, T. Ranasinghe, M. Zampieri, C. M. Homan,  Cross-lingual offensive language identification for low resource languages: The case of marathi,  in: Proceedings of RANLP, 2021.
  * Eisner et al. [2016] B. Eisner, T. Rocktäschel, I. Augenstein, M. Bošnjak, S. Riedel,  emoji2vec: Learning emoji representations from their description,  arXiv preprint arXiv:1609.08359 (2016).
  * Sanh et al. [2019] V. Sanh, L. Debut, J. Chaumond, T. Wolf,  Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter,  arXiv preprint arXiv:1910.01108 (2019).
  * Arora et al. [2016] S. Arora, Y. Liang, T. Ma,  A simple but tough-to-beat baseline for sentence embeddings (2016).
  * Mandl et al. [2020] T. Mandl, S. Modha, A. Kumar M, B. R. Chakravarthi,  Overview of the hasoc track at fire 2020: Hate speech and offensive language identification in tamil, malayalam, hindi, english and german,  in: Forum for Information Retrieval Evaluation, 2020, pp. 29–32.
  * Mandl et al. [2019] T. Mandl, S. Modha, P. Majumder, D. Patel, M. Dave, C. Mandlia, A. Patel,  Overview of the hasoc track at fire 2019: Hate speech and offensive content identification in indo-european languages,  in: Proceedings of the 11th forum for information retrieval evaluation, 2019, pp. 14–17.


$m$   $\ell=\emptyset$   $\ell=a$   $\ell=b$

$0$   $t^{*d}_m(\zeta_0)=+\infty$   $t^{*d}_m(\zeta_0)=+\infty$   $t^{*d}_m(\zeta_0)=+\infty$

$1$   $t^{*d}_m(\zeta)=\frac{1}{v_1^\emptyset}\log \frac{D}{\zeta}$   $t^{*d}_m(\zeta)=\frac{1}{v_1'}\log \frac{\zeta}{\zeta_0}$   $t^{*d}_m(\zeta)=\frac{1}{v_1}\log \frac{D}{\zeta}$

$2$   $t^{*d}_m(\zeta)=\frac{1}{v_2^\emptyset}\log \frac{D}{\zeta}$   $t^{*d}_m(\zeta)=\frac{1}{v_2}\log \frac{D}{\zeta}$   $t^{*d}_m(\zeta)=\frac{1}{v_2'}\log \frac{\zeta}{\zeta_0}$

The values of $\lambda_m^\ell$ are given in <ref>. For the standard relapse intensities ($\mu_i$), we choose  piece-wise increasing linear functions calibrated such that the risk of relapsing increases until $\tau_1$ (average of standard relapses occurrences), then remains constant, and further increases between $\tau_2$ and $\tau_3$ years (to model  late or non-relapsing patients):

\begin{align*}
\mu_i(x)=\left[ \begin{array}{ll}
\frac{\nu_1^i}{\tau_1^i}x & \text{ if } x\in[0,\tau_1^i] \\
\nu^i_1 & \text{ if } x\in[\tau_1^i,\tau_2] \\
\nu^i_1+\frac{\nu^i_2-\nu^i_1}{\tau_3-\tau_2}(x-\tau_2) & \text{ if } x\in[\tau_2,\tau_3] \\
\nu^i_2 & \text{ if } x \geq \tau_3
\end{array}\right.
\end{align*}

We set $\tau_1^1=750$, $\tau_1^2=500$ (days), $\tau_2=5$, $\tau_3=6$ (years), $\nu^i_1$ was selected so that $20$% of patients relapse before $\tau^i_1$, and $\nu^i_2$ such that $10$% of patients have not relapsed at horizon time $H$.

For the therapeutic escape relapses (patients who relapse while treated for a current relapse), we chose to fit a Weibull survival distribution of the form

\begin{align*}
\mu_i'(\zeta)&=(\beta_i'\zeta)^{\alpha_i'},
\end{align*}

with $-1<\alpha_i'<0$ to account for a higher relapse risk when the marker decreases. We arbitrarily chose $\beta_i'=-0.8$ and calibrated $b_i=1000$ such that only about 5% of patients experience a therapeutic escape.

Intensity of the controlled continuous time PDMP.

$\ell=\emptyset$   $\ell=a$   $\ell=b$

$m=0$   $\lambda_m^\ell(\zeta,u)=(\mu_1\!+\!\mu_2)(u)$   $\lambda_m^\ell(\zeta,u)=\mu_2(u)$   $\lambda_m^\ell(\zeta,u)=\mu_1(u)$

$m=1$   $\lambda_m^\ell(\zeta,u)=0$   $\lambda_m^\ell(\zeta,u)=\mu'_2(\zeta)$   $\lambda_m^\ell(\zeta,u)=0$

$m=2$   $\lambda_m^\ell(\zeta,u)=0$   $\lambda_m^\ell(\zeta,u)=0$   $\lambda_m^\ell(\zeta,u)=\mu'_1(\zeta)$

$m=3$   $\lambda_m^\ell(D,u)=0$   $\lambda_m^\ell(D,u)=0$   $\lambda_m^\ell(D,u)=0$

Finally, the Markov kernels are given in <ref>. Cases for $m=3$ are omitted as no jump is allowed when the patient has died.
The possible transitions between modes are illustrated in <ref>, and an example of(continuous-time) controlled trajectory is given in <ref>.

Markov kernel of the controlled continuous time PDMP, for $(A,B)$ Borel subsets of $(\zeta_0,D)$, and $[0,H]$ respectively

$m=0$   $\bs Q^\ell(\{m'\}\times A\times B| m,\zeta_0,u)=\1_A(\zeta_0)\1_B(0)\1_{(m'\in\{1,2\})}\frac{\mu_{m'}(u)}{\mu_1(u)+\mu_2(u)}$

$m=1$   $\bs Q^\ell(\{m'\}\times A\times B| m,\zeta,u)=\1_A(\zeta)\1_B(0)\1_{(m'=0)}\1_{(\zeta=\zeta_0)}$

$\bs Q^\ell(\{3\}\times A\times B| m,\zeta,u)=\1_A(D)\1_B(0))\1_{(\zeta=D)}$

$m=2$   $\bs Q^\ell(\{m'\}\times A\times B| m,\zeta,u)=\1_A(\zeta)\1_B(0))\1_{(m'=0)}\1_{(\zeta=\zeta_0)}$

$\bs Q^\ell(\{3\}\times A\times B| m,\zeta,u)=\1_A(D)\1_B(0)\1_{(\zeta=D)}$

$m=0$   $\bs Q^\ell(\{m'\}\times A\times B| m,\zeta_0,u)=\1_A(\zeta_0)\1_B(0)\1_{(m'=2)}$

$m=1$    $\bs Q^\ell(\{m'\}\times A\times B| m,\zeta,u)=\1_A(\zeta)\1_B(0)\1_{(m'=2)}\1_{(\zeta>\zeta_0)}$

$\bs Q^\ell(\{0\}\times A\times B| m,\zeta,u)=\1_A(\zeta_0)\1_B(0)\1_{(\zeta=\zeta_0)}$

$m=2$   $\bs Q^\ell(\{0,1\}\times A\times B| m,\zeta,u)=0$

$\bs Q^\ell(\{3\}\times A\times B| m,\zeta,u)=\1_A(D)\1_B(0)\1_{(\zeta=D)}$

$m=0$   $\bs Q^\ell(\{m'\}\times A\times B| m,\zeta_0,u)=\1_A(\zeta_0)\1_B(0)\1_{(m'=1)}$

$m=1$   $\bs Q^\ell(\{0,2\}\times A\times B| m,\zeta,u)=0$

$\bs Q^\ell(\{3\}\times A\times B| m,\zeta,u)=\1_A(D)\1_B(0)\1_{(\zeta=D)}$

$m=2$   $\bs Q^\ell(\{m'\}\times A\times B| m,\zeta,u)=\1_A(\zeta)\1_B(0)\1_{(m'=1)}\1_{(\zeta>\zeta_0)}$

$\bs Q^\ell(\{0\}\times A\times B| m,\zeta,u)=\1_A(\zeta_0)\1_B(0))\1_{(\zeta=\zeta_0)}$

[draw,rounded corners=2pt] (mode0) at (0,0) $0$;
[draw,rounded corners=2pt] (mode1) at (1.5,1) $1$;
[draw,rounded corners=2pt] (mode2) at (1.5,-1) $2$;
[draw,rounded corners=2pt] (cemetery) at (3,0) $3$;

[->,>=latex,dashed] (mode2.north east) – (mode1.south east) node[right=0.01cm,pos=0.5]$b$;
[->,>=latex,dashed] (mode1.south west) – (mode2.north west) node[left=0.01cm,pos=0.5]$a$;
[->,>=latex] (mode2) – (mode0) node[right=0.01cm,pos=0.7]$b$;
[->,>=latex] (mode1) – (cemetery) node[right=0.01cm,pos=0.3]$\neq a$;
[->,>=latex] (mode2) – (cemetery) node[right=0.01cm,pos=0.3]$\neq b$;
[->,>=latex] (mode1) – (mode0) node[right=0.01cm,pos=0.7]$a$;
[->,>=latex,dashed] (mode0.south west) – (mode2.south west) node[left=0.01cm,pos=0.6]$\neq b$;
[->,>=latex,dashed] (mode0.north west) – (mode1.north west) node[left=0.01cm,pos=0.6]$\neq a$;

State graph. Full line arrows indicate deterministic jumps at the boundary, while dashed arrows indicate stochastic jumps. Letters indicate under which treatments the jumps are possible.

[,scale=0.65, every node/.style=scale=0.65]
(t0) at (-2, 0);
(T1) at (-0.2, 0) ;
(d1) at (1.5,1);
(T2) at (2.6,0);
(d2) at (2.8,0);
(T3) at (3.2,0);
(d3) at (4.5,1.5);
(d4) at (5,1.8);
(T4) at (6.1,0);
(d5) at (6.5,0);
(H) at (8,0);
[-] (t0)–(T1)
node[above=0.1,pos=0.1]$\zeta_0,\small{\emptyset}$ node[below=0.1,pos=1] $T_1$;
[color=green!60] (T1) to[out=0,in=-80] (d1);
[color=green!60] (d1) to[out=-90,in=-180] (T2) ;
at (1.5,1.3) $a$;
[-] (T2)–(d2) node[below=0.1,pos=-0.1,color=black] $T_2$;
[-] (d2)–(T3) node[below=0.1,pos=1,color=black] $T_3$;
at (3,0.4) $\emptyset$;
[color=red!60] (T3) to[out=0,in=-90] (d3);
[color=red!60] (d3) to[out=0,in=-100] (d4);
at (4.5,1.75) $a$;
[color=red!60] (d4) to[out=-90,in=-180] (T4);
at (5,2.1) $b$;
[-] (T4)–(d5) node[below=0.1,pos=-0.1,color=black] $T_4$;
[-] (d5)–(H) node[below=0.1,pos=1,color=black] $H$;
[-,color=black!50](-2,-0.1) – (-2,0.1);

[-,color=black!50](-1,-0.1) – (-1,0.1);

[-,color=black!50](0,-0.1) – (0,0.1);

[-,color=black!50](1,0.15) – (1,0.35);
[-,color=black!50](1.5,0.8) – (1.5,1);
[-,color=black!50](2,0.1) – (2,0.3);
[-,color=black!50](2.5,-0.1) – (2.5,0.1);
[-,color=black!50](3,-0.1) – (3,0.1);
[-,color=black!50](3.5,-0.05) – (3.5,0.15);

[-,color=black!50](4.5,1.4) – (4.5,1.6);
[-,color=black!50](5,1.7) – (5,1.9);
[-,color=black!50](5.5,0.15) – (5.5,0.35);
[-,color=black!50](6,-0.1) – (6,0.1);

[-,color=black!50](7,-0.1) – (7,0.1);
[-,color=black!50](7.5,-0.1) – (7.5,0.1);
[-,color=black!50](8,-0.1) – (8,0.1);
[dashed] (-2,3)–(8,3) node[above=0.15cm,pos=0] $D$;
at (7,0.4) $\emptyset$;

Example of controlled trajectory. Representation of coordinate $\zeta$ of a controlled process. The process is in mode $0$ when drawn in black, in mode $1$ when in green, and in mode $2$ when in red. The $T_i$ represent hidden natural jump times. Letters above indicate the changes of treatment that can only occur at dates in the time grid $\delta^{1:N}=\{\delta,2\delta,\ldots, N\delta\}$.

For the observations, we use the identity link function and a truncated gaussian for the noise. We arbitrarily chose $\sigma^2=1$ for the variance of the Gaussian distribution and  $s=2$ for the truncation parameter.

§.§ Technical specifications in our examples

Assumption <ref> imposes  $t^{*d}_m(\zeta_0)>r$  if $(m,d)\in\{(1,\emptyset), (2,\emptyset), (1,b), (2,a)\}$ which is verified as soon as

\begin{align*}
\delta <\frac{1}{N\bar v}\log\frac{D}{\zeta_0},
\end{align*}

where $\bar v= \max\{v_1,v_1^\emptyset,v_2,v_2^\emptyset\}$.

<ref> is valid for our intensities.
For all $x\in E$, one has
$\|\lambda\|\leq \max\{\nu_2^1,\nu_2^2, (\beta_1'\zeta_0)^{\alpha_1'},(\beta_2'\zeta_0)^{\alpha_2'}\}$
The Lipschitz property is valid for $\mu'_i$ as $\zeta_0>0$ and $\alpha'_i>-1$. It is also valid for $\mu_i$ with $[\lambda]\leq \max\{\nu_1^i/\tau_1^i;\nu_2^i-\nu_1^i/\tau_3-\tau_2\}$.

Assumption <ref> is valid for our exponential flows with $[\Phi]\leq e^{\bar{v}\delta}$ and $[t^{*}]\leq \frac{1}{\zeta_0\underline{v}}$ with $\underline{v}=\min\{v_1^\emptyset,v_1,v_2,v_2^\emptyset,v'_1,v'_2\}$.
In addition, as $\Phi_m^d(\zeta,t)\in E$ for $t< t^{*d}_m(\zeta)$ one also has  $|\Phi_m^d(\zeta,t)|\leq D$ and if $m\neq 0$, $|t^{*d}_m(\zeta)|\leq\frac{1}{\underline{v}}\log \frac{D}{\zeta_0}$.

Finally, <ref> explicits values of $\zeta$ for which $\bs t^{*d}(x)=r$ when $x=(m,\zeta,u,w)$. From those we obtain $[S]\leq \frac{\bar v}{2\zeta_0\underline v} \max \T$.

Values of $\zeta$ such that $\bs t^{*d}(m,\zeta,u,w)=r$.

$\ell=\emptyset$   $\ell=a$   $\ell=b$

$m=0$   $\emptyset$     $\emptyset$     $\emptyset$

$m=1$    $De^{-v_1^\emptyset r}$     $\zeta_0 e^{v'_1 r}$     $De^{-v_1 r}$

$m=2$     $De^{-v_2^\emptyset r}$     $D e^{-v_2 r}$     $\zeta_0e^{v'_2 r}$

<ref> is valid for our truncated Gaussian noise and identity link function  with $L_f=2sD(D+s)(p\sigma^3\sqrt{2\pi})^{-1}$, $\bar f\leq (p\sigma\sqrt{2\pi})^{-1}$, $\underline{f}\geq (p\sigma\sqrt{2\pi})^{-1}e^{-D^2/2\sigma^2}$ and $B_f=2(D+s)\bar f$ where $p=\P(-s\leq Z\leq s)$ for a centred Gaussian random variable $Z$ with variance $\sigma^2$.

<ref> is valid for both the time-dependent and marker-dependent cost functions with  parameters given in <ref>.

Upper bounds for the regularity parameter for the cost functions.

time-dependent cost     marker-dependent cost
$B_C\leq$     $\max\{|D-\zeta_0|,c_M\}$     $\max\{|D-\zeta_0|,c_M\}$

$B_c\leq$    $ \max\{\max \T \times\max\{\gamma_i,\beta_i\},c_M\}$    $\max\{\max \T \times(\max\{\gamma_i,\beta_i\},|D-\zeta_0|),c_M\}$

$L_C \leq$    $ 2 |D-\zeta_0|$    $ 2 |D-\zeta_0|$

$L_c \leq$    $2\max\T \max\{\gamma_i,\beta_i\}$    $2 \max \T (|D-\zeta_0|+\max\{\gamma_i,\beta_i\})$

§.§ Grids construction

As explained in the main manuscript, starting from an initial grid (with $184=n_\Omega$ points chosen to emphasize strong beliefs on each atom of grid $\Omega$), grids were extended iteratively by simulating a number $n_{sim}$ of trajectories using optimal strategies obtained by dynamic programming on the previous grids, and including all estimated filters with distance to their projection larger than a fixed threshold $s$.

We varied the couples ($(n_{sim}, s)$ for both distances ($L_2$ and $L_m$) at each iteration.
Extensive simulations (work not shown) indicates that for a similar number of points in the resulting grids, the results are better when using a small number of simulations with a stringent threshold than a larger number of simulations with a larger threshold.

At each iteration, we also removed from the current grid all points whose density did not reach a given threshold. To do so, we simulated $10000$ trajectories using the current optimal strategy keeping track of all visited points in the grid. Then we removed all points with density smaller than $0.001/n_\Gamma$ (note that if all points were used equally, the density would be $1/n_\Gamma$). Due to the large amount of points removed at the first iteration, the second grid was computed without additional points.
The final process is illustrated in <ref>.

Iterative grids for distance $L_2$ (left) and $L_m$ (right)
best = [rectangle,font=, draw,text centered, text height=1.5ex, text depth=.25ex, minimum size=2.5ex,color=red]
intbest = [rectangle,font=, draw,text centered, text height=1.5ex, text depth=.25ex, minimum size=2.5ex,color=green]
at (0,2)  ;
(init) at (2,0) 184;
at (-3.5,0) $\Gamma^0$;
(g1) at (2,-2) 319;
at (-3.5,-2) $\Gamma^1$;
[->] (init.south)  – (g1.north) node[left=0.1cm,pos=0.3] $(10,0.2)$ node[left=0.35,pos=0.7]$+93$ node[right=0.1cm,pos=0.7] $-42$;
(g2) at (2,-4.5) 549;
at (-3.5,-4.5) $\Gamma^2$;
[->] (g1.south)  – (g2.north) node[left=0.1cm,pos=0.3] $(10,0.2)$ node[left=0.35,pos=0.7]$+205$ node[right=0.1cm,pos=0.7] $-25$;
(g3) at (2,-7) 722;
at (-3.5,-7) $\Gamma^3$;
[->] (g2.south)  – (g3.north) node[left=0.1cm,pos=0.3] $(100,0.4)$ node[left=0.35,pos=0.7]$+163$ node[right=0.1cm,pos=0.7] $-10$;
(g4) at (2,-9.5) 989;
[->] (g3.south)  – (g4.north) node[left=0.1cm,pos=0.3] $(12,0.2)$ node[left=0.35,pos=0.7]$+266$ node[right=0.1cm,pos=0.7] $-1$;
at (-3.5,-9.5) $\Gamma^4$;
(initm) at (10,0) 184;
(g1m) at (10,-2) 310;
[->] (initm.south)  – (g1m.north) node[left=0.1cm,pos=0.3] $(7,0.2)$ node[left=0.35,pos=0.7]$+81$ node[right=0.1cm,pos=0.7] $-45$;
(g2m) at (10,-4.5) 545;
[->] (g1m.south)  – (g2m.north) node[left=0.1cm,pos=0.3] $(7,0.2)$ node[left=0.35,pos=0.7]$+213$ node[right=0.1cm,pos=0.7] $-22$;
(g3m) at (10,-7) 709;
[->] (g2m.south)  – (g3m.north) node[left=0.1cm,pos=0.3] $(40,0.55)$ node[left=0.35,pos=0.7]$+160$ node[right=0.1cm,pos=0.7] $-4$;
(g4m) at (10,-9.5) 1021;
[->] (g3m.south)  – (g4m.north) node[left=0.1cm,pos=0.3] $(8,0.2)$ node[left=0.35,pos=0.7]$+307$ node[right=0.1cm,pos=0.7] $-5$;

§.§ Distance impact on trajectory

Setting the same seed, we illustrate the impact of the grid and distance choice on a trajectory in <ref>. The first row shows the (true) value of $X_2$, with $X_1$ indicated by circles for $X_1=0$, triangles for $X_2=1$ and pluses for $X_2=3$. The second row shows the observed process $Y$, with colors indicating treatments: black for $\emptyset$, green for $a$ and red for $b$. The third row shows the mass probability of each mode of the estimated filter, and the fourth for its projected counterpart. Finally, the fifth row shows the distance between estimated and projected filters, in black for the $L_2$ distance, and in blue for the $L_m$ distance.

<ref> shows that though the distance between the filter and its projection significantly decreases between the two grids, the projection does not preserve the mode, hence leads to decision which do not always seem appropriate seeing the data, in particular regarding the next visit date. On the contrary, <ref> shows that distance $L_m$ decreases the distance meanwhile maintaining the mass distribution between modes.

Trajectories for $L_2$ distance.

Trajectories for $L_m$ distance.

§.§ Choice of $\hat \Psi$ or $\bar \Psi$ in practice

The discretization strategy lead to a Markov kernel $\hat{R}'$ on $\bar\X'$ to which can be associated a Markov chain $\hat\Psi$. In theory, the dynamic programming algorithm operates on this Markov chain, and error bounds from the main theorem are computed accordingly. This should imply that at iteration $k$, filter $\bar\Psi_k$ is computed from the new observation and the current filter $\hat\Psi_{k-1}$, then projected on $\Gamma$ to identify the optimal decision. Then this projection $\hat\Psi_k=p_{|\Gamma}(\bar\Psi_k)$ is saved as current filter for the next observation.

In practice, this implies that the projection error $\hat\Psi_k-\bar\Psi_k$ is propagated through the dynamic programming recursion. We propose instead to save $\bar\Psi_k$ as current filter for the next iteration, i.e. the filter at iteration $k+1$ will be computed using $Y_{k+1}$ and $\bar\Psi_k$. We do not propose any error bound on this practical strategy, and there is no guarantee that this should lead to better results, as projection errors on $\Gamma$ may sometimes compensate previous errors. However in our simulation studies we have observed a significant difference between the strategies, as illustrated in <ref> (grid $1021$ with $Lm$ distance).

One can note that the estimated cost is identical in the visit choice framework between filter  $\bar \Psi$ and $\hat \Psi$ as they correspond to  how grids were calibrated, but  in practice the real cost is lower with $\bar \Psi$ as the latter is closer to the true data.

Choice of $\hat \Psi$ or $\bar \Psi$ as current filter

$\bar \Psi$          $\hat \Psi$

Visits     $\hat{v}_0$     real cost (sd)     est. cost (sd)      real cost  (sd)     est. cost  (sd)

OS    132.43     136.96  (3.97)     134.8  (0.75)     161.38  (7.2)     134.82  (0.96)

Grid   FD-15     253.28     214.29  (1.67)     215.83  (0.78)     227.84  (3.13)     264.19  (2.31)

1231   FD-60     163.57     143.02  (5.29)     141.8  (1.05)     163.19  (7.29)     165.22  (1.05)