Counting filler words in a conversation
# support
d
I'm trying to do this: const [totalFillerWords, setTotalFillerWords] = useState(0); const fillerWords = ["um", "uh", "like", "you know"]; let fillerCount = 0; then const parseEvent = (message) => { const { type } = message; try { if (type === "transcript") { const { transcript, role } = message; console.log("transcript", role, transcript); fillerWords.forEach((filler) => { const regex = new RegExp(
\\b${filler}\\b
, "gi"); const matches = transcript.match(regex); if (matches) { fillerCount += matches.length; } }); // Log the filler count if (fillerCount > 0) { console.log(
Filler words count: ${fillerCount}
); setTotalFillerWords((prevCount) => prevCount + fillerCount); But since the transcriber logs the transcript iteratively like this: transcript user Um hi. index.jsx:568 transcript user Um hi there. index.jsx:568 transcript user Um hi there. How index.jsx:568 transcript user Um hi there. How's 3index.jsx:568 transcript user Um hi there. How's it going? fillerCount is going way higher than it should be. Is there some other way I can count filler words?
v
message has been deleted
d
Ideally I could count the word immediately when they say it and then not count it in the subsequent iterations of the sentence they're saying
These are the thing which get added into conversation.
d
Got it, this is good to know
But still, my goal is to count the number of times the user says filler words
s
I see.
d
Hey Sahil, I was able to use type === "transcript" && transcriptType === "final" to not get each iteration of the sentence and instead match filler words against the final sentence. I'm trying to enable filler words as per the deepgram documentation you shared with me but I'm not sure how to do that through VAPI. Is there a parameter I can use when initializing the agent?
s
Unfortunately No. We don’t have any parameters like that
d
Hi @Sahil I really need to be able to enable filler_words. Do you think it would be possible to request this? Or is there any other workaround that would allow me to count the filler words that a user says? https://developers.deepgram.com/docs/filler-words#enable-feature
s
fillerInjectionEnabled
you need to set this property as true
d
Is fillerInjection for the transcriber? I thought it was for adding filler words to the output. My goal is to count the filler words that a user says, not to add filler words to the agent's output
3 Views