マルチリンガル対話システム
Contents
「マルチリンガル対話システム」は、複数の言語でしゃべることができる対話システムのことです。
ここでは、2つのJuliusコンポーネントを使って実現する例を示します。
利用するコンポーネント
この例では、以下のコンポーネントを利用します。
AudioInput, AudioOutputコンポーネント
Juliusコンポーネント
combineresultコンポーネント
SEATコンポーネント
OpenJTalkコンポーネント
認識文法・対話スクリプトの準備
<?xml version="1.0" encoding="UTF-8" ?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/06/grammar
http://www.w3.org/TR/speech-grammar/grammar.xsd"
xml:lang="jp"
version="1.0" mode="voice" root="command">
<lexicon uri="sample-lex.xml"/>
<rule id="command">
<one-of>
<item>おはよう</item>
<item>こんにちは</item>
<item>こんばんは</item>
<item>バイバイ</item>
<item>さようなら</item>
</one-of>
</rule>
</grammar><?xml version="1.0" encoding="UTF-8"?>
<lexicon version="1.0"
xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd"
alphabet="kana" xml:lang="jp">
<lexeme>
<grapheme>おはよう</grapheme>
<phoneme>{{KANA|おはよう}}</phoneme>
</lexeme>
<lexeme>
<grapheme>こんにちは</grapheme>
<phoneme>{{KANA|こんにちわ}}</phoneme>
</lexeme>
<lexeme>
<grapheme>こんばんは</grapheme>
<phoneme>{{KANA|こんばんわ}}</phoneme>
</lexeme>
<lexeme>
<grapheme>バイバイ</grapheme>
<phoneme>{{KANA|ばいばい}}</phoneme>
</lexeme>
<lexeme>
<grapheme>さようなら</grapheme>
<phoneme>{{KANA|さようなら}}</phoneme>
</lexeme>
</lexicon><?xml version="1.0" encoding="UTF-8" ?>
<grammar xmlns="http://www.w3.org/2001/06/grammar"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/06/grammar
http://www.w3.org/TR/speech-grammar/grammar.xsd"
xml:lang="en"
version="1.0" mode="voice" root="command">
<lexicon uri="sample-en-lex.xml"/>
<rule id="command">
<one-of>
<item>hello</item>
<item>good afternoon</item>
<item>good evening</item>
<item>good bye</item>
<item>bye</item>
</one-of>
</rule>
</grammar><?xml version="1.0" encoding="UTF-8"?>
<lexicon version="1.0"
xmlns="http://www.w3.org/2005/01/pronunciation-lexicon"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2005/01/pronunciation-lexicon
http://www.w3.org/TR/2007/CR-pronunciation-lexicon-20071212/pls.xsd"
alphabet="ARPAbet" xml:lang="en">
<lexeme>
<grapheme>evening</grapheme>
<phoneme>{{ARPABET|iy v n ix ng}}</phoneme>
</lexeme>
<lexeme>
<grapheme>good</grapheme>
<phoneme>{{ARPABET|g uh d}}</phoneme>
</lexeme>
<lexeme>
<grapheme>afternoon</grapheme>
<phoneme>{{ARPABET|ae f t er n uw n}}</phoneme>
</lexeme>
<lexeme>
<grapheme>bye</grapheme>
<phoneme>{{ARPABET|b ay}}</phoneme>
</lexeme>
<lexeme>
<grapheme>hello</grapheme>
<phoneme>{{ARPABET|hh ax l ow}}</phoneme>
</lexeme>
</lexicon><?xml version="1.0" encoding="UTF-8"?>
<seatml>
<general name="sample">
<agent name="speechin" type="rtcin" datatype="TimedString" />
<agent name="speechout" type="rtcout" datatype="TimedString" />
</general>
<state name="OPEN">
<rule>
<key>おはよう</key>
<command host="speechout">おはよう</command>
</rule>
<rule>
<key>こんにちは</key>
<command host="speechout">こんにちは</command>
</rule>
<rule>
<key>こんばんは</key>
<command host="speechout">こんばんは</command>
</rule>
<rule>
<key>バイバイ</key>
<command host="speechout">バイバイ</command>
</rule>
<rule>
<key>さようなら</key>
<command host="speechout">さようなら</command>
</rule>
<rule>
<key>hello</key>
<command host="speechout">ハロー</command>
</rule>
<rule>
<key>good afternoon</key>
<command host="speechout">グッドアフタヌーン</command>
</rule>
<rule>
<key>good evening</key>
<command host="speechout">グッドイブニング</command>
</rule>
<rule>
<key>bye</key>
<key>good bye</key>
<command host="speechout">バイバイ</command>
</rule>
</state>
</seatml>コンポーネントの起動
各コンポーネントを起動します。それぞれの端末上で、以下のコマンドを実行してください。
% pulseaudioinput
(Ubuntu9.10以前の場合は、portaudioinputを使います)
% juiusrtc sample.grxml sample-en.grxml
% combineresultrtc
% seat sample-m18n.seatml
% openjtalkrtc
% pulseaudiooutput
(Ubuntu9.10以前の場合は、portaudiooutputを使います)
ネームサービスビューに以下のコンポーネントが表示されていることを確認してください(Juliusコンポーネントは二つ表示されます)。
コンポーネントの接続
すべてのコンポーネントをエディタ画面に配置し、各コンポーネント間に以下のリンクを作成します。
- pulseaudioinput -> juliusrtc1
- pulseaudioinput -> juliusrtc2
- juliusrtc1(result) -> combineresultrtc(result1)
- juliusrtc1(status) -> combineresultrtc(status1)
- juliusrtc2(result) -> combineresultrtc(result2)
- juliusrtc2(status) -> combineresultrtc(status2)
- combineresultrtc(result) -> seat
- seat -> openjtalkrtc
- openjtalkrtc -> pulseaudiooutput
リンクを作成すると、以下のスクリーンショットのようになります。
テスト
コンポーネントをアクティベートした後、「こんにちは」「hello」とそれぞれ発音してみてください。









AIST
OpenRTM-aist