Input-length-shortening and text generation via attention values