nickduran / align-linguistic-alignment

Python library for extracting quantitative, reproducible metrics of multi-level alignment between two speakers in naturalistic language corpora.
MIT License
40 stars 12 forks source link

Surrogate Data #53

Open AdrianaChieng opened 2 years ago

AdrianaChieng commented 2 years ago

Hi, I couldn't generate surrogate data. Can i get some advice please?

Surrogate Data

It's written index out of range

nickduran commented 2 years ago

Hi! Many thanks for providing a screen capture of the problem. I know exactly what the issue is as this happens to me all the time. There is no problem with the code, but the issue is with your filenames. When you call the calculate_baseline_alignment function, you need to make sure that the following three parameters are reflected in your filenames:

id_separator='\_',
dyad_label='dyad',
condition_label='cond')

That is, if your filename is something like 504-2.txt, this isn't going to work. You need it to be explicitly labeled dyad504_cond2.txt. And pay attention to the underscore vs. dash in separating the dyad info and the condition info.

Because this is such a common issue, I have now added a raise Exception comment that will flag this issue to the user.

Thanks for using ALIGN and helping to make it better. I'm back to improving ALIGN and adding new features.