Skip to content

Commit e2fe156

Browse files
committed
update article
1 parent 0997e86 commit e2fe156

File tree

1 file changed

+15
-83
lines changed

1 file changed

+15
-83
lines changed

articles/stream-analytics/stream-analytics-twitter-sentiment-analysis-trends.md

Lines changed: 15 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -197,25 +197,12 @@ To compare the number of mentions among topics, you can use a [Tumbling window](
197197
5. Change the query in the code editor to the following and select **Test query**:
198198

199199
```sql
200-
SELECT System.Timestamp as Time, Topic, COUNT(*)
201-
FROM TwitterStream TIMESTAMP BY CreatedAt
202-
GROUP BY TUMBLINGWINDOW(s, 5), Topic
203-
```
204-
205-
6.
206-
207-
## Experiment using different fields from the stream
208-
209-
The following table lists the fields that are part of the JSON streaming data. Feel free to experiment in the query editor.
210-
211-
|JSON property | Definition|
212-
|--- | ---|
213-
|CreatedAt | The time that the tweet was created|
214-
|Topic | The topic that matches the specified keyword|
215-
|SentimentScore | The sentiment score from Sentiment140|
216-
|Author | The Twitter handle that sent the tweet|
217-
|Text | The full body of the tweet|
200+
SELECT System.Timestamp as Time, text
201+
FROM TwitterStream
202+
WHERE text LIKE '%Azure%'
203+
```
218204

205+
6. This query returns all tweets that include the keyword *Azure*.
219206

220207
## Create an output sink
221208

@@ -225,81 +212,26 @@ In this how-to guide, you write the aggregated tweet events from the job query t
225212

226213
## Specify the job output
227214

228-
1. In the **Job Topology** section, click the **Output** box.
215+
1. Under the **Job Topology** section on the left navigation menu, select **Outputs**.
229216

230-
2. In the **Outputs** blade, click **+ Add** and then fill out the blade with these values:
217+
2. In the **Outputs** page, click **+ Add** and **Blob storage/Data Lake Storage Gen2**:
231218

232219
* **Output alias**: Use the name `TwitterStream-Output`.
233-
* **Sink**: Select **Blob storage**.
234-
* **Import options**: Select **Use blob storage from current subscription**.
235-
* **Storage account**. Select **Create a new storage account.**
236-
* **Storage account** (second box). Enter `YOURNAMEsa`, where `YOURNAME` is your name or another unique string. The name can use only lowercase letters and numbers, and it must be unique across Azure.
237-
* **Container**. Enter `socialtwitter`.
238-
The storage account name and container name are used together to provide a URI for the blob storage, like this:
239-
240-
`http://YOURNAMEsa.blob.core.windows.net/socialtwitter/...`
241-
242-
!["New output" blade for Stream Analytics job](./media/stream-analytics-twitter-sentiment-analysis-trends/stream-analytics-create-output-blob-storage.png)
243-
244-
4. Click **Create**.
245-
246-
Azure creates the storage account and generates a key automatically.
247-
248-
5. Close the **Outputs** blade.
249-
220+
* **Import options**: Select **Select storage from your subscriptions**.
221+
* **Storage account**. Select your storage account.
222+
* **Container**. Select **Create new** and enter `socialtwitter`.
223+
224+
4. Select **Save**.
250225

251226
## Start the job
252227

253228
A job input, query, and output are specified. You are ready to start the Stream Analytics job.
254229

255-
1. Make sure that the TwitterWpfClient application is running.
256-
257-
2. In the job blade, click **Start**.
258-
259-
![Start the Stream Analytics job](./media/stream-analytics-twitter-sentiment-analysis-trends/stream-analytics-sa-job-start-output.png)
260-
261-
3. In the **Start job** blade, for **Job output start time**, select **Now** and then click **Start**.
262-
263-
!["Start job" blade for the Stream Analytics job](./media/stream-analytics-twitter-sentiment-analysis-trends/stream-analytics-sa-job-start-job-blade.png)
264-
265-
Azure notifies you when the job has started, and in the job blade, the status is displayed as **Running**.
266-
267-
![Job running](./media/stream-analytics-twitter-sentiment-analysis-trends/jobrunning.png)
268-
269-
## View output for sentiment analysis
270-
271-
After your job has started running and is processing the real-time Twitter stream, you can view the output for sentiment analysis.
272-
273-
You can use a tool like [Azure Storage Explorer](https://storageexplorer.com/) or [Azure Explorer](https://www.cerebrata.com/products/azure-explorer/introduction) to view your job output in real time. From here, you can use [Power BI](https://powerbi.com/) to extend your application to include a customized dashboard like the one shown in the following screenshot:
274-
275-
![Power BI](./media/stream-analytics-twitter-sentiment-analysis-trends/power-bi.png)
276-
277-
278-
## Create another query to identify trending topics
279-
280-
Another query you can use to understand Twitter sentiment is based on a [Sliding Window](https://docs.microsoft.com/stream-analytics-query/sliding-window-azure-stream-analytics). To identify trending topics, you look for topics that cross a threshold value for mentions in a specified amount of time.
281-
282-
For the purposes of this how-to, you check for topics that are mentioned more than 20 times in the last 5 seconds.
283-
284-
1. In the job blade, click **Stop** to stop the job.
285-
286-
2. In the **Job Topology** section, click the **Query** box.
287-
288-
3. Change the query to the following:
289-
290-
```
291-
SELECT System.Timestamp as Time, Topic, COUNT(*) as Mentions
292-
FROM TwitterStream TIMESTAMP BY CreatedAt
293-
GROUP BY SLIDINGWINDOW(s, 5), topic
294-
HAVING COUNT(*) > 20
295-
```
296-
297-
4. Click **Save**.
298-
299-
5. Make sure that the TwitterWpfClient application is running.
230+
1. Make sure the TwitterClientCore application is running.
300231

301-
6. Click **Start** to restart the job using the new query.
232+
2. In the job overview, select **Start**.
302233

234+
3. On the **Start job** page, for **Job output start time**, select **Now** and then select **Start**.
303235

304236
## Get support
305237
For further assistance, try our [Azure Stream Analytics forum](https://social.msdn.microsoft.com/Forums/azure/home?forum=AzureStreamAnalytics).

0 commit comments

Comments
 (0)