Featured Posts

ライセンスについて OpenHRIのライセンスは、Eclipse Public License (EPL)です。 http://www.eclipse.org/legal/epl-v10.html EPLは、コードの改変や再配布、営利利用を許可するオープンソースライセンスですが、場合によっては改変内容をライセンス元に開示する必要があります。 OpenHRIが内部で用いているJuliusやOpen...

Readmore

OpenHRIとは OpenHRIは、音声認識・音声合成・対話制御など、ロボットのコミュニケーション機能の実現に必要な各要素を実現するコンポーネント群です。 フリーで利用できる各オープンソースソフトウェアを使い易いコンポーネントとしてまとめました。

Readmore

ソフトウェアのインストール方法 ソフトウェアのインストールおよび利用方法については、チュートリアルの各ページを参考にしてください。http://openhri.net/tutorial

Readmore

公開しました OpenHRIのソフトウェアおよびWebページの公開を開始しました。

Readmore

  • Prev
  • Next

マルチリンガル対話システム

 

「マルチリンガル対話システム」は、複数の言語でしゃべることができる対話システムのことです。

ここでは、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」とそれぞれ発音してみてください。