Module 'onmt.inputters' has no attribute 'build_dataset'

I am trying to get attention weights for a model trained using opennmt-py. The most recent discussion I have found is at How to visualize attention weights?. I have managed to do some workarounds to get the first part to work, but when I reach

data = onmt.inputters.build_dataset(fields, "text", None, use_filter_pred=False, src_path='/home/Desktop/exp-training-window-10hidden-att/raw/window-50/test_src_lang1.csv')

It refers to a non-existing function.

module 'onmt.inputters' has no attribute 'build_dataset'

What is the alternative in the present version?

A post was merged into an existing topic: Getting attention weights