Views
No views yet
"I I um want to to go to the the market" into fluent sentences: "I want to go to the market".1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
2
3# Load the model and tokenizer from Hugging Face Hub
4tokenizer = AutoTokenizer.from_pretrained("vamshi0310/finetuned-disfluency-correction")
5model = AutoModelForSeq2SeqLM.from_pretrained("vamshi0310/finetuned-disfluency-correction")
6
7# Example disfluent sentence
8sentence = "I I um want to to go to the the market"
9
10# Tokenize and generate corrected sentence
11inputs = tokenizer(f"correct disfluency: {sentence}", return_tensors="pt")
12outputs = model.generate(**inputs, max_length=256)
13corrected = tokenizer.decode(outputs[0], skip_special_tokens=True)
14
15print("Original:", sentence)
16print("Corrected:", corrected)