When the webgl backend is not available or unsupported,
we fall back to the tensorflow cpu backend.
Tensorflow cpu backend library review by abp and jhm.
Co-authored-by: jomapp <17314077+jomapp@users.noreply.github.com>
When customers that do not have the SpamClientClassification feature are
attempting to vectorize e-mails, they ran into the error because the
env platform was not set, this was being set asynchronously by a
setTimeout, which had no time to be properly set, now we're explicitly
setting it during hashing if it has not been set yet.
Co-authored-by: abp <abp@tutao.de>
We sync the spam training data encrypted through our server to make
sure that all clients for a specific user behave the same when
classifying mails. Additionally, this enables the spam classification
in the webApp. We compress the training data vectors
(see clientSpamTrainingDatum) before uploading to our server using
SparseVectorCompressor.ts. When a user has the ClientSpamClassification
enabled, the spam training data sync will happen for every mail
received.
ClientSpamTrainingDatum are not stored in the CacheStorage.
No entityEvents are emitted for this type.
However, we retrieve creations and updates for ClientSpamTrainingData
through the modifiedClientSpamTrainingDataIndex.
We calculate a threshold per classifier based on the dataset ham to spam
ratio, we also subsample our training data to cap the ham to spam ratio
within a certain limit.
Co-authored-by: jomapp <17314077+jomapp@users.noreply.github.com>
Co-authored-by: das <das@tutao.de>
Co-authored-by: abp <abp@tutao.de>
Co-authored-by: Kinan <104761667+kibibytium@users.noreply.github.com>
Co-authored-by: sug <sug@tutao.de>
Co-authored-by: nif <nif@tutao.de>
Co-authored-by: map <mpfau@users.noreply.github.com>
Reviewed by jhm, abp, das.
The library is added to support training a spam classification model on
client. A custom rollupTensorFlow was created to only use the needed
methods on the final file, which also has multiple stubs which remove
code which is unwanted such as Requests.
Co-authored-by: jhm <17314077+jomapp@users.noreply.github.com>
Co-authored-by: abp <abp@tutao.de>