小编ind*_*nds的帖子

音频流Python上的Google Streaming语音识别

我搜索了Google的所有可用文档,但我找不到Python中音频流上的流语音识别示例.

目前,我在Django中使用Python语音识别来获取用户的音频,然后收听音频.然后我可以保存文件并运行谷歌语音识别或直接从创建的音频实例.

有人可以指导我如何在音频流上执行流式语音识别吗?

python django audio google-speech-api

8
推荐指数
1
解决办法
1832
查看次数

Elasticsearch-dsl 嵌套查询

我在 Django 项目中使用 elasticsearch-dsl 库来索引数据,然后查询回来。

我有以下型号:

class Comments(models.Model):

    comment_id = models.CharField(max_length=1000,blank=True,null=True)
    user_post_id = models.ForeignKey('UserPosts',null=True)
    score =  models.CharField(max_length=1000,blank=True,null=True)
    text = models.TextField(blank=True,null=True)
    creation_date = models.CharField(max_length=1000,blank=True,null=True)


    def __unicode__(self):
        return self.comment_id

    def indexing(self):


        obj = CommentsIndex(
            meta={'id': self.id},
            comment_id=self.comment_id,
            user_post_id=self.user_post_id,
            score=self.score,
            text=self.text,
            creation_date=self.creation_date,
        )
        obj.save(index='comments-index')
        return obj.to_dict(include_meta=True)


class UserPosts(models.Model):

    user_post_id = models.CharField(max_length = 1000 , blank = True , null = True)
    user_post_type_id = models.CharField(max_length = 1000 , blank = True , null = True)
    accepted_answer_id = models.CharField(max_length = 1000 , blank = True …
Run Code Online (Sandbox Code Playgroud)

python django elasticsearch elasticsearch-dsl

5
推荐指数
1
解决办法
9106
查看次数