Posts Tagged ‘sox’

Import of prompts 01 failed

Tuesday, October 13th, 2009

This is what I am currently doing: I checked out revision 1040.

I want to import the prompts 01 into simon. First, I had to convert the 40 flac files into wav files with the following command:

liberty@liberty-desktop:~/200910/editing-ralfherzog/01$ for f in *.flac; do sox "$f" -t wav -r 16000 -s -c 1 "subfolder/${f%.flac}.wav"; done

Then I transformed the file http://script.blau.in/german/01/prompts.xml into (almost) HTK compatible format with the following command:

liberty@liberty-desktop:~/200910/editing-ralfherzog/01$ saxonb-xslt -ext:on -o:PROMPTS01 -xsl:transform-ssml-prompts.xsl -s:prompts.xml

The stylesheet transform-ssml-prompts.xsl has the following content:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- 20091013; license: GPL -->
<xsl:output method="text"/>
<xsl:template match="speak">
<xsl:for-each select="audio">
<xsl:value-of select="replace(@src, 'flac','wav')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="."/><xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

I think that I found an error. I forgot to capitalize the prompts with the XPath expression upper-case(). I will have to correct the stylesheet. Probably that is the reason why the Import Trainingsdata function didn’t work out.

Capital letter at beginning of sentence

Sunday, October 11th, 2009

I want to import prompts into simon. Let’s say, I want to import the German prompts 01. The following problems occur:

1. Convert flac to wav. I will do this with the following command: $ for f in *.flac; do sox "$f" -t wav -r 16000 -s -c 1 "converted/${f%.flac}.wav"; done
Problem solved.

2. Convert the SSML file into a normal prompts file (HTK format). I will solve this with an XSLT stylesheet. Problem solved.

3. One problem still remains: What is to do with the capital letters at the beginning of each sentence? I don’t want to add the following bold marked words to the dictionary:

Hast du mich verstanden?
Ich habe dich jetzt verstehen können.
Der Schmerz wird mit der Zeit nachlassen.

How could this issue be solved? I don’t want to convert the words at the beginning of each sentence into lowercase manually.

Maybe it would be possible to do some kind of matching? This matching could look like this: If a word in a prompts file is capitalized at the beginning of a sentence (Hast, Ich , Der), then check whether an uncapitalized version of this word is available in the dictionary (hast, ich, der).

I want to train several thousand sentences with simon/sam. These are normal sentences with capitalized letters. How is it possible to uncapitalize a letter at the beginning of a sentence if it is not a noun?