如何自动从AssemblyAI中删除转录。

huangapple go评论71阅读模式
英文:

how do i delete transcripts automatically from assemblyai

问题

我目前正在使用命令行生成文字记录。我该如何定期从服务器上删除这些文字记录?

我目前正在使用本地的 Python 文件。

我需要一种方法,可以自动化排除最后的 10 条文字记录,最好是按 ID 数量,或者如果不行,按日期排除。

英文:

I'm currently using cmd line to generate transcripts. How would i go abotu periodically deleting transcripts from their servers?

I'm currently using local python files

I need some kind of method i can automate that excludes the last 10, ideally by ID count, or failing that by date somehow?

答案1

得分: 1

从API中检索分段的转录文本

endpoint = f"https://api.assemblyai.com/v2/transcript/{transcript_id}"

使用标头向API端点发出DELETE请求

response = requests.delete(endpoint, headers=headers)
print(response.json())

英文:

https://www.assemblyai.com/docs/Models/speech_recognition#deleting-transcripts-from-the-api

It’s in their docs. But essentially:

# Retrieving transcript broken down into paragraphs
endpoint = f"https://api.assemblyai.com/v2/transcript/{transcript_id}"

# Make a DELETE request to the API endpoint with the headers
response = requests.delete(endpoint, headers=headers)
print(response.json())

huangapple
  • 本文由 发表于 2023年5月6日 16:21:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/76187872.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定