Analysis of Alibaba Cloud Lingji (Platform) Model Service

Introduction:  DashScope model service is centered on models, and is committed to providing AI application developers with a wide range of models to choose from, and provides them with out-of-the-box, excellent capabilities, and cost-effective model service APIs. DashScope Lingji model service relies on the high-quality models of Bodhidharma Academy and other institutions, and is built on the Alibaba Cloud infrastructure. The public beta of the Lingji service was launched on 4.11. Currently, it provides the API capability of Paraformer speech recognition. In the future, Tongyi Qianwen will also provide the API capability through this service. This article demonstrates how to quickly access services through the Python SDK to facilitate rapid Mass development.

Alibaba Cloud Lingji Platform Official Website: DashScope Lingji Model Service https://dashscope.aliyun.com/

1. Activate Lingji service

Console address , follow the prompts to log in and activate normally.

picture.png

picture.png

2. Install the SDK and call the service

  • 2.1 Install the SDK
pip install dashscope
Note : python requires 3.7+
  • 2.2 Code Sample
# For prerequisites running the following sample, visit https://help.aliyun.com/document_detail/611472.html

import dashscope
from urllib import request
import json

dashscope.api_key='ReaNkZ*************F4CD99C11ED9B2EB2ED6BC5D65D'

task_response=dashscope.audio.asr.Transcription.async_call(
    model='paraformer-v1',
    file_urls=['https://*****.oss-cn-shanghai.aliyuncs.com/%E5%A5%94%E8%B7%91.mp3']
    )

transcription_response=dashscope.audio.asr.Transcription.wait(task=task_response.output.task_id)

transcription_url=transcription_response.output['results'][0]['transcription_url']
transcription_results=json.loads(request.urlopen(transcription_url).read().decode('utf8'))
print(json.dumps(transcription_results, indent=4, ensure_ascii=False))

picture.png

Judging from the test results, the overall accuracy of the model is still very high, and users can provide models based on specific scenarios.

picture.png

More references

Install DashScope SDK
ParaformerSpeech Recognition API Details

Guess you like

Origin blog.csdn.net/English0523/article/details/132447847