File size: 452 Bytes
3be6142 25e310b 3be6142 25e310b 3be6142 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from transformers import BartTokenizer
from idiomify.builders import TargetsBuilder
BATCH = [
("I could die at any moment", "I could kick the bucket at any moment"),
("Speak plainly", "Don't beat around the bush")
]
def main():
tokenizer = BartTokenizer.from_pretrained("facebook/bart-large")
builder = TargetsBuilder(tokenizer)
tgt_r, tgt = builder(BATCH)
print(tgt_r)
print(tgt)
if __name__ == '__main__':
main()
|