Skip to content

A study on Word Sense Disambiguation for lexical-semantic error correction in Speech Recognition. Final thesis for the Master's Degree in Computer Science @ Sapienza University of Rome

Notifications You must be signed in to change notification settings

andrea-gasparini/asr-lexical-semantic-error-correction-study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage

Generate beam search predictions of a Wav2Vec 2.0 + LM model

from tagging import generate_librispeech_predictions
generate_librispeech_predictions("facebook/wav2vec2-base-960h")

Tag the predictions of a Wav2Vec 2.0 + LM with lemma and POS

python tagging.py preprocess --model-name wav2vec2-base-960h-4-gram --librispeech

Disambiguate the predictions with a pre-trained model (e.g. Escher)

git clone https://github.com/SapienzaNLP/esc.git && cd esc && bash setup.sh
PYTHONPATH=$(pwd) python esc/predict.py \
  --ckpt <escher_checkpoint.ckpt> \
  --dataset-paths ../data/predictions/wav2vec2-base-960h-4-gram-librispeech_test_all.data.xml \
  --prediction-types probabilistic

Train an 4-gram Language Model on the senses of a WSD dataset

python ngram.py --wsd-dataset-paths ../data/WSD_huge_corpus/ --ngram-size 4 --binary

Where the dataset-paths you provide to the model can be either:

  • in a format that follows the one introduced by Raganato et al. (2017)
  • jsonl files (or a directory containing them) with one json per line, which must have a labels key containing a list of BabelNet identifiers

Assign LM's scores to the senses of the disambiguated LibriSpeech predictions

python tagging.py scores \
  --wsd-dataset-path ../data/predictions/wav2vec2-base-960h-4-gram-librispeech_test_all.data.xml \
  --wsd-labels-path ../esc/predictions/wav2vec2-base-960h-4-gram-librispeech_test_all_predictions.txt \
  --ngram-model-path ../models/ngrams/4gram.arpa \
  --pmi-attrs-path ../models/pmi/pmi.json

About

A study on Word Sense Disambiguation for lexical-semantic error correction in Speech Recognition. Final thesis for the Master's Degree in Computer Science @ Sapienza University of Rome

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages