Views
No views yet
1from transformers import pipeline
2# Initialize the pipeline for masked language model
3unmasker = pipeline('fill-mask', model='dsfsi/zabantu-ven-120m')
4
5sample_sentences = ["Rabulasi wa <mask> u khou bvelela nga u lima",
6 "Vhana vhane vha kha ḓi bva u bebwa vha kha khombo ya u <mask> nga Listeriosis"]
7
8# Perform the fill-mask task
9results = unmasker(sentence)
10# Display the results
11for result in results:
12 print(f"Predicted word: {result['token_str']} - Score: {result['score']}")
13 print(f"Full sentence: {result['sequence']}\n")
14 print("=" * 80)
15