You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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 inrange(100)]
134
-
# Since web content is our data, we create a dataframe with options on that data: offsets
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.
[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
-
importorg.apache.spark.ml.Pipeline
122
-
123
-
// Number of images Bing will return per query
124
-
valimgsPerBatch=10
125
-
126
-
// A list of offsets, used to page into the search results
127
-
valdf= (0 until 100).map(o =>Tuple1(o*imgsPerBatch)).toSeq.toDF("offset")
128
-
129
-
// Run the Bing Image Search service with our text query
130
-
valbingSearch=newBingImageSearch()
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
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