-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get indecies of I,D,S #90
Comments
With the following code import jiwer
ref = "I trying to get indecies for words subtituted, inserted and deleted I found the alignments.alignment_chunk and seems not bad but it"
hyp = "for words"
r = jiwer.process_words(ref, hyp)
for a in r.alignments[0]:
print(a) you get these allignment chunks:
meaning that in the reference, index 0, 1, 2, 3 and 4 are deleted, as well as index 7, ..., 20. Note here that the This can also be observed with a call to import jiwer
ref = "I trying to get indecies for words subtituted, inserted and deleted I found the alignments.alignment_chunk and seems not bad but it"
hyp = "for words"
r = jiwer.process_words(ref, hyp)
print(jiwer.visualize_alignment(r, show_measures=False)) which returns
|
thanks :) hyp = 'why couple apple hotel banana with the Paris police' the result: I want to get the indexes of the words for every type (S,D,I) and its look abit tricky |
You can get the index arrays like follows:
Yes, this seems expected, and I don't see the issue. |
I trying to get indecies for words subtituted, inserted and deleted I found the alignments.alignment_chunk and seems not bad but it always give index depand on hypo text.
for example
if the referance is :
" I trying to get indecies for words subtituted, inserted and deleted I found the alignments.alignment_chunk and seems not bad but it "
and the hypo is: "for words"
the number of word deleted is right but indecies of deletion depand on length of hypo, I mean word in index 7 in refance was deleted and I didnt get it in alignment_chunk.
Do you have some way to get the all indecies in the sentece were deleted?
The text was updated successfully, but these errors were encountered: