how to increase accuracy of transcription in stt n...
# ask-ai
w
how to increase accuracy of transcription in stt node?
t
Thanks for reaching out, Sunil. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hey there! To help boost transcription accuracy in the STT Node, here are a few friendly tips you can try out: • Set the
operating_point
to `enhanced`:
This gives accuracy a little extra love over speed, which usually leads to better results. • Use `additional_vocab`: Toss in any special terms or phrases you often use to help the system recognize your unique vocabulary. • Double-check your language settings: Make sure the
language
parameter (like "en") is set right, and you can also set
output_locale
if you want region-specific formatting. • Don’t cut down
max_delay
too much:
Keeping it at the default 1.0 seconds or a bit higher helps keep things accurate. • Turn on speaker diarization if you need it: Use
enable_diarization
and tweak related settings to help separate different speakers better. • Go for final transcripts: Prioritize final results over partial ones to get the clearest output. Here’s a quick example in code:
Copy code
from livekit.plugins.speechmatics import STT

stt_engine = STT(
    operating_point=OperatingPoint.ENHANCED,
    language="en",
    additional_vocab=[{"content": "LiveKit"}],
)
These little tweaks can make a big difference in transcription accuracy. If you want a hand with anything else, just give me a shout! Sources: Speechmatics STT integration guide | LiveKit Docs | Speechmatics STT integration guide | LiveKit Docs | Voice pipeline nodes | LiveKit Docs | Pipeline nodes and hooks | LiveKit Docs | livekit-plugins/livekit-plugins-speechmatics/livekit/plugins/speechmatics/s...
w
give me complete code as to how to create a session with an agent using these configuration
t
Here’s a complete example to help you create a session with an agent using STT Node configurations:
Copy code
from livekit.agents import AgentSession
from livekit.plugins.speechmatics import STT
from livekit.plugins.openai import LLM
from livekit.plugins.cartesia import TTS
from livekit.plugins.silero import VAD

# Initialize the STT instance with configurations
stt_instance = STT(
    operating_point=OperatingPoint.ENHANCED,
    language="en",
    additional_vocab=[{"content": "LiveKit"}]
)

# Initialize other components (LLM, TTS, VAD)
llm_instance = LLM()
tts_instance = TTS()
vad_instance = VAD.load()

# Create the AgentSession
session = AgentSession(
    stt=stt_instance,
    llm=llm_instance,
    tts=tts_instance,
    vad=vad_instance,
    min_endpointing_delay=0.5,
    max_endpointing_delay=6.0
)

# Start the session (example context required)
await session.start(agent=my_agent, room=ctx.room)
Just make sure you’ve got all the necessary plugins installed and your API keys set up. If you hit any snags or want to chat more about it, I’m here to help! Sources: examples/voice_agents/restaurant_agent.py | Speech-to-text (STT) integrations | LiveKit Docs