Skip to content

Commit b429e36

Browse files
authored
Merge pull request #216759 from aahill/bigdata-update
removing bing content
2 parents 2ad71e2 + f1c596b commit b429e36

File tree

2 files changed

+2
-97
lines changed

2 files changed

+2
-97
lines changed

articles/cognitive-services/big-data/samples-python.md

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mhamilton723
66
manager: nitinme
77
ms.service: cognitive-services
88
ms.topic: sample
9-
ms.date: 08/16/2022
9+
ms.date: 11/01/2022
1010
ms.author: marhamil
1111
ms.devlang: python
1212
---
@@ -19,7 +19,6 @@ The samples in this article use these Cognitive Services:
1919

2020
- Language service - get the sentiment (or mood) of a set of sentences.
2121
- Computer Vision - get the tags (one-word descriptions) associated with a set of images.
22-
- Bing Image Search - search the web for images related to a natural language query.
2322
- Speech-to-text - transcribe audio files to extract text-based transcripts.
2423
- Anomaly Detector - detect anomalies within a time series data.
2524

@@ -41,8 +40,6 @@ from mmlspark.cognitive import *
4140

4241
# A general Cognitive Services key for the Language service and Computer Vision (or use separate keys that belong to each service)
4342
service_key = "ADD_YOUR_SUBSCRIPION_KEY"
44-
# A Bing Search v7 subscription key
45-
bing_search_key = "ADD_YOUR_SUBSCRIPION_KEY"
4643
# An Anomaly Dectector subscription key
4744
anomaly_key = "ADD_YOUR_SUBSCRIPION_KEY"
4845

@@ -120,52 +117,6 @@ display(analysis.transform(df).select("image", "analysis_results.description.tag
120117
| https://raw.githubusercontent.com/Azure-Samples/cognitive-services-sample-data-files/master/ComputerVision/Images/house.jpg | ['outdoor' 'grass' 'house' 'building' 'old' 'home' 'front' 'small' 'church' 'stone' 'large' 'grazing' 'yard' 'green' 'sitting' 'leading' 'sheep' 'brick' 'bench' 'street' 'white' 'country' 'clock' 'sign' 'parked' 'field' 'standing' 'garden' 'water' 'red' 'horse' 'man' 'tall' 'fire' 'group']
121118

122119

123-
## Bing Image Search sample
124-
125-
[Bing Image Search](../bing-image-search/overview.md) searches the web to retrieve images related to a user's natural language query. In this sample, we use a text query that looks for images with quotes. It returns a list of image URLs that contain photos related to our query.
126-
127-
```python
128-
from pyspark.ml import PipelineModel
129-
130-
# Number of images Bing will return per query
131-
imgsPerBatch = 10
132-
# A list of offsets, used to page into the search results
133-
offsets = [(i*imgsPerBatch,) for i in range(100)]
134-
# Since web content is our data, we create a dataframe with options on that data: offsets
135-
bingParameters = spark.createDataFrame(offsets, ["offset"])
136-
137-
# Run the Bing Image Search service with our text query
138-
bingSearch = (BingImageSearch()
139-
.setSubscriptionKey(bing_search_key)
140-
.setOffsetCol("offset")
141-
.setQuery("Martin Luther King Jr. quotes")
142-
.setCount(imgsPerBatch)
143-
.setOutputCol("images"))
144-
145-
# Transformer that extracts and flattens the richly structured output of Bing Image Search into a simple URL column
146-
getUrls = BingImageSearch.getUrlTransformer("images", "url")
147-
148-
# This displays the full results returned, uncomment to use
149-
# display(bingSearch.transform(bingParameters))
150-
151-
# Since we have two services, they are put into a pipeline
152-
pipeline = PipelineModel(stages=[bingSearch, getUrls])
153-
154-
# Show the results of your search: image URLs
155-
display(pipeline.transform(bingParameters))
156-
```
157-
158-
### Expected result
159-
160-
| url |
161-
|:-------------------------------------------------------------------------------------------------------------------|
162-
| https://iheartintelligence.com/wp-content/uploads/2019/01/powerful-quotes-martin-luther-king-jr.jpg |
163-
| http://everydaypowerblog.com/wp-content/uploads/2014/01/Martin-Luther-King-Jr.-Quotes-16.jpg |
164-
| http://www.sofreshandsogreen.com/wp-content/uploads/2012/01/martin-luther-king-jr-quote-sofreshandsogreendotcom.jpg |
165-
| https://everydaypowerblog.com/wp-content/uploads/2014/01/Martin-Luther-King-Jr.-Quotes-18.jpg |
166-
| https://tsal-eszuskq0bptlfh8awbb.stackpathdns.com/wp-content/uploads/2018/01/MartinLutherKingQuotes.jpg |
167-
168-
169120
## Speech-to-Text sample
170121
The [Speech-to-text](../speech-service/index-speech-to-text.yml) service converts streams or files of spoken audio to text. In this sample, we transcribe two audio files. The first file is easy to understand, and the second is more challenging.
171122

articles/cognitive-services/big-data/samples-scala.md

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: mhamilton723
66
manager: nitinme
77
ms.service: cognitive-services
88
ms.topic: sample
9-
ms.date: 10/28/2021
9+
ms.date: 11/01/2022
1010
ms.author: marhamil
1111
ms.devlang: scala
1212
---
@@ -19,7 +19,6 @@ The samples use these Cognitive Services:
1919

2020
- Language service - get the sentiment (or mood) of a set of sentences.
2121
- Computer Vision - get the tags (one-word descriptions) associated with a set of images.
22-
- Bing Image Search - search the web for images related to a natural language query.
2322
- Speech-to-text - transcribe audio files to extract text-based transcripts.
2423
- Anomaly Detector - detect anomalies within a time series data.
2524

@@ -112,51 +111,6 @@ display(analysis.transform(df).select(col("image"), col("results").getItem("tags
112111
| https://raw.githubusercontent.com/Azure-Samples/cognitive-services-sample-data-files/master/ComputerVision/Images/dog.jpg | ['dog' 'outdoor' 'fence' 'wooden' 'small' 'brown' 'building' 'sitting' 'front' 'bench' 'standing' 'table' 'walking' 'board' 'beach' 'white' 'holding' 'bridge' 'track']
113112
| https://raw.githubusercontent.com/Azure-Samples/cognitive-services-sample-data-files/master/ComputerVision/Images/house.jpg | ['outdoor' 'grass' 'house' 'building' 'old' 'home' 'front' 'small' 'church' 'stone' 'large' 'grazing' 'yard' 'green' 'sitting' 'leading' 'sheep' 'brick' 'bench' 'street' 'white' 'country' 'clock' 'sign' 'parked' 'field' 'standing' 'garden' 'water' 'red' 'horse' 'man' 'tall' 'fire' 'group']
114113

115-
## Bing Image Search
116-
117-
[Bing Image Search](../bing-image-search/overview.md) searches the web to retrieve images related to a user's natural language query. In this sample, we use a text query that looks for images with quotes. It returns a list of image URLs that contain photos related to our query.
118-
119-
120-
```scala
121-
import org.apache.spark.ml.Pipeline
122-
123-
// Number of images Bing will return per query
124-
val imgsPerBatch = 10
125-
126-
// A list of offsets, used to page into the search results
127-
val df = (0 until 100).map(o => Tuple1(o*imgsPerBatch)).toSeq.toDF("offset")
128-
129-
// Run the Bing Image Search service with our text query
130-
val bingSearch = new BingImageSearch()
131-
.setSubscriptionKey(bingSearchKey)
132-
.setOffsetCol("offset")
133-
.setQuery("Martin Luther King Jr. quotes")
134-
.setCount(imgsPerBatch)
135-
.setOutputCol("images")
136-
137-
// Transformer that extracts and flattens the richly structured output of Bing Image Search into a simple URL column
138-
val getUrls = BingImageSearch.getUrlTransformer("images", "url")
139-
140-
// This displays the full results returned, uncomment to use
141-
// display(bingSearch.transform(bingParameters))
142-
143-
// Since we have two services, they are put into a pipeline
144-
val pipeline = new Pipeline().setStages(Array(bingSearch, getUrls))
145-
146-
// Show the results of your search: image URLs
147-
display(pipeline.fit(df).transform(df))
148-
```
149-
150-
### Expected result
151-
152-
| url |
153-
|:-------------------------------------------------------------------------------------------------------------------|
154-
| https://iheartintelligence.com/wp-content/uploads/2019/01/powerful-quotes-martin-luther-king-jr.jpg |
155-
| http://everydaypowerblog.com/wp-content/uploads/2014/01/Martin-Luther-King-Jr.-Quotes-16.jpg |
156-
| http://www.sofreshandsogreen.com/wp-content/uploads/2012/01/martin-luther-king-jr-quote-sofreshandsogreendotcom.jpg |
157-
| https://everydaypowerblog.com/wp-content/uploads/2014/01/Martin-Luther-King-Jr.-Quotes-18.jpg |
158-
| https://tsal-eszuskq0bptlfh8awbb.stackpathdns.com/wp-content/uploads/2018/01/MartinLutherKingQuotes.jpg |
159-
160114
## Speech-to-Text
161115

162116
The [Speech-to-text](../speech-service/index-speech-to-text.yml) service converts streams or files of spoken audio to text. In this sample, we transcribe two audio files. The first file is easy to understand, and the second is more challenging.

0 commit comments

Comments
 (0)