deepgram / deepgram-dotnet-sdk

.NET SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
28 stars 32 forks source link

Paragraphs is missing "speaker" and "num_words" property #313

Closed SandraRodgers closed 1 month ago

SandraRodgers commented 2 months ago

What is the current behavior?

When deserializing the transcription, it misses the speaker and num_words properties on the paragraph level. This bug was raised by a user in github discussions: https://github.com/orgs/deepgram/discussions/836

Steps to reproduce

Use these options in a prerecorded STT request:

var response = await deepgramClient.TranscribeUrl(
            new UrlSource(myUrl),
            new PreRecordedSchema()
            {
                Model = "nova-2",
                Language = "en",
                SmartFormat = true, 
                Punctuate = true, 
                Paragraphs = true, 
                Diarize = true,
            });

Expected behavior

CURL:

curl -X POST -H "Authorization: Token SECRET" -H "Content-Type: application/json" -d '{"url":"my-url"}' "https://api.deepgram.com/v1/listen?smart_format=true&punctuate=true&paragraphs=true&diarize=true&language=en&model=nova-2"

response:

"paragraphs": [
  {
    "sentences": [
      {
        "text": "So I think Marcus is joining us soon.",
        "start": 2.6399999,
        "end": 4.8199997
      },
      { "text": "Yeah.", "start": 4.88, "end": 5.38 }
    ],
    "speaker": 0,
    "num_words": 9,
    "start": 2.6399999,
    "end": 5.38

However, using .NET we see:

"paragraphs": [
  {
    "sentences": [
      {
        "text": "So I think Marcus is joining us soon.",
        "start": 2.6399999,
        "end": 4.8199997
      },
      { "text": "Yeah.", "start": 4.88, "end": 5.38 }
    ],
    "start": 2.6399999,
    "end": 5.38
  },

Please tell us about your environment

NET SDK (nuget version 4.0.2) (original report) NET 8.0 (@SandraRodgers env)

Other information

See original report at https://github.com/orgs/deepgram/discussions/836

dvonthenen commented 1 month ago

fixed in this release https://github.com/deepgram/deepgram-dotnet-sdk/releases/tag/4.0.3