1

Eclipse 用の Maven プラグインを使用して Sphinx4 を使用する方法を学習しています。

GitHub で見つけた書き起こしのデモを使用して、自分のファイルを処理するように変更しました。音声ファイルは 16bit、モノラル、16khz です。長さは約13秒です。スローモーションのように聞こえることに気付きました。

ファイルで話されている言葉は、「要求された場合にアップロードできるように、録音ファイルに簡単にアクセスできることも確認してください」です。

ファイルを転記しようとしていますが、結果は恐ろしいものです。結果を改善する方法、または私が正しく行っていないことを徹底的に説明するフォーラムの投稿またはリンクを見つけようとする私の試みは、どこにも行き着きませんでした.

書き起こしの精度を高めたいと考えていますが、現在のプロジェクトで処理する必要があるデータの種類が異なるため、自分でモデルをトレーニングする必要は避けたいと考えています。これは不可能ですか?私が使用しているコードはオフですか?

コード

(注: 音声ファイルはhttps://instaud.io/8qvで入手できます)

public class App {

public static void main(String[] args) throws Exception {
    System.out.println("Loading models...");

    Configuration configuration = new Configuration();

    // Load model from the jar
    configuration
            .setAcousticModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us");

    // You can also load model from folder
    // configuration.setAcousticModelPath("file:en-us");

    configuration
            .setDictionaryPath("resource:/edu/cmu/sphinx/models/en-us/cmudict-en-us.dict");
    configuration
            .setLanguageModelPath("resource:/edu/cmu/sphinx/models/en-us/en-us.lm.dmp");

    StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(
            configuration);
    FileInputStream stream = new FileInputStream(new File("/home/tmscanlan/workspace/example/vocaroo_test_revised.wav"));
   // stream.skip(44); I commented this out due to the short length of my file

    // Simple recognition with generic model
    recognizer.startRecognition(stream);
    SpeechResult result;

    while ((result = recognizer.getResult()) != null) {
        // I added the following print statements to get more information
        System.out.println("\ngetWords() before loop: " + result.getWords());
        System.out.format("Hypothesis: %s\n", result.getHypothesis());
        System.out.print("\nThe getResult(): " + result.getResult() 
                + "\nThe getLattice(): " + result.getLattice()); 

        System.out.println("List of recognized words and their times:");
        for (WordResult r : result.getWords()) {
            System.out.println(r);
        }

        System.out.println("Best 3 hypothesis:");
        for (String s : result.getNbest(3))
            System.out.println(s);

    }
    recognizer.stopRecognition();

    // Live adaptation to speaker with speaker profiles


    stream = new FileInputStream(new File("/home/tmscanlan/workspace/example/warren_test_smaller.wav"));
   // stream.skip(44); I commented this out due to the short length of my file

    // Stats class is used to collect speaker-specific data
    Stats stats = recognizer.createStats(1);
    recognizer.startRecognition(stream);
    while ((result = recognizer.getResult()) != null) {
        stats.collect(result);
    }
    recognizer.stopRecognition();

    // Transform represents the speech profile
    Transform transform = stats.createTransform();
    recognizer.setTransform(transform);

    // Decode again with updated transform
    stream = new FileInputStream(new File("/home/tmscanlan/workspace/example/warren_test_smaller.wav"));
   // stream.skip(44); I commented this out due to the short length of my file
    recognizer.startRecognition(stream);
    while ((result = recognizer.getResult()) != null) {
        System.out.format("Hypothesis: %s\n", result.getHypothesis());
    }
    recognizer.stopRecognition();


    System.out.println("...Printing is done..");
}
}

これが出力です(私が撮ったフォトアルバム):http://imgur.com/a/Ou9oH

4

1 に答える 1