Suppose I have a word $w$ in the standard generators $\sigma_1,\dots,\sigma_{n-1}$ of the braid group $B_n$ representing an element which we know belongs to the pure braid group $P_n$, is there an algorithm that allows us to figure out what the image of $w$ is in the abelianization $\mathbb{Z}^\binom{n}{2}$ of $P_n$? I assume that first, we would need to write $w$ in terms of the generators $$A_{i,j} = (\sigma_{j-1}\dots\sigma_{i+1})\sigma_i^2(\sigma_{j-1}\dots\sigma_{i+1})^{-1}$$ of $P_n$, but I am wondering if there is a more direct algorithm? If not, is there an algorithm, say, implementable on a computer, which can rewrite $w$ in terms of the $A_{i,j}$?
Thank you very much for any suggestions!