DEV Community

Cover image for Deepgram x DEV Hackathon Help Thread
dev.to staff for The DEV Team

Posted on

Deepgram x DEV Hackathon Help Thread

If you're participating in the Deepgram Hackathon on DEV, we’re so excited to have you joining us! Need some help with your submission or participation? You’re in the right spot.

If you have any questions about how this contest works (ex: due dates, how to post your submission, picking a category/challenge, etc.) the DEV team is here to help you.

How to Use This Thread

If you’ve browsed Deepgram’s documentation but need some help understanding or implementing a feature, @bekahhw from the Deepgram team will be here to jump in and assist you. This thread is a great resource for you whether you’re taking part in the “Build” or “Innovative Ideas” challenge.

Comment below if you need asynchronous assistance with the Deepgram Hackathon on DEV ❤️

Note: Don’t forget that we’re granting a special profile badge to anyone (outside of the DEV and Deepgram teams) who answers a question and to anyone who ASKS a technical question about Deepgram here in the help thread. Additionally, the DEV team will be randomly selecting one person per badge category to receive $50 USD to the Forem Shop! This goes for anyone in the DEV Community – whether you plan to submit an entry or not. For more information, take a look at the official contest rules here. DEV and Deepgram will wait to answer thread questions until we’ve given the community a chance to hop in.

Open Office Hours with Deepgram Devs

Deepgram will also be hosting open “office hours” on their Twitch Stream every Friday at 6:30 PM UTC throughout the contest (March 11, 18, & 25. April 1 & 8). During these streams, Deepgram will be addressing some of the questions asked in this thread and in the live Twitch chat. If they choose a question you posted to the help thread to talk about on the live stream, you'll be entered to win some Deepgram Swag!


If you'd like to share an update on the progress you're making on your project or if you'd like to connect with other participants, please do so in the Community Discussion Thread!

Latest comments (118)

Collapse
 
mhasan profile image
Mahmudul Hasan

I was treid to make a Live speech Transcript project, but failed due to unknown error. Can someone please help me on that?

This show in the browser console:
This is error

Here is my GitHub link: github.com/mhasanmeet/DEEPGRAM-liv...

Collapse
 
michaeljolley profile image
Michael Jolley

Nice! I can help with that.

It looks like the credentials you're sending are incorrect.

image

That code looks like you're sending the API Key Id rather than the API Key. When you create an API key, be sure you're copying the key itself. You should see a screen like below. You can click that copy icon to copy the actual key. Be sure to copy it, because you won't be able to see it again for security purposes.

image

Collapse
 
mhasan profile image
Mahmudul Hasan

Thanks Micheal, I'm gonna try it again. I'm really exicited about this Deepgram project. I have so much idea, I will implement one by one. And thanks, you guys already made some awesome demo projects, it really helpful!

Thread Thread
 
michaeljolley profile image
Michael Jolley

Awesome! I can't wait to see what you build. Be sure to reach out if I can help!

Collapse
 
rutamhere profile image
Rutam Prita Mishra • Edited

Hello @michaeljolley and DG Team 👋

I just wanted to know do we have any examples where we are writing the transcripts to a separate output file instead of showing the complete json on the console. And by transcript, I mean the only part in the json output that contains the text sentences.

Moreover, let me know how to make sure we scan through the complete length of the audio we are passing instead of just a part of it.

Thanks in advance.

Collapse
 
michaeljolley profile image
Michael Jolley

Hiya @21rutam! Good question. Let me make sure I give you the right answer.

First, are you using one of our SDKs? If so, which one?
Second, are you trying to save the whole payload or just the words?

Collapse
 
rutamhere profile image
Rutam Prita Mishra • Edited

Yeah, I am using NodeJS to do the job. I want to just save the transcript part of the response payload. And do let me know if we can define the duration of the audio for scanning (Complete audio or Just for a timeframe)
CC: @michaeljolley

Thread Thread
 
michaeljolley profile image
Michael Jolley

You can't define the duration. The API will try to transcribe the entire audio file every time, not just a section.

Using the Node SDK, you could send your request with the utterances feature turned on. (e.g. utterances:true)

Then, when the transcription comes back you can use the .toSRT() or .toWebVTT() functions to generate a text based version of the transcript with timestamps. Then you'd want to save it locally using fs.

Example:

const { Deepgram } = require('@deepgram/sdk');
const fs = require('fs');

const deepgram = new Deepgram(DEEPGRAM_API_KEY)
const audioSource = { url: URL_OF_FILE };

deepgram.transcription.preRecorded(audioSource, {
  punctuate:  true,
  utterances: true,
  // other options are available
})
.then((response) => {
  const srtTranscript = response.toSRT();

  fs.writeFile(FILENAME_TO_SAVE, srtTranscript, function (err) {
    if (err) {
      return console.log(err);
    }
    console.log("The file was saved!");
  });
})
.catch((err) => {
  console.log(err);
});

Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
rutamhere profile image
Rutam Prita Mishra • Edited

That was real quick. But I don't really want it like a subtitles file. Rather I just want the transcript text to be saved to the file and not anything else. I am talking about the sentences in that transcript: part (the one marked in purple).
CC: @michaeljolley

Thread Thread
 
michaeljolley profile image
Michael Jolley

You could just use the transcript property itself:

const { Deepgram } = require('@deepgram/sdk');
const fs = require('fs');

const deepgram = new Deepgram(DEEPGRAM_API_KEY)
const audioSource = { url: URL_OF_FILE };

deepgram.transcription.preRecorded(audioSource, {
  punctuate:  true,
  // other options are available
})
.then((response) => {
  const srtTranscript =response.results.channels[0].alternatives[0].transcript;

  fs.writeFile(FILENAME_TO_SAVE, srtTranscript, function (err) {
    if (err) {
      return console.log(err);
    }
    console.log("The file was saved!");
  });
})
.catch((err) => {
  console.log(err);
});
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
rutamhere profile image
Rutam Prita Mishra

Thanks a bunch @michaeljolley . You rock 🙌🚀

Collapse
 
anika001 profile image
Anika Tibrewala

Hi, can we submit one project under multiple categories?

Collapse
 
sandy_codes_py profile image
Santhosh (sandy inspires)

I guess so. But it should be in one category mostly tho.

Collapse
 
anika001 profile image
Anika Tibrewala

Okay, thanks!

Collapse
 
fp profile image
FrankPohl

Hi,
I'm using the DeepGram standard recognition service without an additional model.
I have a problem with the recognition of "weight" and "wait". Often "wait" is recognized instead of "weight". Is there a way to enhance the probability for "Weight" because in the use case it is true for 99 percent of the cases?
Or is this just a problem of me not being a native speaker?
Frank

Collapse
 
michaeljolley profile image
Michael Jolley • Edited

That's an amazing question @fp! You can add some "weight" to the word "weight". (See what I did there. 😁)

You'd want to use the keywords feature. If I remember correctly, you're using the .NET SDK, so here's how you'd set that up:

var options = new LiveTranscriptionOptions()
{
    Punctuate = false,
    Diarize = false,
    Numerals = true,
    Encoding = Deepgram.Common.AudioEncoding.Linear16,
    Language = "en-US",
    InterimResults = true,
    SampleRate = 44100,
    Keywords = new string[1] {"weight"}
};
Enter fullscreen mode Exit fullscreen mode
Collapse
 
fp profile image
FrankPohl • Edited

Thanks @michaeljolley that's exactly what I was looking. Unfortunately this raises :
Deepgram Error: Unexpected character encountered while parsing value: [. Path 'keywords', line 1, position 82.
when the StartConnectionAsync method is called.
The error is raised in line 44 in Helpers.cs
t = JsonConvert.DeserializeObject>(json);

Collapse
 
mrbuddesigner profile image
Mr. Bud

Hey there @michaeljolley, hope you all are doing great!

Just curious about the Article Template DEV has presented. I think I can change the heading and the other things according to need, and of course, including the everything mentioned.

Am I right? Thanks!

Collapse
 
michaeljolley profile image
Michael Jolley

You're 100% right!

Collapse
 
miguelmj profile image
MiguelMJ

Hello there! I hope everyone is doing well and having fun. I am having it for sure!

But I need some help... If I think I've posted a submission under the wrong category. Is it OK if I edit the submission post and change the category? The first time I read the categories description I didn't fully got the idea 😅

Thanks in advance!

Collapse
 
michaeljolley profile image
Michael Jolley

Absolutely! You can make changes until midnight UTC on April 11th. So feel free to tweak until you're satisfied!

Collapse
 
muriithigakuru profile image
Muriithi Gakuru

I wish I'd discovered this thread sooner. I had a lot of questions and bugs.

Collapse
 
michaeljolley profile image
Michael Jolley

There's still a few days. Anything I can help with?

Collapse
 
muriithigakuru profile image
Muriithi Gakuru

Yes please...how to hide the api key so that it cannot be exposed to the public.

Thread Thread
 
michaeljolley profile image
Michael Jolley

Sure thing. @_phzn wrote a great blog post on doing just that.
developers.deepgram.com/blog/2022/...

Collapse
 
kithminiii profile image
Bhagya Kithmini

Hello. Are we allowed to create a API wrappers using Deepgram, in this hackathon ?

Collapse
 
michaeljolley profile image
Michael Jolley

By API wrapper, are you talking about an SDK? I'd love to hear more about this idea.

Collapse
 
sandy_codes_py profile image
Santhosh (sandy inspires)

You just need to use Deepgram in your code for this hackathon mostly.

Collapse
 
minsu profile image
Minsu

Hi! First of all, Love the idea of this hackathon! Thanks for hosting, Deepgram :)

I have question about real-time transcript with deepgram(node.js SDK).

I tried this tutorial below
developers.deepgram.com/documentat...

I am wondering if there is a way to use 'opus stream' audio instead of 'url' here in the tutorial for transcription??

Thank you!

Collapse
 
michaeljolley profile image
Michael Jolley

Solid question. Normally you wouldn't want to send a stream from a URL in, you'd be accessing a microphone and streaming that audio in. I haven't tried opus stream specifically, but you can certainly try it. Is there a reason you need opus stream? That seems like an unusual format for live streaming.

Collapse
 
minsu profile image
Minsu • Edited

Thanks for reply Michael! yeah We use opus because we are building a real time transcription discord bot for deaf gamers! And discord.js uses opus as a format… My teammates gave up in the middle so I don’t think I can finish it by 11th but still wants to get this one done :)

Thread Thread
 
michaeljolley profile image
Michael Jolley

That's amazing! So I think you may can stream that in but you'd want to make sure you specify the encoding, sample rate, etc. in your request.

Collapse
 
gulshanaggarwal profile image
Gulshan Aggarwal

How can I use multiple keywords feature with Deepgram SDK?

Collapse
 
bekahhw profile image
BekahHW
Collapse
 
bekahhw profile image
BekahHW

You can add them as an array.

So it would look something like this:

transcript = await deepgram.prerecorded.transcribe(
{
url: "http://your_url.com",
},
{
keywords: ['keyword1', 'keyword2', 'keyword3'], 
})
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
gulshanaggarwal profile image
Gulshan Aggarwal

Oh! yeah, thanks for sharing.

Collapse
 
gulshanaggarwal profile image
Gulshan Aggarwal

Hey @bekahhw actually the link you mentioned(for keywords feature) only provides implementation through API call, not for SDK however I could find it on my own.