I am trying to run ‘Alternative at position’ the decoding feature of Ctranslate2 but getting in the translated alternative sentences. Could you please tell me where i am doing mistake and how I can resolve this issue.
import ctranslate2 translator = ctranslate2.Translator("ende_ctranslate2/") Input = "This project is geared towards efficient serving of standard translation models but is also a place for experimentation around model compression and inference acceleration." def tokenize(data): return data.split(" ") def detokenize(data): return " ".join(data) results = translator.translate_batch( [tokenize(Input)], target_prefix=[tokenize("Dieses Prokekt ist auf die")], num_hypotheses=5, return_alternatives=True) for hypothesis in results: print(detokenize(hypothesis["tokens"]))
Output after run about script
I tried with different input english sentences and getting this result.