Exploring and Mitigating Gender Bias in Encoder-Based Transformer Models