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
Refactor: factor algorithm out of server; bundle resource lookups into a single object #99
Conversation
serve.py now contains no logic for dealing with the resources, building queues, running the multiple passes, etc. It just runs the aligner/transcriber and displays the output. NB I haven’t been able to test the FullTranscriber since I don’t have the relevant HCLG file
This looks great! I've been experimenting with ways to use Gentle programatically from python, but hadn't settled on a strategy yet. Two issues to discuss:
Let me know what you think about these points, and we can figure out how to complete the merge. |
Great, glad you like this direction!
I don't have a specific thought as to where to put the resources. But I wonder whether the
(and really What do you think about all that?
Oh good to know thanks. I'll get the file and try it out. (Next week :)
Yes, that seems like it would make sense. I guess via optional parameters for starting time and length in the wavefile? Would it also make sense to have start and length in the transcript? And/or an easy way to specify a single wavefile and transcript and support the ability to do a partial alignment then later continue where that alignment left off? (I haven't used alignment in practice yet to have a good sense for important use cases.) BTW, ultimately for the project I'm looking at I'd need to do everything in C++ without Python, so at some point I'll be reimplementing the core alignment algorithm in C++, directly calling Kaldi. Let me know if that's something you'd want contributed back here--subject to my client OK'ing releasing the C++ code that is. |
rather than to_csv(data) and to_json(data) that know about the structure of the data.
Needed a small fix, but it's working now. |
I've gone a little farther with the refactoring & encapsulation:
Hope you approve |
… resampling really are gentle-specific. also provide context manager version that creates a tempfile
Thanks so much for this and sorry it took me so long to finish testing. Big code quality improvements! |
Hi, thanks for making Gentle available!
I'm looking into using Gentle, but without running a server. This PR includes:
align.py
, a shell command that runs the forced alignment algorithm and outputs JSONserve.py
, creating two classesForcedAligner
andFullTranscriber
GentleResources
instance which I pass around; and once I had that I propagated it into the other bits of code that used those resources.I took my best shot at organizing and naming and whatnot, but of course I'm open to changes that'd you'd find more suitable.
[Oh I should also point out that I haven't tested
FullTranscriber
since the install didn't seem to includedata/graph/HCLG.fst
. It "should" work since the code is just moved over from where it had been earlier, but of course bugs could have easily crept in.]