Closed SantiDianaClibrain closed 4 months ago
Hi @SantiDianaClibrain
You can find topics are off the result
object:
https://github.com/deepgram/deepgram-python-sdk/blob/main/deepgram/clients/prerecorded/v1/response.py#L533-L534
and metadata
object:
https://github.com/deepgram/deepgram-python-sdk/blob/main/deepgram/clients/prerecorded/v1/response.py#L109-L111
@SantiDianaClibrain were you able to get this working?
Closing issue since not getting a response. Please reopen if you want to revisit the issue.
Still not working when detect_topics=True.
Why do you say topics are off, @dvonthenen ? Do we need to manually edit the metadata.py and response.py to make it work ?
No, there shouldn't be any need to to manually edit anything.
Can you verify this works for you? https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/prerecorded/topic/main.py
After you run this, can you take note of where the topics are in the result. They are located at:
topics = result.results.topics
No, there shouldn't be any need to to manually edit anything.
Can you verify this works for you? https://github.com/deepgram/deepgram-python-sdk/blob/main/examples/prerecorded/topic/main.py
After you run this, can you take note of where the topics are in the result. They are located at:
topics = result.results.topics
No, I haven't. But i just had a quick glance. The option is topics=True
. In the Deepgram documentation it says it should be detect_topics=True
. Maybe this is the problem. I'll check now.
That was it. It works now. But to clarify: It wasn't in the docs where I saw detect_topics=True
but in the Playground's Python snippet. There you have the following:
# https://playground.deepgram.com/?summarize=v2&detect_topics=true&smart_format=true&diarize=true&language=en&model=nova-2&file=FILE
def main():
try:
deepgram = DeepgramClient(DEEPGRAM_API_KEY)
options = PrerecordedOptions(
model="nova-2",
language="en",
summarize="v2",
detect_topics=True,
smart_format=True,
diarize=True,
)
As you can see @SantiDianaClibrain also used the detect_topics=True
flag.
yea, that shouldn't be there. will remove that. thanks for point that out.
This update has been submitted for review.
Looks like there is another effort to fix this in the playground. Closing this issue out for now.
The flag detect_topics is set to True in PrerecordedOptions but it is not found in alternatives.
To be able to detect topics:
topics = result.results.channels[0].alternatives[0].topics[0].topics
Python SDK