Almost semi-braces and the Yang-Baxter equation