-
Notifications
You must be signed in to change notification settings - Fork 17
Update track related functionalities #201
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
Conversation
Making sure related functions have consistent signatures.
|
|
||
| Example input section for a Praat script using Format 1:: | ||
|
|
||
| form Variables |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be good to have a simple script here that actually does something linguistically reasonable, and say what it does. Or, give a link to such a script.
I'm not clear as a reader what the script should do.
maybe a really simple example could be, get the average f0/pitch?
| with CorpusContext(config) as c: | ||
| c.encode_type_subset('phone', ['S', 'Z', 'SH', 'ZH'], 'sibilant') | ||
| c.analyze_script(subset='sibilant', annotation_type="phone", script_path='path/to/script/sibilant.praat') | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this is good.
I'd add explanation here in words, saying what this code block does:
- defines a subset of phones called "sibilants"
- uses a praat script that takes as input a filename and begin/end time, and outputs measures we'd like to take for sibilants
- the
analyze_scriptcall then applies this script to every phone of type "sibilant" in the corpus.
| c.config.praat_path = '/path/to/your/praat/executable' | ||
| props = [('H1_H2', float), ('H1_A1',float), ('H1_A2',float), ('H1_A3',float)] | ||
| c.analyze_track_script('voice_quality', props, script_path, annotation_type='phone') | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also good, but could you put the voice quality script somewhere?
then, say what this code is going to do, as I suggest for the sibilant call to analyze_script above.
it'll help to have the examples be really concrete -- so, the readeer can actually go look at the Praat scripts if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually do have this example in the tutorial I wrote with voice quality measures (including the Praat script). I can add a link here to the tutorial.
| - Print results to the Praat Info window in the following format: | ||
| - The first line begins with time, followed by space-separated column names. | ||
| - Subsequent lines contain timestamps and measurements for each property. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be good to have the example output here be consistent with the example in the code block below.
so either
- change "Example output" to be H1_H2, H1_A1, H1_A2, H1_A3
or - change the
analyze_track_scriptcall to be a formant measurement script.
|
|
||
| # Alternatively, call the get function directly; it will encode the statistic if not already available | ||
| results = c.get_acoustic_statistic('formants', 'mean', by_annotation='phone', by_speaker=True) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add verbal explanation after this code block (or put in comments) explaining what this code did.
msonderegger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great -- tons of work here. I added some suggestions on the new documentation.
This update introduces improvements to several functions related to acoustic track analysis and measurement encoding.
Code changes:
analyze_track_script: Now supports user-specified annotation types(phone,syllable,word,utterance) for analysis._save_measurement_tracks: Save word/syllable labels for the track to the influxdb_save_measurement: Save word/syllable labels for the track to the influxdbencode_acoustics_statistic: Modified to support aggregation over annotations beyond phones (word, syllable).get_acoustics_statistic: Query logic updated to align with the encode function changes.relativize_acoustic_measure: Relativization can be performed over annotations beyond phones (follows from the encode statistic function changes)Docs changes:
analyze_scriptandanalyze_track_script.get_acoustic_statisticandencode_acoustics_statistic.