<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Detection of Typical Sentence Errors in Speech Recognition Output</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Bohan Wang</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ke Wang</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Siran Li</string-name>
          <email>siran.li@epfl.ch</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mark Cieliebak</string-name>
          <email>ciel@zhaw.ch</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="editor">
          <string-name>Lugano, Switzerland</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centre for Artificial Intelligence, Zurich University of Applied Sciences (ZHAW)</institution>
          ,
          <addr-line>Winterthur</addr-line>
          ,
          <country country="CH">Switzerland</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Section of Electrical and Electronic Engineering, École Polytechnique Fédérale (EPFL)</institution>
          ,
          <addr-line>Lausanne</addr-line>
          ,
          <country country="CH">Switzerland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper presents a deep learning based model to detect the completeness and correctness of a sentence. It's designed specifically for detecting errors in speech recognition systems and takes several typical recognition errors into account, including false sentence boundary, missing words, repeating words and false word recognition. The model can be applied to evaluate the quality of the recognized transcripts, and the optimal model reports over 90.5% accuracy on detecting whether ∗Corresponding author. †These authors contributed equally.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        the system completely and correctly recognizes a sentence.
correct sentence boundaries in whole transcripts [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. experimental results in Sec. 4.
      </p>
    </sec>
    <sec id="sec-2">
      <title>1. Introduction</title>
      <p>
        Automatic Speech Recognition (ASR) systems develop
technologies to recognize and translate spoken language
into text by machines [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Sentence error detection on
ASR systems is important for the two reasons: a) This
can help to set proper punctuation marks; b) For multiple
speakers, speaker recognition often fails at the change
between two speakers, which results in single words at
beginning or end of an utterance being assigned to the
wrong person. A practical application domain of our
work is to detect complete and correct sentences in ASR
systems to mitigate the aforementioned problems.
      </p>
      <p>
        In prior works, research focused mainly on
grammatical error detection [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ]. In this paper, we focus on
dealing with the specific errors emerging in speech
recognition, such as missing words or incorrect sentence
boundaries (detailed in Sec. 3.3). In addition, previous works
on enriching speech recognition emphasize on finding
However, in real-time speech recognition, we have access
to only individual sentences instead of full transcripts,
and they don’t take other typical speech recognition
errors (apart from incorrect sentence boundaries) into
account [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        Recently, transformer models have shown state-of-art
performance in generating word embeddings and
extracting intrinsic features of word sequences. In specific,
Bidirectional Encoder Representations from Transformers
(BERT) [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], Generative Pre-trained Transformer (GPT)
[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and BIG-BIRD [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] have achieved promising
perfor
      </p>
      <p>The paper is structured as follows: In Sec. 2, we
explain the models and experimental design. In Sec. 3, we
describe how the dataset is generated. We discuss the
2.</p>
    </sec>
    <sec id="sec-3">
      <title>Methods</title>
      <sec id="sec-3-1">
        <title>2.1. Models</title>
        <p>
          In this section, we use three state-of-art transformer
models BERT [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], GPT2 [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ], BIG-BIRD [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] are considered.
        </p>
        <p>
          Besides, we also test the performance of using BERT
embedding plus a downstream text classification
network. For the classification networks, we use either a
bi-direction LSTM and a TextCNN. We use a one-layer
TextCNN with kernels sizes to be 2, 3 and 4. For LSTM,
we use a one-layer bi-directional LSTM network [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ],
followed by an attention layer and a fully connected layer.
The number of hidden states is 256. Specifically, the
attention layer is found to be essential.
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>2.2. Ensemble learning</title>
        <p>We ensemble the five trained classifiers with random
forest. Configuration and the final classification
performance are shown in Sec. 4.2.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>3. Data preparation</title>
      <sec id="sec-4-1">
        <title>3.1. Dataset sources</title>
        <p>For the model to have better generalizing capacity, a
training set from diverse sources covering diverse topics
and occasions is necessary. The following corpora are
included in our proposed dataset:</p>
        <p>
          News reports [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]: 143, 000 articles from 15 American
publications
        </p>
        <p>
          Ted 2020 Parallel Sentences Corpus [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]: around 4000
TED Talk transcripts from July 2020
        </p>
        <p>Wikipedia corpus [13]: over 10 million topics
Topical-Chat [14]: nearly 10 thousand human dialog
conversations spanning 8 broad topics</p>
      </sec>
      <sec id="sec-4-2">
        <title>3.2. Dataset Creation</title>
        <p>To make the selected datasets suit our speech recognition
model, we remove some non-English tokens, sentence
ending symbols (‘.’, ‘!’, ‘?’), duplicated sentences and also
short sentences (less or equal to 5 words) to avoid some
recognition errors. After pre-processing on the data from
the sources, we create the following two datasets:</p>
        <p>Standard Dataset: contains 0.3 million sentences
from News reports, 0.3 million sentences from Ted
corpus, 0.3 million sentences from Wikipedia corpus, 0.2
million sentences from Topical-Chat, in total 1.1 million
sentences. We split the Standard Dataset randomly over
all data sources into train set, ablation set and test set,
with a proportion of 8:1:1.</p>
        <p>Large Dataset: contains 2.3 million sentences from
News reports, 0.4 million sentences from Ted corpus,
2 million sentences from Wikipedia corpus, 0.2 million
sentences from Topical-Chat; in total 5 million sentences.
We split it into train and test set, with a proportion of
19:1.</p>
        <p>We train and compare performances of various models
on the Standard Dataset. As a comparison, we evaluate
the performance of BERT trained on the large dataset to
see how an enlarged training set afects generalization
ability for this task.</p>
      </sec>
      <sec id="sec-4-3">
        <title>3.3. Generate positive and negative samples</title>
        <p>For creating positive samples, punctuation is removed
(except abbreviations such as it’s, Mr., I’ve, etc.) and
words are converted to lower case.</p>
        <p>For creating negative samples, we mimic typical errors
of the speak recognition system, which are detailed in
the following, and we propose corresponding methods
to create negative samples with respect to typical errors.</p>
        <p>False sentence boundary: When a speech
recognition system fails to correctly separate two sentences, the
ifrst sentence would be cut of in the middle and part
of the sentence would be assigned to the next sentence
(illustrated in Fig. 1 (a)). For such negative samples, we
group the sentences by three, and randomly separate
the three sentences into 2-4 sentences (so that on
average negative samples created in this way would have
equal length with positive samples). While choosing
random separating points, the genuine sentence separations
points, punctuation and typical words for starting
subsentences (e.g. that, which, because, etc.) are avoided,
and thus reduce the probability that a generated sample
is still a complete sentence by chance (e.g. ‘I like you
because you are beautiful’ to ‘I like you’.)</p>
        <p>Missing words: A speech recognition system can fail
to recognize one or several words from a sentence, and
as a result some words may be missing in the produced
transcripts (Fig. 1 (b)). For such negative samples, we
randomly remove 1 word for sentences up to 3 words,
and 2-4 words from longer sentences.</p>
        <p>Repeating words: The system can record speakers’
unintended repeated words (Fig. 1 (c)). For such negative
samples, we randomly repeat 1 word for sentences within
3 words, and 1-3 words from longer sentences.</p>
        <p>False word recognition: The system can mistakenly
recognize one word as another word (Fig. 1 (d)). For
such negative samples, we randomly replace 1 word for
sentences within 3 words, and 1-3 words from a longer
sentences, by random words from another sentence.</p>
        <p>Finally, the punctuation is removed and words are
converted to lower case.</p>
        <p>After creating the positive and negative samples, the
sentences longer than 100 words are removed, for they
are too long to appear in speech recognition. We create
the same number of negative samples as that of positive
samples, so that we have a balanced dataset. The ratio
between diferent types of negative samples is 2:1:1:1. The
type False Sentence Boundary corresponds to two times
In this section, we report the results of our experiments.
We describe below the setup, and then evaluate the
different models in Sec. 4.1. In Sec. 4.2, based on the models,
we train a Random Forest classifier to further aggregate
the models and improve the performance. In Sec. 4.3, we
compare the performance of BERT trained on Standard
and Large Dataset. Finally, we show the result of BERT
trained on a Multi-Labeled Dataset in Sec. 4.4.</p>
        <p>Training details: We train each model for 5 epochs
with batch size 64 using Adam optimizer. The initial
learning rate is set as 3 − 5 for fine-tuning transformer
models and 1 −3 for downstream classification networks.
To prevent overfitting, we only save the model with
optimal performance on test set after each epoch.</p>
      </sec>
      <sec id="sec-4-4">
        <title>4.1. Results on Standard Dataset</title>
        <p>the number of other negative sample types since False forest classifier can generate a final classification through
Sentence Boundary contains two types of false sentences, a majority vote mechanism.
those which are cut of and those which are assigned To prevent random forest from overfitting the train
with extra words. set, we use a separate ablation set, instead of the train set
which the models are trained on. The best parameters
after 10-fold cross-validation are 100 decision trees, and
4. Experiments and Discussion a maximum depth of 3. The test accuracy of the random
forest reaches 90.51%, higher than the optimal accuracy
among the individual models (90.26%), but not to a large
extent. This is probably since the transformers (along
with their embedding) share similar structures and do
not diverge much on decisions.</p>
      </sec>
      <sec id="sec-4-5">
        <title>4.3. Results on Large Dataset</title>
        <p>In this section, we train BERT on the large dataset (5 times
the size of the Standard Dataset) with less epochs (1 epoch
in contrast to 5 epochs). Overall, the model is trained
with the same iterations as with Standard Dataset. With
the same training details described before (but only for
one epoch), results show that training with Large Dataset
provides a higher test accuracy (90.36%), compared with
the accuracy trained with Standard Dataset (89.27%).</p>
        <p>The results suggest that, provided with enough
computational capacity, we can further improve our model’s
generalization ability by training on a larger dataset.
with missing words, even though in most of the cases
more than one word is missing in the erroneous
sentences. This is understandable because in most cases, not
every word is indispensable, even we lose some words,
and maybe the meaning is not exactly the same but the
sentence still makes sense grammatically.</p>
      </sec>
      <sec id="sec-4-6">
        <title>4.5. Result on real-world ASR outputs</title>
        <p>Finally we test our trained multi-modal BERT model on
the real-world ASR outputs from CEASR corpus [15]. The
predictions are shown in Fig. 3, where we can see the
model is able to capture real-world ASR errors correctly,
while we also provide an example where the model fails.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>In this paper, a dataset for detecting speech recognition
errors was created, where four diferent types of
typical speech recognition errors were taken into account.
Experimental results show that transformer models are
capable of providing good performance on classification
of the constructed dataset for speech recognition error,
reporting approximately 90% accuracy for BERT, GPT2
and BIG-BIRD. A Random Forest was trained based on
the five models, and further improved the test accuracy
to over 90.51%. Overall, the results suggest that using
state-of-art transformer models can provide good quality
for detecting the errors in speech recognition systems,
and provide feedback on further improvements of speech
recognition systems. In our future works, special
adjustments might be needed to better cope with identifying
missing words in recognized sentences.
[13] W. Foundation, Wikimedia downloads, ???? URL:
https://dumps.wikimedia.org.
[14] K. Gopalakrishnan, B. Hedayatnia, Q. Chen,
A. Gottardi, S. Kwatra, A. Venkatesh, R. Gabriel,
D. Hakkani-Tür, A. A. AI, Topical-chat: Towards
knowledge-grounded open-domain conversations.,
in: INTERSPEECH, 2019, pp. 1891–1895.
[15] M. A. Ulasik, M. Hürlimann, F. Germann, E. Gedik,
F. Benites de Azevedo e Souza, M. Cieliebak, Ceasr:
a corpus for evaluating automatic speech
recognition, in: 12th Language Resources and Evaluation
Conference (LREC) 2020, European Language
Resources Association, 2020, pp. 6477–6485.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>D.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Deng</surname>
          </string-name>
          ,
          <article-title>Automatic speech recognition</article-title>
          , volume
          <volume>1</volume>
          , Springer,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>N.</given-names>
            <surname>Agarwal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Wani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Bours</surname>
          </string-name>
          ,
          <article-title>Lex-pos featurebased grammar error detection system for the English language</article-title>
          ,
          <source>Electronics</source>
          <volume>9</volume>
          (
          <year>2020</year>
          )
          <fpage>1686</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Z.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <article-title>English grammar error detection using recurrent neural networks</article-title>
          ,
          <source>Scientific Programming</source>
          <year>2021</year>
          (
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Shriberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Stolcke</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Hillard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ostendorf</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Harper</surname>
          </string-name>
          ,
          <article-title>Enriching speech recognition with automatic detection of sentence boundaries and disfluencies</article-title>
          ,
          <source>IEEE Transactions on Audio, Speech, and Language Processing</source>
          <volume>14</volume>
          (
          <year>2006</year>
          )
          <fpage>1526</fpage>
          -
          <lpage>1540</lpage>
          . doi:
          <volume>10</volume>
          .1109/TASL.
          <year>2006</year>
          .
          <volume>878255</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Stolcke</surname>
          </string-name>
          , E. Shriberg,
          <string-name>
            <given-names>M.</given-names>
            <surname>Harper</surname>
          </string-name>
          ,
          <article-title>Using conditional random fields for sentence boundary detection in speech</article-title>
          ,
          <source>in: Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics (ACL'05)</source>
          ,
          <year>2005</year>
          , pp.
          <fpage>451</fpage>
          -
          <lpage>458</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>D.</given-names>
            <surname>Tuggener</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Aghaebrahimian</surname>
          </string-name>
          ,
          <article-title>The Sentence End and Punctuation Prediction in NLG text (SEPPNLG) shared task 2021</article-title>
          , in: Swiss Text Analytics Conference-SwissText
          <year>2021</year>
          , Online,
          <fpage>14</fpage>
          -
          <lpage>16</lpage>
          June 2021, CEUR Workshop Proceedings,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J.</given-names>
            <surname>Devlin</surname>
          </string-name>
          , M.-
          <string-name>
            <given-names>W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Toutanova</surname>
          </string-name>
          , Bert:
          <article-title>Pre-training of deep bidirectional transformers for language understanding</article-title>
          , arXiv preprint arXiv:
          <year>1810</year>
          .
          <volume>04805</volume>
          (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Radford</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Child</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Luan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Amodei</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Sutskever</surname>
          </string-name>
          , et al.,
          <article-title>Language models are unsupervised multitask learners</article-title>
          ,
          <source>OpenAI blog 1</source>
          (
          <year>2019</year>
          )
          <article-title>9</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Zaheer</surname>
          </string-name>
          , G. Guruganesh,
          <string-name>
            <given-names>K. A.</given-names>
            <surname>Dubey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Ainslie</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Alberti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ontanon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Pham</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ravula</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Yang</surname>
          </string-name>
          , et al.,
          <string-name>
            <surname>Big</surname>
            <given-names>Bird</given-names>
          </string-name>
          :
          <article-title>Transformers for Longer Sequences</article-title>
          ., in: NeurIPS,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>F. A.</given-names>
            <surname>Gers</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Schmidhuber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Cummins</surname>
          </string-name>
          ,
          <article-title>Learning to forget: Continual prediction with lstm</article-title>
          ,
          <source>Neural computation 12</source>
          (
          <year>2000</year>
          )
          <fpage>2451</fpage>
          -
          <lpage>2471</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>A.</given-names>
            <surname>Thompson</surname>
          </string-name>
          , All the news:
          <volume>143</volume>
          ,000 articles from
          <issue>15 American publications</issue>
          , =https://www.kaggle.com/snapcrack/all-the-news,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>N.</given-names>
            <surname>Reimers</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Gurevych</surname>
          </string-name>
          ,
          <article-title>Making monolingual sentence embeddings multilingual using knowledge distillation</article-title>
          , arXiv preprint arXiv:
          <year>2004</year>
          .
          <volume>09813</volume>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>