Spanish medical model #896
Replies: 5 comments 2 replies
-
Thanks for asking your question about Deepgram! If you didn't already include it in your post, please be sure to add as much detail as possible so we can assist you efficiently, such as:
|
Beta Was this translation helpful? Give feedback.
-
The Here is the code I use: import os
from dotenv import load_dotenv
import logging
from deepgram.utils import verboselogs
from datetime import datetime
import httpx
from deepgram import (
DeepgramClient,
DeepgramClientOptions,
PrerecordedOptions,
FileSource,
)
load_dotenv()
AUDIO_FILE = "audios/1.wav"
DEEPGRAM_API_KEY = os.getenv("DEEPGRAM_API_KEY")
words = [
...
]
keywords = [f"{word.lower()}:3" for word in words]
def main():
try:
# STEP 1 Create a Deepgram client using the API key in the environment variables
config: DeepgramClientOptions = DeepgramClientOptions(
verbose=verboselogs.SPAM,
)
deepgram: DeepgramClient = DeepgramClient(DEEPGRAM_API_KEY, config)
# OR use defaults
# deepgram: DeepgramClient = DeepgramClient()
# STEP 2 Call the transcribe_file method on the rest class
with open(AUDIO_FILE, "rb") as file:
buffer_data = file.read()
payload: FileSource = {
"buffer": buffer_data,
}
options: PrerecordedOptions = PrerecordedOptions(
model="nova-2",
language="es-419",
dictation=True,
punctuate=True,
keywords=keywords,
)
before = datetime.now()
response = deepgram.listen.rest.v("1").transcribe_file(
payload, options, timeout=httpx.Timeout(300.0, connect=10.0)
)
after = datetime.now()
print(response.to_json(indent=4))
print("")
difference = after - before
print(f"time: {difference.seconds}")
except Exception as e:
print(f"Exception: {e}")
if __name__ == "__main__":
main() |
Beta Was this translation helpful? Give feedback.
-
@rmasad if you are interested in custom model training for advanced key word use cases that is something available to our Enterprise Customers only at this time. I can put you in touch with someone to discuss that option with you, just let me know. I'm also curious if a Spanish medical model be what you are actually in need of instead of custom model training. |
Beta Was this translation helpful? Give feedback.
-
I checked your documentation and it seems that the medical model is not available in Spanish for testing. |
Beta Was this translation helpful? Give feedback.
-
Coming back to this. Is it part of your plans to include medical model in Spanish? |
Beta Was this translation helpful? Give feedback.
-
I'm trying Deepgram as an alternative for medical voice recognition in Spanish. Other APIs (such as Watson, Google and Azure) allow you to upload sample texts so that the best word can be selected depending on the context.
I see that Deepgram can use keywords, but it is limited, both in quantity, and when testing it, I see that it replaces words that do not make sense in that context.
Is there an alternative?
Beta Was this translation helpful? Give feedback.
All reactions