Last active
November 2, 2018 07:16
-
-
Save Syuparn/5085c3e107ab3481be2727d857ef0399 to your computer and use it in GitHub Desktop.
Praatの音声アノテーション(.TextGrid)を自動生成 ref: https://qiita.com/Syuparn/items/d86e77c39527539b16c5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ julius --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python convert_label.py path/to/dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
change segmentation unit to mora? (default:phoneme) y/n: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ file -i sample.txt | |
sample.txt: text/plain; charset=utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl segment_julius.pl path/to/dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python segment_recursively.py dir/to/path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python convert_label.py path/to/dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
change segmentation unit to mora? (default:phoneme) y/n: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0.0000000 0.1850000 silB | |
0.1850000 0.2745000 h | |
0.2745000 0.3870000 o | |
0.3870000 0.4455000 g | |
0.4455000 0.6415000 e | |
0.6410000 0.7097500 silE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File type = "ooTextFile" | |
Object class = "TextGrid" | |
xmin = 0 | |
xmax = 0.7097500 | |
tiers? <exists> | |
size = 1 | |
item []: | |
item [1]: | |
class = "IntervalTier" | |
name = "phoneme" | |
xmin = 0 | |
xmax = 0.7097500 | |
intervals: size = 6 | |
intervals [1]: | |
xmin = 0.0000000 | |
xmax = 0.1850000 | |
text = "" | |
intervals [2]: | |
xmin = 0.1850000 | |
xmax = 0.2745000 | |
text = "h" | |
intervals [3]: | |
xmin = 0.2745000 | |
xmax = 0.3870000 | |
text = "o" | |
intervals [4]: | |
xmin = 0.3870000 | |
xmax = 0.4455000 | |
text = "g" | |
intervals [5]: | |
xmin = 0.4455000 | |
xmax = 0.6415000 | |
text = "e" | |
intervals [6]: | |
xmin = 0.6410000 | |
xmax = 0.7097500 | |
text = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
きょーわいいてんきだ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## data directory | |
if ($ARGV[0]){ | |
$datadir = $ARGV[0]; | |
} else { | |
$datadir = "./wav"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import sys | |
args = sys.argv | |
for dirpath, dirnames, filenames in os.walk(args[1]): | |
subprocess.call(['perl', 'segment_julius.pl', dirpath]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment