The following code from the tutorial throws an error:
with CorpusContext(config) as c:
c.analyze_formant_points()
File "<stdin>", line 1, in <module>
File "<string>", line 2, in <module>
File "/usr/local/lib/python3.9/site-packages/polyglotdb-1.2.0a1-py3.9.egg/polyglotdb/corpus/base.py", line 217, in __getattr__
raise (GraphQueryError(
polyglotdb.exceptions.GraphQueryError: The graph does not have any annotations of type 'analyze_formant_points'. Possible types are: phone, syllable, utterance, word
When I check the attributes of CorpusContext(config), the list does not include analyze_formant_points, analyze_formant_points_refinement or analyze_formant_tracks_refinement (but it does include analyze_formant_tracks). I can, however, run the formant analysis as follows:
from polyglotdb.acoustics.formants.base import analyze_formant_points
from polyglotdb.acoustics.formants.helper import save_formant_point_data
with CorpusContext('taiwanese_mandarin') as c:
c.config.praat_path = "/Applications/Praat.app/Contents/MacOS/Praat"
save_formant_point_data(c, analyze_formant_points(c))
Note also that I have to manually save the output of the formant measurement algorithm using save_formant_point_data(). That is not the case for analyze_formant_points_refinement(), which automatically adds them as phone-level annotations (in fact, I can see that save_formant_point_data() is called from within that function):
from polyglotdb.acoustics.formants.refined import analyze_formant_points_refinement
with CorpusContext('taiwanese_mandarin') as c:
c.config.praat_path = "/Applications/Praat.app/Contents/MacOS/Praat"
analyze_formant_points_refinement(c)
Sorry, this may be two separate issues, and I'm not sure if it's a bug or if I'm not doing sth as intended – but thought it's worth flagging!
The following code from the tutorial throws an error:
When I check the attributes of
CorpusContext(config)
, the list does not includeanalyze_formant_points
,analyze_formant_points_refinement
oranalyze_formant_tracks_refinement
(but it does includeanalyze_formant_tracks
). I can, however, run the formant analysis as follows:Note also that I have to manually save the output of the formant measurement algorithm using
save_formant_point_data()
. That is not the case foranalyze_formant_points_refinement()
, which automatically adds them as phone-level annotations (in fact, I can see thatsave_formant_point_data()
is called from within that function):Sorry, this may be two separate issues, and I'm not sure if it's a bug or if I'm not doing sth as intended – but thought it's worth flagging!