Skip to content

Commit ad023f0

Browse files
committed
moving text
1 parent 10910f0 commit ad023f0

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

articles/cognitive-services/Speech-Service/includes/speech-to-text-container-query-endpoint.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ speech_config = speechsdk.SpeechConfig(
4141
subscription=speech_key, region=service_region)
4242
```
4343

44+
---
45+
46+
#### Analyze sentiment on the speech-to-text output
47+
48+
Starting in v2.2.0 of the speech-to-text container, you can analyze sentiment on the output using the Text Analytics API. To call sentiment analysis, you will need a Text Analytics resource endpoint. For example:
49+
* `https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0-preview.1/sentiment`
50+
* `https://localhost:5000/text/analytics/v3.0-preview.1/sentiment`
51+
52+
If you're accessing a Text analytics endpoint in the cloud, you will need a key. If you're running Text Analytics locally, you may not need to provide this.
53+
54+
The key and endpoint are passed to the Speech container as arguments, as in the following example.
55+
56+
```bash
57+
docker run -it --rm -p 5000:5000 \
58+
containerpreview.azurecr.io/microsoft/cognitive-services-speech-to-text:latest \
59+
Eula=accept \
60+
Billing={ENDPOINT_URI} \
61+
ApiKey={API_KEY} \
62+
CloudAI:SentimentAnalysisSettings:TextAnalyticsHost={TEXT_ANALYTICS_HOST} \
63+
CloudAI:SentimentAnalysisSettings:SentimentAnalysisApiKey={SENTIMENT_APIKEY}
64+
```
65+
4466
to this call using the container [host](https://docs.microsoft.com/python/api/azure-cognitiveservices-speech/azure.cognitiveservices.speech.speechconfig?view=azure-python):
4567

4668
```python
@@ -66,8 +88,6 @@ speech_config.set_service_property(
6688
)
6789
```
6890

69-
### Disable Sentiment analysis in the API response
70-
7191
To disable sentiment analysis from appearing in the API response, regardless of other properties specified:
7292

7393
```python

articles/cognitive-services/Speech-Service/speech-container-howto.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -254,27 +254,6 @@ This command:
254254
* Exposes TCP port 5000 and allocates a pseudo-TTY for the container.
255255
* Automatically removes the container after it exits. The container image is still available on the host computer.
256256

257-
### Call sentiment analysis with the speech container
258-
259-
Starting in v2.2.0 of the speech services container, you can call v3 of the Sentiment Analysis API on the speech-to-text output. To call sentiment analysis, you will need a Text Analytics resource endpoint. For example:
260-
* `https://westus2.api.cognitive.microsoft.com/text/analytics/v3.0-preview.1/sentiment`
261-
* `https://localhost:5000/text/analytics/v3.0-preview.1/sentiment`
262-
263-
If you're accessing a Text analytics endpoint in the cloud, you will need a key. If you're running Text Analytics locally, you may not need to provide this.
264-
265-
The key and endpoint are passed to the Speech container as arguments, as in the following example.
266-
267-
```bash
268-
docker run -it --rm -p 5000:5000 \
269-
containerpreview.azurecr.io/microsoft/cognitive-services-speech-to-text:latest \
270-
Eula=accept \
271-
Billing={ENDPOINT_URI} \
272-
ApiKey={API_KEY} \
273-
CloudAI:SentimentAnalysisSettings:TextAnalyticsHost={TEXT_ANALYTICS_HOST} \
274-
CloudAI:SentimentAnalysisSettings:SentimentAnalysisApiKey={SENTIMENT_APIKEY}
275-
```
276-
277-
278257
# [Custom Speech-to-text](#tab/cstt)
279258

280259
The *Custom Speech-to-text* container relies on a custom speech model. The custom model has to have been [trained](how-to-custom-speech-train-model.md) using the [custom speech portal](https://speech.microsoft.com/customspeech).

0 commit comments

Comments
 (0)