Short answer: by calibration.
Expanding on this short answer: pressure advance (or also called "linear advance") can be used to compensate for the elasticity of the filament and the extruder system. There are at least three sources of elasticity, the filament in a Bowden tube, the compression of the filament itself and the conversion of stepper rotation into torque itself lagging behind.
To counter affect an unwanted effect, you need a measure to change the unwanted effect so that after tuning the unwanted effect is gone.
The build-up of pressure in the nozzle (as a result of the springiness of the complete extrusion system causes the end of a line to over-extrude when movement slows or stops. Consequently, a lack of pressure at the beginning (first need to compress the filament) will result in a lack of filament at the nozzle.
In order to compensate, we use test prints, not sensors, in which the printer owner/tuner selects the best extruded line based on various settings of the pressure advance ratio. This works well, the extrusion system doesn't generally change over time unless you change the extruder, Bowden tube lengths, etcetera. There is no need for a sensor if you can determine how to counter the effect